[csswg-drafts] [cssom-view-1] Clarify/specify scrollLeft value in right-to-left mode

phistuck has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view-1] Clarify/specify scrollLeft value in right-to-left mode ==
Specification section -
https://drafts.csswg.org/cssom-view/#dom-element-scrollleft

>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)

<table>
<thead>
<tr>
  <th>Browser</th>
  <th>Type</th>
  <th>Most Left</th>
  <th>Most Right</th>
  <th>Initial</th>
</tr>
</thead>
<tbody>
<tr>
  <td>WebKit</td>
  <td>default</td>
  <td>0</td>
  <td>100</td>
  <td>100</td>
</tr>
<tr>
  <td>Firefox/Opera</td>
  <td>negative</td>
  <td>-100</td>
  <td>0</td>
  <td>0</td>
</tr>
<tr>
  <td>IE</td>
  <td>reverse</td>
  <td>100</td>
  <td>0</td>
  <td>0</td>
</tr>
<tbody>
</table>



The current cross-browser situation is pretty awful, the most sane behavior (whichever it may be) should be specified.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1354 using your GitHub account

Received on Thursday, 11 May 2017 22:20:26 UTC