Commit 60c01b78 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Check V0 insertion point before shadow root.

It is possible to create a shadow root on a Shadow DOM V0 insertion
point. However, if it's an active insertion point, we render the
distributed children and not the shadow subtree. Make sure we traverse
the distributed children in that case, and not the shadow tree, when
FlatTreeStyleRecalc is enabled.

TEST=fast/dom/shadow/shadowroot-of-insertionpoint.html

Bug: 972752
Change-Id: I9158a5d669764a049acb9780dccc4ae1b0ff87b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875735
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708971}
parent ec04274d
......@@ -3010,7 +3010,10 @@ void Element::RecalcStyle(const StyleRecalcChange change) {
if (child_change.TraverseChildren(*this)) {
SelectorFilterParentScope filter_scope(*this);
if (ShadowRoot* root = GetShadowRoot()) {
if (IsActiveV0InsertionPoint(*this)) {
To<V0InsertionPoint>(this)->RecalcStyleForInsertionPointChildren(
child_change);
} else if (ShadowRoot* root = GetShadowRoot()) {
if (RuntimeEnabledFeatures::FlatTreeStyleRecalcEnabled()) {
root->RecalcDescendantStyles(child_change);
} else {
......@@ -3020,9 +3023,6 @@ void Element::RecalcStyle(const StyleRecalcChange change) {
}
} else if (auto* slot = ToHTMLSlotElementIfSupportsAssignmentOrNull(this)) {
slot->RecalcStyleForSlotChildren(child_change);
} else if (IsActiveV0InsertionPoint(*this)) {
To<V0InsertionPoint>(this)->RecalcStyleForInsertionPointChildren(
child_change);
} else {
RecalcDescendantStyles(child_change);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment