Re: The Unwanted Effect of XBL Shadow DOM Elements on Layout

On Thu, Apr 7, 2011 at 7:52 AM, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
> This extra line box interferes with the table layout algorithm, which makes
> the second cell end up with its own independent table and table-row layout
> boxes around it.  This is undesirable.
>
> It seems that with bindings, this is likely to be a common scenario, where
> it would be useful to eliminate the effect of unwanted layout boxes from a
> binding.
>
> For this, one solution we came up with was a new value for 'display' that
> means to not generate a layout box for the element, but to still render the
> child content within as if the element itself wasn't there.
>
>  display: transparent;
>
> Such a value would mean the shadow element could be toggled between 'none'
> and 'transparent', and thus not have any unwanted side effects on the
> layout.

+1.  We have also run into this problem in our discussion of
XBL2/Component use-cases, and in fact already use essentially this
concept in our Component implementation - the root of a shadow tree is
implemented as an element, but it doesn't appear in the box tree.

~TJ

Received on Thursday, 7 April 2011 15:44:05 UTC