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