Re: [cssom-view] getBoundingClientRect() when the first rectangle is empty

On Fri, 06 May 2016 07:30:04 +0200, Koji Ishii <kojiishi@gmail.com> wrote:

> 2016-05-06 13:29 GMT+09:00 Tab Atkins Jr. <jackalmage@gmail.com>:
>
>> [please don't top-post https://wiki.csswg.org/tools/www-style]
>>
>> On Thu, May 5, 2016 at 10:28 AM, Myles C. Maxfield <mmaxfield@apple.com>
>> wrote:
>> > The spec has rather peculiar wording around this, as if it is making
>> special
>> > affordances to make sure the first rectangle is always in the return
>> value.
>> >
>> > Do we know why the current version is written this way?
>>
>> It's probably an attempt to be clever/compact and ensure that you
>> don't hit a degenerate case (no rectangles left).
>>
>> ~TJ
>>
>
> It looks like this was done for the feedback from roc[1], so that it
> returns a meaningful value for a collapsed range.
>
> But when Blink fixed this[2], authors complained to us that the algorithm
> is not reasonable when rects[0] is empty and rect[1] is not. I then  
> talked
> to roc to confirm that Gecko does what proposed here rather than what's
> currently spec'ed.
>
> [1] https://lists.w3.org/Archives/Public/www-style/2009Jul/0149.html
> [2] http://crbug.com/574363

Indeed. Thank you for investigating this. I've changed the spec as  
proposed:

https://github.com/w3c/csswg-drafts/commit/0e7a5cbdea19397086e9423b508fe6f41decdcec

-- 
Simon Pieters
Opera Software

Received on Sunday, 8 May 2016 05:34:50 UTC