Commit 7268e93a authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Chromium LUCI CQ

Container Queries: missing condition for traversing child

Traverse child if we are updating container query dependent descendants
even if the child is not affected.

Bug: 1146097
Change-Id: I4beeee65b9c25469ef052abef75701f077f5cc87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2621757Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842483}
parent adc8ece2
...@@ -3752,7 +3752,7 @@ TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) { ...@@ -3752,7 +3752,7 @@ TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) {
<span class="affected"></span> <span class="affected"></span>
<span></span> <span></span>
<span class="affected"></span> <span class="affected"></span>
<span></span> <span><span class="affected"></span></span>
<span class="affected"></span> <span class="affected"></span>
<div style="display:none" class="affected"> <div style="display:none" class="affected">
<span class="affected"></span> <span class="affected"></span>
...@@ -3790,7 +3790,7 @@ TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) { ...@@ -3790,7 +3790,7 @@ TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) {
GetStyleEngine().UpdateStyleAndLayoutTreeForContainer(*container2); GetStyleEngine().UpdateStyleAndLayoutTreeForContainer(*container2);
// Three direct span.affected children, and the two display:none elements. // Three direct span.affected children, and the two display:none elements.
EXPECT_EQ(5u, GetStyleEngine().StyleForElementCount() - start_count); EXPECT_EQ(6u, GetStyleEngine().StyleForElementCount() - start_count);
} }
TEST_F(StyleEngineTest, MarkStyleDirtyFromContainerRecalc) { TEST_F(StyleEngineTest, MarkStyleDirtyFromContainerRecalc) {
......
...@@ -19,7 +19,8 @@ bool StyleRecalcChange::TraversePseudoElements(const Element& element) const { ...@@ -19,7 +19,8 @@ bool StyleRecalcChange::TraversePseudoElements(const Element& element) const {
} }
bool StyleRecalcChange::TraverseChild(const Node& node) const { bool StyleRecalcChange::TraverseChild(const Node& node) const {
return ShouldRecalcStyleFor(node) || node.ChildNeedsStyleRecalc(); return ShouldRecalcStyleFor(node) || node.ChildNeedsStyleRecalc() ||
RecalcContainerQueryDependent();
} }
bool StyleRecalcChange::ShouldRecalcStyleFor(const Node& node) const { bool StyleRecalcChange::ShouldRecalcStyleFor(const Node& node) const {
......
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