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

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

/koji

Received on Friday, 6 May 2016 05:30:51 UTC