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

On Thu, Apr 7, 2011 at 6:54 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 4/7/11 4:51 PM, Tab Atkins Jr. wrote:
>>
>> On Thu, Apr 7, 2011 at 2:09 PM, Boris Zbarsky<bzbarsky@mit.edu>  wrote:
>>>
>>> Does the shadow root have the bound element as the parent?
>>>
>>> If not, then this doesn't sound equivalent.
>>
>> Yes, for some definition of "parent".
>
> I'm talking about the .parentNode definition of "parent".

In WebKit today, shadow DOM subtree roots have a null parentNode.
Instead, there is a special accessor called shadowHost, which is what
you need to explicitly walk over of the boundary.

However, internally both are stored in the same field and there's a
flag that indicates the purpose of what's stored there:

http://codesearch.google.com/codesearch/p#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/dom/Node.h&l=723&exact_package=chromium

:DG<

>
> -Boris
>
>
>

Received on Friday, 8 April 2011 16:30:07 UTC