| 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 7dc7792ec83c2499842949c2d322ef499777b200..b24baaa1190fa6f8900c75172e926a3d657739e4 100644
|
| --- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
|
| +++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
|
| @@ -617,14 +617,10 @@
|
| return *m_ruleSet.get();
|
| }
|
|
|
| -static void setNeedsActiveStyleUpdateForClients(
|
| - HeapHashSet<WeakMember<CSSStyleSheet>>& clients) {
|
| +static void clearResolvers(HeapHashSet<WeakMember<CSSStyleSheet>>& clients) {
|
| for (const auto& sheet : clients) {
|
| - Document* document = sheet->ownerDocument();
|
| - Node* node = sheet->ownerNode();
|
| - if (!document || !node || !node->isConnected())
|
| - continue;
|
| - document->styleEngine().setNeedsActiveStyleUpdate(node->treeScope());
|
| + if (Document* document = sheet->ownerDocument())
|
| + document->styleEngine().clearResolver();
|
| }
|
| }
|
|
|
| @@ -632,12 +628,18 @@
|
| 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,
|
|
|