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

Unified Diff: Source/core/dom/Element.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/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 1997e9d06bbfe6c070e576ec7ed8cd2d48d31677..c19f22870d364f717767a9dbcc67b0d3911e9c03 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -2801,7 +2801,7 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
}
if (oldValue != newValue) {
- if (inActiveDocument())
+ if (inActiveDocument() && document().styleResolver() && styleChangeType() < SubtreeStyleChange)
document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleStyleInvalidationForAttributeChange(name, *this);
if (isUpgradedCustomElement())

Powered by Google App Engine
This is Rietveld 408576698