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

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

Issue 273783003: Don't schedule invalidations when attributes changed if not needed or incorrect. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added test. Created 6 years, 7 months 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: Source/core/css/invalidation/StyleInvalidator.cpp
diff --git a/Source/core/css/invalidation/StyleInvalidator.cpp b/Source/core/css/invalidation/StyleInvalidator.cpp
index 4b9a24cec661e254a1a8deafe63cbcaf000422e2..e130e08eeba9727895cffc6bdfdd0362bd4674de 100644
--- a/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -28,6 +28,7 @@ void StyleInvalidator::invalidate(Document& document)
void StyleInvalidator::scheduleInvalidation(PassRefPtr<DescendantInvalidationSet> invalidationSet, Element& element)
{
+ ASSERT(element.inActiveDocument() && element.styleChangeType() < SubtreeStyleChange);
esprehn 2014/05/08 05:19:06 Lets split this into two ASSERTs, one per line. Wh
chrishtr 2014/05/08 05:29:18 Done.
InvalidationList& list = ensurePendingInvalidationList(element);
// If we're already going to invalidate the whole subtree we don't need to store any new sets.
if (!list.isEmpty() && list.last()->wholeSubtreeInvalid())
@@ -51,8 +52,6 @@ void StyleInvalidator::clearInvalidation(Node& node)
{
if (node.isElementNode() && node.needsStyleInvalidation())
m_pendingInvalidationMap.remove(toElement(&node));
- node.clearChildNeedsStyleInvalidation();
- node.clearNeedsStyleInvalidation();
}
void StyleInvalidator::clearPendingInvalidations()

Powered by Google App Engine
This is Rietveld 408576698