Index: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
index ea4afe751587a5f1edde4118522c55f90b56c027..e5e5dc84357043e408ec8001f61fc90af40bff80 100644 |
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp |
@@ -159,20 +159,15 @@ void CSSStyleSheet::didMutateRules() { |
DCHECK(m_contents->isMutable()); |
DCHECK_LE(m_contents->clientSize(), 1u); |
- didMutate(PartialRuleUpdate); |
+ didMutate(); |
} |
-void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType) { |
+void CSSStyleSheet::didMutate() { |
Document* owner = ownerDocument(); |
if (!owner) |
return; |
- |
- // Need FullStyleUpdate when insertRule or deleteRule, |
- // because StyleSheetCollection::analyzeStyleSheetChange cannot detect partial |
- // rule update. |
- StyleResolverUpdateMode updateMode = |
- updateType != PartialRuleUpdate ? AnalyzedStyleUpdate : FullStyleUpdate; |
- owner->styleEngine().setNeedsActiveStyleUpdate(this, updateMode); |
+ if (ownerNode() && ownerNode()->isConnected()) |
+ owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope()); |
} |
void CSSStyleSheet::reattachChildRuleCSSOMWrappers() { |
@@ -227,7 +222,7 @@ CSSRule* CSSStyleSheet::item(unsigned index) { |
} |
void CSSStyleSheet::clearOwnerNode() { |
- didMutate(EntireStyleSheetUpdate); |
+ didMutate(); |
if (m_ownerNode) |
m_contents->unregisterClient(this); |
m_ownerNode = nullptr; |