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

Unified Diff: Source/core/css/CSSStyleSheet.cpp

Issue 27537009: Avoid always style recalc when removing stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/CSSStyleSheet.cpp
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp
index 05e3b212dc3c2a58cbd54bad508a09cee7a4b1b2..9737560190271c7ebc8e6aa57ef768b288dd7777 100644
--- a/Source/core/css/CSSStyleSheet.cpp
+++ b/Source/core/css/CSSStyleSheet.cpp
@@ -149,15 +149,19 @@ void CSSStyleSheet::didMutateRules()
ASSERT(m_contents->isMutable());
ASSERT(m_contents->hasOneClient());
- didMutate();
+ didMutate(PartialRuleUpdate);
}
-void CSSStyleSheet::didMutate()
+void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType)
{
Document* owner = ownerDocument();
if (!owner)
return;
- owner->modifiedStyleSheet(this);
+
+ // Need FullStyleUpdate when insertRule or deleteRule,
+ // because StyleSheetCollection::analyzeStyleSheetChange cannot detect partial rule update.
+ StyleResolverUpdateMode updateMode = updateType != PartialRuleUpdate ? AnalyzedStyleUpdate : FullStyleUpdate;
+ owner->modifiedStyleSheet(this, RecalcStyleDeferred, updateMode);
}
void CSSStyleSheet::reattachChildRuleCSSOMWrappers()

Powered by Google App Engine
This is Rietveld 408576698