W3C home > Mailing lists > Public > public-i18n-bidi@w3.org > July to September 2012

RE: [cssom-view] value of scrollLeft in RTL situations is completely busted across browsers

From: Matitiahu Allouche <matitiahu.allouche@gmail.com>
Date: Wed, 8 Aug 2012 19:16:00 +0300
To: "'Kang-Hao \(Kenny\) Lu'" <kanghaol@oupeng.com>, "'ML publc-i18n-bidi'" <public-i18n-bidi@w3.org>
Cc: "'Robert O'Callahan'" <robert@ocallahan.org>
Message-ID: <4d7801cd7581$1b1dc820$51595860$@gmail.com>
My view is that working in RTL should be symmetrical to working in LTR. Thus, scrollLeft=0 should correspond to the logical starting point of the page both for LTR and for RTL. For LTR, that will  be on the left side and for RTL that will be on the right side.
Increasing positive values of scrollLeft will reflect going forward in the page direction, to the right for LTR and to the left for RTL.

The name "scrollLeft" is not suggestive of such a behavior. Maybe it should be changed to "scrollHorizontal" or something else which does not reflect a LTR bias.

Shalom (Regards),  Mati

-----Original Message-----
From: Kang-Hao (Kenny) Lu [mailto:kanghaol@oupeng.com] 
Sent: Monday, August 06, 2012 2:12 PM
To: ML publc-i18n-bidi
Cc: Robert O'Callahan
Subject: Fwd: [cssom-view] value of scrollLeft in RTL situations is completely busted across browsers

Forwarding this to public-i18n-bidi.

-------- Original Message --------
Subject: [cssom-view] value of scrollLeft in RTL situations is completely  busted across browsers
Resent-Date: Mon, 06 Aug 2012 11:07:45 +0000
Resent-From: www-style@w3.org
Date: Mon, 6 Aug 2012 23:07:10 +1200
From: Robert O'Callahan <robert@ocallahan.org>
Reply-To: robert@ocallahan.org
To: www-style <www-style@w3.org>

How should scrollLeft work with RTL? There are some major differences across browsers.
http://people.mozilla.org/~roc/test_rtl_scrollLeft.html
Try scrolling the elements and clicking in them.

In Gecko nightly, scrollLeft=0 corresponds to the rightmost scrolled position and increases from left to right (so scroll positions are negative). Opera seems to behave the same way.

Chrome (22 dev) behaves the same way when scrolling the viewport (for both toplevel documents and iframes). Unfortunately scrolling a regular element works quite differently: scrollLeft=0 corresponds to the leftmost scroll position (but still increases to the right).

In IE9, scrollLeft=0 corresponds to the rightmost scrolled position but scrollLeft increases as you scroll from right to left!

I'm unsure which behavior is best. I think most Web content I've seen that uses scrollLeft assumes its minimum value is zero and it increases from left to right, because of course that's how LTR behaves. Unfortunately that's almost the least popular option in implementations. I'm considering changing Gecko to do it that way for RTL anyway. AFAIK the main disadvantage of that approach (other than being a behavior change) is that you lose the ability to easily scroll "to the start" by setting scrollLeft to 0. Then again, I haven't noticed people trying to do that on the horizontal axis.

Any thoughts, before I go ahead? :-)

Rob
Received on Wednesday, 8 August 2012 16:16:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:24:40 UTC