DescriptionAllow <use> inside author shadow roots
This patch fixes a bug where <use> elements did not work in author shadow
trees due to a restriction that <use> trees are not expanded inside
shadow trees. This restriction was in place so that we don't nest <use>
shadow trees but instead expand nested <use> elements manually using
the top-level <use> element.
For example:
<defs>
__<use id="a">
____<rect>
__<use id="b" xlink:href="#a">
</defs>
<use id="c" xlink:href="#b">
When creating the "c" shadow tree, "b" is first added:
<use id="c">
__#user-agent-shadow-root
____<use id="b">
And then "b" is "expanded" (see: expandUseElementsInShadowTree):
<use id="c">
__#user-agent-shadow-root
____<g id="b">
______<use id="a">
Finally "a" is "expanded":
<use id="c">
__#user-agent-shadow-root
____<g id="b">
______<g id="a">
________<rect>
The checks preventing <use> tree expansion in shadow trees were
intended to prevent the nested <use> elements (or <symbol>) from
creating nested shadow roots--notice there is only one shadow root
in the above example.
This patch switches the isInShadowTree checks with isInUserAgentShadowTree
which will prevent <use> elements from cloning their targets when nested
inside another <use> shadow tree, but allow <use> elements with author
shadow roots.
BUG=356891
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170614
Patch Set 1 #Patch Set 2 : Remove loop in isInUserAgentShadowTree, add a title test #
Messages
Total messages: 11 (0 generated)
|