Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature detection should not set scrollLeft coordinate to a positive value #6

Closed
fred-wang opened this issue Feb 14, 2020 · 4 comments

Comments

@fred-wang
Copy link
Contributor

fred-wang commented Feb 14, 2020

As part of Chromium web interoperability effort, we are trying to address these inconcistencies by switching to the standard "negative" type ( see https://www.chromestatus.com/feature/5759578031521792 ). In particular, we are trying to measure websites using non-standard "default" type that could potentially be broken by this behavior change. For that purpose, we analyze web pages setting scroll coordinates to positive values (when they are really expected to be nonpositive).

This library is a nice way to feature detect scroll inconsistencies between browsers but it is causing websites to trigger our use counters because of the operation definer.scrollLeft = 1;. Can you please modify it to instead rely on scrollIntoView() instead?

Here is an example:

https://people.igalia.com/fwang/scrollable-elements-in-non-default-writing-modes/scroll-coordinates-behavior.js

@othree
Copy link
Owner

othree commented Feb 14, 2020

I would like to upgrade the code.
But I don't think the websites already using this lib will upgrade it.
How do you solve this situation?

@fred-wang
Copy link
Contributor Author

@othree Thanks. Right, we will need to tell websites to upgrade to the new code and that's not going to be easy, but obviously it's easier if the upstream code is fixed first. (I believe we had similar issues in the past with smoothscroll.js using document.body instead of document.documentElement to scroll the page).

@fred-wang fred-wang mentioned this issue Feb 15, 2020
fred-wang added a commit to fred-wang/jquery.rtl-scroll-type that referenced this issue Feb 15, 2020
The Chromium community is moving to standard behavior from the CSSOM
specification [1]. In order to launch the feature and analyze potential
broken URLs, they are counting pages setting the scrollLeft of a RTL
scroller to a positive value. Websites using the current version of
jquery.rtl-scroll will trigger the counter [2]. In order to workaround
that issue, rely on Element.scrollIntoView() instead.

This patch also replaces text with divs and removes scrollbar from
the scroller, in order to make measurements more reliable.

[1] https://www.chromestatus.com/feature/5759578031521792
[2] othree#6
@fred-wang
Copy link
Contributor Author

@othree I've opened #7

fred-wang added a commit to fred-wang/jquery.rtl-scroll-type that referenced this issue Feb 15, 2020
scrollIntoView() might scroll the page, so make things safer by
wrapping into a 'position: fixed' scroller.

othree#6
@fred-wang
Copy link
Contributor Author

I guess this can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants