Index: third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp |
diff --git a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp |
index b28c9cdeeba35135afaa39a6f6ef67a17e52ce31..bdd725367b52362c8e8b1467a80624cda458dd85 100644 |
--- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp |
+++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp |
@@ -96,16 +96,25 @@ void StyleInvalidator::scheduleSiblingInvalidationsAsDescendants(const Invalidat |
PendingInvalidations& pendingInvalidations = ensurePendingInvalidations(schedulingParent); |
+ schedulingParent.setNeedsStyleInvalidation(); |
+ |
for (auto& invalidationSet : invalidationLists.siblings) { |
+ if (invalidationSet->wholeSubtreeInvalid()) { |
+ schedulingParent.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator)); |
+ return; |
+ } |
if (invalidationSet->invalidatesSelf() && !pendingInvalidations.descendants().contains(invalidationSet)) |
pendingInvalidations.descendants().append(invalidationSet); |
if (DescendantInvalidationSet* descendants = toSiblingInvalidationSet(*invalidationSet).siblingDescendants()) { |
+ if (descendants->wholeSubtreeInvalid()) { |
+ schedulingParent.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator)); |
+ return; |
+ } |
if (!pendingInvalidations.descendants().contains(descendants)) |
pendingInvalidations.descendants().append(descendants); |
} |
} |
- schedulingParent.setNeedsStyleInvalidation(); |
} |
void StyleInvalidator::clearInvalidation(ContainerNode& node) |