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

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

Issue 1514733002: Avoid unnecessary invalidation scheduling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary isMaster check 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 453479c8ce684b202d19f90d1ff2e7c511924bf1..d8543093af7228db4c4da7979bf302ec2a8260e4 100644
--- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -61,13 +61,16 @@ void StyleInvalidator::scheduleInvalidationSetsForElement(const InvalidationList
}
}
- if (invalidationLists.siblings.isEmpty() && !requiresDescendantInvalidation)
+ if (!requiresDescendantInvalidation && (invalidationLists.siblings.isEmpty() || !element.nextSibling()))
return;
element.setNeedsStyleInvalidation();
+
PendingInvalidations& pendingInvalidations = ensurePendingInvalidations(element);
- for (auto& invalidationSet : invalidationLists.siblings)
- pendingInvalidations.siblings().append(invalidationSet);
+ if (element.nextSibling()) {
+ for (auto& invalidationSet : invalidationLists.siblings)
+ pendingInvalidations.siblings().append(invalidationSet);
+ }
if (!requiresDescendantInvalidation)
return;
« no previous file with comments | « third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698