[Bug 18704] [Shadow]: How reset-style-inheritance flag of insertion point works with multiple show roots

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18704

--- Comment #2 from Takashi Sakamoto <tasak@google.com> 2012-09-05 09:37:18 UTC ---
Thank you for comments.

(In reply to comment #1)
> Can you help me understand the question a bit better? For this configuration:

Sure.

> 
> [#host]--[SR-4]->[shadow#4]
>   |      [SR-3]->[shadow#3]
>   |      [SR-2]->[shadow#2]
>   |      [SR-1]->[shadow#1]
>   +->[span]
> 
> The reset-style-inheritance applies at whichever <shadow> element it is set.

I see.
SR-4 is the oldest shadow root and SR-1 is the youngest shadow root, I think.


> For example, in this case:
> 
> 
> [#host]--[SR-4]->[style#a]
>   |         |
>   |         +->[shadow#4]
>   |
>   |      [SR-3]->[style#b]
>   |         |
>   |         +->[shadow#3]
>   |
>   |      [SR-2]->[style#c]
>   |         |
>   |         +->[shadow#2]
>   |
>   |      [SR-1]->[style#d]
>   |         |
>   |         +->[shadow#1]
>   +->[span]
> 
> answering the question whether a style from [style#a] inherits to [span]
> depends on whether there are any reset-inheritance-flags in [SR-3], [SR-2], or
> [SR-1].

I agree about reset-inheritance-flags of shadow roots.

So how do reset-inheritance-flags of insertion points work? c.f.
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-element

The following is my understanding:

Since [shadow#4] is the oldest shadow root, [span] is distributed to
[shadow#4],
 [shadow#4] is distributed to [shadow#3], ....
So I think, distribution is:

    [span] -> [shadow#4] -> [shadow#3] -> [shadow#2] -> [shadow#1]

As the spec says "the styles of the shadow insertion point node are inherited
by
 the child nodes of the shadow root of the shadow DOM subtree, distributed to
 this shadow insertion point",
- [span]     inherits the style of [shadow#4].
- [shadow#4] inherits the style of [shadow#3],
- [shadow#3] inherits the style of [shadow#2],
- [shadow#2] inherits the style of [shadow#1].

Shadow roots and insertion points don't have any styles (because they don't
have any renderers). [span] will inherit from the style of the parent node of
[shadow#1] (in this case, the style of the shadow host).

Whether the style of the shadow host inherits to [span] depends on whether
there are any reset-inheritance-flags in [shadow#1], [shadow#2], [shadow#3] and
[shadow#4].

Is this correct?

Best regards,
Takashi Sakamoto

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 5 September 2012 09:39:20 UTC