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

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

Issue 1516863004: Revert of Remove clearing of pending invalidation sets. (patchset #2 id:20001 of https://codereview… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2587
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 453479c8ce684b202d19f90d1ff2e7c511924bf1..db5fa17e453f15b34e8499e989ab087bbcc3568d 100644
--- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -43,22 +43,23 @@ void StyleInvalidator::invalidate(Document& document)
void StyleInvalidator::scheduleInvalidationSetsForElement(const InvalidationLists& invalidationLists, Element& element)
{
ASSERT(element.inActiveDocument());
+ if (element.styleChangeType() >= SubtreeStyleChange)
+ return;
+
bool requiresDescendantInvalidation = false;
- if (element.styleChangeType() < SubtreeStyleChange) {
- for (auto& invalidationSet : invalidationLists.descendants) {
- if (invalidationSet->wholeSubtreeInvalid()) {
- element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
- requiresDescendantInvalidation = false;
- break;
- }
+ for (auto& invalidationSet : invalidationLists.descendants) {
+ if (invalidationSet->wholeSubtreeInvalid()) {
+ element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleInvalidator));
+ clearInvalidation(element);
+ return;
+ }
- 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 (invalidationLists.siblings.isEmpty() && !requiresDescendantInvalidation)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698