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

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

Issue 1533063002: Adding/Removing same class multiple times schedules same invalidation set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating as per review comments 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 | no next file » | 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 6cd632a3bcb8d1de8cc3cd032d7a8a92c4c5a921..67ab7acaf02a820acb65485d6832ca01a08f0221 100644
--- a/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/third_party/WebKit/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -69,8 +69,11 @@ void StyleInvalidator::scheduleInvalidationSetsForElement(const InvalidationList
PendingInvalidations& pendingInvalidations = ensurePendingInvalidations(element);
if (element.nextSibling()) {
- for (auto& invalidationSet : invalidationLists.siblings)
+ for (auto& invalidationSet : invalidationLists.siblings) {
+ if (pendingInvalidations.siblings().contains(invalidationSet))
+ continue;
pendingInvalidations.siblings().append(invalidationSet);
+ }
}
if (!requiresDescendantInvalidation)
@@ -78,8 +81,11 @@ void StyleInvalidator::scheduleInvalidationSetsForElement(const InvalidationList
for (auto& invalidationSet : invalidationLists.descendants) {
ASSERT(!invalidationSet->wholeSubtreeInvalid());
- if (!invalidationSet->isEmpty())
- pendingInvalidations.descendants().append(invalidationSet);
+ if (invalidationSet->isEmpty())
+ continue;
+ if (pendingInvalidations.descendants().contains(invalidationSet))
+ continue;
+ pendingInvalidations.descendants().append(invalidationSet);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698