Skip to content

Commit

Permalink
Check V0 insertion point before shadow root.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/master@{#708971}
  • Loading branch information
lilles authored and Commit Bot committed Oct 24, 2019
1 parent ec04274 commit 60c01b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions third_party/blink/renderer/core/dom/element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
Expand Down

0 comments on commit 60c01b7

Please sign in to comment.