Re: [cssom-view] More getBoxQuads/convert*FromNode issues

On Thu, Sep 19, 2013 at 10:55 PM, Robert O'Callahan
<robert@ocallahan.org> wrote:
> What should getBoxQuads() on a table element return? Obvious options:
> 1) a quad for the "inner table box" (the box with the rows and columns,
> which has the table border on it)
> 2) a quad for the "outer table box" (the box enclosing the inner table box
> and any caption box, which has the table margins on it)
> 3) a quad for the "inner table box" and a quad for the caption box
>
> For the analogous question with getClientRects(), Gecko currently does #3,
> which is explicitly mandated as a special case in the CSSOM Views spec:
> http://dev.w3.org/csswg/cssom-view/#dom-element-getclientrects
> I think the rationale is that we want getBoundingClientRect() on a table to
> include the caption area, but option #2 (which is what Chrome
> getClientRects() does) doesn't match the box where the border is drawn and
> doesn't give you a way to get the inner table box geometry).
>
> In a way, the most logical thing to do for getBoxQuads would be to use the
> inner table box for "content", "padding" and "border" boxes and use the
> outer table box for "margin" boxes and ignore the caption altogether, but
> that could still confuse authors. I'm not sure what to do, other than curse
> tables.

I say cursing tables is the best idea.

But yeah, your choice seems reasonable here.  Having border-box return
something other than the box that the border surrounds would be
super-confusing and bad.  Having margin-box return something other
than the extent of the margins would be super-confusing and bad.
Having the two differ by more than just the size of the margins is
also confusing and bad, but less so I think - it makes the feature
less consistent between results, but keeps each individual call
consistent.

> Smaller issues: Should DOMPoint/DOMRect/DOMQuad constructors/attributes
> allow unrestricted doubles? I think probably not.

I think not.

> What about list bullets: should they contribute quads to getQuadList? I
> think anonymous decorations like list bullets probably should not.

No, list bullets come from the child ::marker pseudos.  They're not
part of the list-item itself.

~TJ

Received on Friday, 20 September 2013 17:20:36 UTC