Bug 172028 - scrollLeft in RTL in not interoperable
Summary: scrollLeft in RTL in not interoperable
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2017-05-12 07:17 PDT by PhistucK
Modified: 2017-05-29 08:38 PDT (History)
1 user (show)

See Also:

Testcase (1.42 KB, text/html)
2017-05-29 08:37 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description PhistucK 2017-05-12 07:17:35 PDT
Please, join the discussion at https://github.com/w3c/csswg-drafts/issues/1354 for closing this one once and for all.

From https://github.com/othree/jquery.rtl-scroll-type -
Horizontal scrollbar with rtl(right to left) language support have different implement in different browsers.

[scrollLeft][mdn-scrollleft] in rtl element is not defined by any spec or standards. So different browser have different implement.
As far as I know, there are 3 implements: WebKit, Firefox/Opera, IE. WebKit's implement is the most easy to use implement.

Exactly the same as ltr(left to right) element. Except the initial position of scrollbar controller is at most right position.

Firefox has a clearly define in their mdn document. The most right position stands for 0. And when user scrolls to left. The value decreases. The value is possible to be negative in this implement.

IE thought the element is flip horizontal. So the most right position is 0. And if it scrolls to left. The value increase.

A table is below to make these cases more clear.

3 Types of scrollLeft (scrollWidth = 100)

Browser   Type       Most Left  Most Right  Initial
WebKit	  default    0          100         100
Gecko     negative   -100       0           0
IE        reverse    100        0           0
The current cross-browser situation is pretty awful, the most sane behavior (whichever it may be) should be specified.
Comment 1 Simon Fraser (smfr) 2017-05-29 08:37:23 PDT
Created attachment 311474 [details]
Comment 2 Simon Fraser (smfr) 2017-05-29 08:38:12 PDT
Testcase attached. WebKit behavior matches Gecko now.

Chrome uses negative coordinates for the document, but not for the overflow-scroll.

I think WebKit/Gecko behavior is correct here.