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

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

From: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Mon, 06 Aug 2012 19:11:54 +0800
Message-ID: <501FA67A.5090204@oupeng.com>
To: ML publc-i18n-bidi <public-i18n-bidi@w3.org>
CC: Robert O'Callahan <robert@ocallahan.org>
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 Monday, 6 August 2012 11:12:58 UTC

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