W3C home > Mailing lists > Public > www-style@w3.org > August 2012

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

From: Shane Stephens <shans@google.com>
Date: Tue, 7 Aug 2012 14:55:15 +1000
Message-ID: <CAGTfzwQsadz3vYcr4sCfG5xy0yUhcSJJOa1ULN4RiURtD=o0-A@mail.gmail.com>
To: robert@ocallahan.org
Cc: www-style <www-style@w3.org>
Hi Roc,

Personally I think IE9 has it right... it seems to match my intuition that
RTL is a mirror version of LTR, and conserves the ability to scroll to the
start by setting scrollLeft to 0.

Perhaps this is something that needs to be discussed in a CSSWG meeting? It
seems there's wide divergence in implementations.


On Mon, Aug 6, 2012 at 9:07 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> 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
> --
> “You have heard that it was said, ‘Love your neighbor and hate your
> enemy.’ But I tell you, love your enemies and pray for those who persecute
> you, that you may be children of your Father in heaven. ... If you love
> those who love you, what reward will you get? Are not even the tax
> collectors doing that? And if you greet only your own people, what are you
> doing more than others?" [Matthew 5:43-47]
Received on Tuesday, 7 August 2012 04:55:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:02 UTC