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); |
} |
} |