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

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

Issue 1913833002: Current work-in-progress crbug.com/567021 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed html import issue. Created 4 years 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: 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;
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSStyleSheet.h ('k') | third_party/WebKit/Source/core/css/FontFaceSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698