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

Improper use of scrollLeft and scrollRight in resetTriggers in non-default writing modes #61

Open
fred-wang opened this issue Jan 10, 2020 · 1 comment

Comments

@fred-wang
Copy link

cc @cathiechen

The resetTriggers function sets the scrollLeft/scrollTop properties of the expand/contract children of the resize-triggers div to a non-negative value.

However, this is incorrect in some non-default writing modes where scrollLeft/scrollTop must be non-positive. See https://people.igalia.com/fwang/scrollable-elements-in-non-default-writing-modes/ ; Chrome is going to change to use the standard behavior https://www.chromestatus.com/feature/5759578031521792

I'm not really sure how this polyfill for ResizeObserver is working, but a possible fix would be to force "direction: ltr; writing-mode: horizontal-tb;" on the expand/contract div. Or check the actual CSS direction/writing-mode to determine whether to use positive/negative values.

fred-wang added a commit to fred-wang/javascript-detect-element-resize that referenced this issue Feb 15, 2020
The Chromium community is moving to scroll position values indicated in
the CSSOM specification [1]. In order to launch the feature and analyze
potential broken URLs, they count pages setting the scroll position of
a scroller in non-default writing mode to a positive value. Websites
using javascript-detect-element-resize in RTL or vertical mode appear
in the top results and cause a lot of false positives [2]. In order to
avoid that, ensure that the resize triggers use the default writing
mode (direction: rtl and writing-mode: horizontal-tb).

[1] https://www.chromestatus.com/feature/5759578031521792
[2] sdecima#61
fred-wang added a commit to fred-wang/javascript-detect-element-resize that referenced this issue Feb 15, 2020
The Chromium community is moving to scroll position values indicated in
the CSSOM specification [1]. In order to launch the feature and analyze
potential broken URLs, they count pages setting the scroll position of
a scroller in non-default writing mode to a positive value. Websites
using javascript-detect-element-resize in RTL or vertical mode appear
in the top results and cause a lot of false positives [2]. In order to
avoid that, ensure that the resize triggers use the default writing
mode (direction: ltr and writing-mode: horizontal-tb).

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

@sdecima I opened #62 ; please take a look ;-)

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

1 participant