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

On Tue, Apr 15, 2014 at 1:39 AM, Simon Pieters <simonp@opera.com> wrote:

> On Mon, 14 Apr 2014 00:28:07 +0200, Robert O'Callahan <
> robert@ocallahan.org> wrote:
>
>  Currently the spec requires the behavior Chrome has for elements, that is,
>>> physical dimensions with 0 being on the left and increasing to the right,
>>> regardless of block flow direction and inline base direction. This seems
>>> like the most sane thing to me.
>>>
>>
>>
>> It seems to me that the current CSSOM draft results in inconsistent
>> behavior between scrollLeft on the root element and scrollLeft on other
>> elements: when the entire document is RTL, scrollLeft on the root element
>> returns negative values when the viewport is scrolled to the left, but
>> when
>> a normal element is scrolled to the left, scrollLeft does not return
>> negative values. Is that correct? Because that doesn't seem very sane to
>> me
>> :-).
>>
>
> Hmm. That wasn't the intention. But I can see that "initial containing
> block origin" is maybe the top right corner for RTL? I meant the left edge
> of the initial containing block.
>
> Filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=25341


That's what I thought you meant, so I don't see how that change helps.

Suppose I have an RTL page with content overflowing to the left, and the
user scrolls to the left by 100px, and the viewport is 200px x 200px (and
let's assume scrollbars don't take any width). CSS 2.1 says that the
initial containing block has the dimensions of the viewport and "is
anchored at the canvas origin"; in this case I think that means the right
edge of the ICB is 100px to the right of the viewport's right edge and the
left edge of the ICB is exactly 100px to the right of the viewport's left
edge. That means scrollX is -100.

Rob
-- 
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w

Received on Tuesday, 15 April 2014 00:06:23 UTC