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.

Details

Related Gerrit Patches:

Event Timeline

matmarex created this task.Feb 21 2017, 9:41 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 21 2017, 9:41 PM
matmarex updated the task description. (Show Details)Feb 21 2017, 9:48 PM
Volker_E updated the task description. (Show Details)Jun 26 2019, 9:59 PM
Volker_E added a subscriber: Volker_E.

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

matmarex claimed this task.Jul 9 2019, 7:53 PM

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 closed this task as Resolved.Jul 11 2019, 8:07 PM
matmarex edited projects, added OOUI (OOUI-0.33.2); removed OOUI.