Page MenuHomePhabricator

Audit probably incorrect uses of .scrollLeft (bad scrolling-related operations in RTL)
Closed, ResolvedPublic

Description

Different browsers have differing implementations of the .scrollLeft property for RTL content (nicely described at https://github.com/othree/jquery.rtl-scroll-type#3-types-of-scrollleft-scrollwidth--100) and it looks like we never handle these differences in OOUI, so presumably almost all of our usages of .scrollLeft result in incorrect behavior in RTL. We should look at them and fix them.

https://gerrit.wikimedia.org/r/339053 adds OO.ui.Element.static.getScrollLeft(), which is a consistent getter method for this. There's no setter method currently.

Currently, the following functions use scrollLeft:

  • OO.ui.Element.static.getDimensions
  • OO.ui.Element.static.scrollIntoView
  • OO.ui.Element.static.reconsiderScrollbars
    • Looks OK, we don't look at the value, only get it and set it back.
  • OO.ui.mixin.ClippableElement.prototype.clip
    • This is actually $(window).scrollLeft(), which is another can of worms.

Event Timeline

Change 521389 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] Element: Implement #setScrollLeft and use where needed

https://gerrit.wikimedia.org/r/521389

Change 521389 merged by jenkins-bot:
[oojs/ui@master] Element: Implement #setScrollLeft and use where needed

https://gerrit.wikimedia.org/r/521389

Change 521875 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[mediawiki/core@master] Update OOUI to v0.33.2

https://gerrit.wikimedia.org/r/521875

Change 521875 merged by jenkins-bot:
[mediawiki/core@master] Update OOUI to v0.33.2

https://gerrit.wikimedia.org/r/521875

matmarex edited projects, added OOUI (OOUI-0.33.2); removed OOUI.