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

On Wed, Aug 8, 2012 at 2:48 PM, Robert O'Callahan <>wrote:

> jQuery exports a global "scrollLeft" method that is implemented to use
> window.pageXOffset when that's available and documentElement.scrollLeft
> otherwise. In RTL situations, pageXOffset in IE behaves like
> documentElement.scrollLeft in Gecko, Webkit and Opera.
> Mootools and Prototype.js do the same thing:
> I also found code that adds up scrollLeft values along a chain of DOM
> ancestors:
> That obviously would break if scrollLeft sometimes points in different
> directions.
> Based on this data, I propose we adopt the Gecko/Opera behavior for both
> viewport and non-viewport scrolling. (I assume everyone agrees that Webkit
> treating them differently is a bug.)

I expect there wouldn't be opposition to changing WebKit as long as the
compatibility hit is not too large. Can't know for sure until the patch is
committed and shipped of course. Certainly looks like a bug to me that
viewport and non-viewport scrolling give different results. Filed

> If we need a property that always starts at 0 and progresses left in RTL
> situations, I suggest creating a new "scrollHorizontal" property for that.

How about scrollStart to be consistent with marginStart, et. al. from CSS?
Then it can also do the right thing in vertical writing-mode (e.g. set the
scrollTop). Obviously, we'd want to add scrollBefore as well to be the
logical equivalent to scrollTop.

Received on Saturday, 18 August 2012 01:42:33 UTC