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

Unified Diff: third_party/WebKit/Source/core/css/StyleSheetContents.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/StyleSheetContents.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index 19742315641621c426910665c00411a7018ffd8c..adc72105579561fb29bf8a653112dd0a67936c3d 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -611,10 +611,14 @@ RuleSet& StyleSheetContents::ensureRuleSet(const MediaQueryEvaluator& medium,
return *m_ruleSet.get();
}
-static void clearResolvers(HeapHashSet<WeakMember<CSSStyleSheet>>& clients) {
+static void setNeedsActiveStyleUpdateForClients(
+ HeapHashSet<WeakMember<CSSStyleSheet>>& clients) {
for (const auto& sheet : clients) {
- if (Document* document = sheet->ownerDocument())
- document->styleEngine().clearResolver();
+ Document* document = sheet->ownerDocument();
+ Node* node = sheet->ownerNode();
+ if (!document || !node || !node->isConnected())
+ continue;
+ document->styleEngine().setNeedsActiveStyleUpdate(node->treeScope());
}
}
@@ -622,18 +626,12 @@ void StyleSheetContents::clearRuleSet() {
if (StyleSheetContents* parentSheet = parentStyleSheet())
parentSheet->clearRuleSet();
- // Don't want to clear the StyleResolver if the RuleSet hasn't been created
- // since we only clear the StyleResolver so that it's members are properly
- // updated in ScopedStyleResolver::addRulesFromSheet.
if (!m_ruleSet)
return;
- // Clearing the ruleSet means we need to recreate the styleResolver data
- // structures. See the StyleResolver calls in
- // ScopedStyleResolver::addRulesFromSheet.
- clearResolvers(m_loadingClients);
- clearResolvers(m_completedClients);
m_ruleSet.clear();
+ setNeedsActiveStyleUpdateForClients(m_loadingClients);
+ setNeedsActiveStyleUpdateForClients(m_completedClients);
}
static void removeFontFaceRules(HeapHashSet<WeakMember<CSSStyleSheet>>& clients,
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceSet.cpp ('k') | third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698