Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp

Issue 1533683002: Persist invalidation sets on detach root (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid detaching when in inactive state Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6cd632a3bcb8d1de8cc3cd032d7a8a92c4c5a921..d8543093af7228db4c4da7979bf302ec2a8260e4 100644
--- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -43,23 +43,22 @@ void StyleInvalidator::invalidate(Document& document)
void StyleInvalidator::scheduleInvalidationSetsForElement(const InvalidationLists& invalidationLists, Element& element)
{
ASSERT(element.inActiveDocument());
- if (element.styleChangeType() >= SubtreeStyleChange)
- return;
-
bool requiresDescendantInvalidation = false;
- for (auto& invalidationSet : invalidationLists.descendants) {
- if (invalidationSet->wholeSubtreeInvalid()) {
- element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
- clearInvalidation(element);
- return;
- }
+ if (element.styleChangeType() < SubtreeStyleChange) {
+ for (auto& invalidationSet : invalidationLists.descendants) {
+ if (invalidationSet->wholeSubtreeInvalid()) {
+ element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
+ requiresDescendantInvalidation = false;
+ break;
+ }
- if (invalidationSet->invalidatesSelf())
- element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
+ if (invalidationSet->invalidatesSelf())
+ element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
- if (!invalidationSet->isEmpty())
- requiresDescendantInvalidation = true;
+ if (!invalidationSet->isEmpty())
+ requiresDescendantInvalidation = true;
+ }
}
if (!requiresDescendantInvalidation && (invalidationLists.siblings.isEmpty() || !element.nextSibling()))

Powered by Google App Engine
This is Rietveld 408576698