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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp

Issue 2546393002: Make setNeedsActiveStyleUpdate mark treescope dirty only. (Closed)
Patch Set: Rebased 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 DCHECK(m_contents->isMutable()); 159 DCHECK(m_contents->isMutable());
160 DCHECK_LE(m_contents->clientSize(), 1u); 160 DCHECK_LE(m_contents->clientSize(), 1u);
161 161
162 didMutate(PartialRuleUpdate); 162 didMutate(PartialRuleUpdate);
163 } 163 }
164 164
165 void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType) { 165 void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType) {
166 Document* owner = ownerDocument(); 166 Document* owner = ownerDocument();
167 if (!owner) 167 if (!owner)
168 return; 168 return;
169 if (ownerNode() && ownerNode()->isConnected())
170 owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope());
171
172 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
173 // updates are async. https://crbug.com/567021
169 174
170 // Need FullStyleUpdate when insertRule or deleteRule, 175 // Need FullStyleUpdate when insertRule or deleteRule,
171 // because StyleSheetCollection::analyzeStyleSheetChange cannot detect partial 176 // because StyleSheetCollection::analyzeStyleSheetChange cannot detect partial
172 // rule update. 177 // rule update.
173 StyleResolverUpdateMode updateMode = 178 StyleResolverUpdateMode updateMode =
174 updateType != PartialRuleUpdate ? AnalyzedStyleUpdate : FullStyleUpdate; 179 updateType != PartialRuleUpdate ? AnalyzedStyleUpdate : FullStyleUpdate;
175 owner->styleEngine().setNeedsActiveStyleUpdate(this, updateMode); 180 owner->styleEngine().resolverChanged(updateMode);
176 } 181 }
177 182
178 void CSSStyleSheet::reattachChildRuleCSSOMWrappers() { 183 void CSSStyleSheet::reattachChildRuleCSSOMWrappers() {
179 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) { 184 for (unsigned i = 0; i < m_childRuleCSSOMWrappers.size(); ++i) {
180 if (!m_childRuleCSSOMWrappers[i]) 185 if (!m_childRuleCSSOMWrappers[i])
181 continue; 186 continue;
182 m_childRuleCSSOMWrappers[i]->reattach(m_contents->ruleAt(i)); 187 m_childRuleCSSOMWrappers[i]->reattach(m_contents->ruleAt(i));
183 } 188 }
184 } 189 }
185 190
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 visitor->trace(m_deviceDependentMediaQueryResults); 443 visitor->trace(m_deviceDependentMediaQueryResults);
439 visitor->trace(m_ownerNode); 444 visitor->trace(m_ownerNode);
440 visitor->trace(m_ownerRule); 445 visitor->trace(m_ownerRule);
441 visitor->trace(m_mediaCSSOMWrapper); 446 visitor->trace(m_mediaCSSOMWrapper);
442 visitor->trace(m_childRuleCSSOMWrappers); 447 visitor->trace(m_childRuleCSSOMWrappers);
443 visitor->trace(m_ruleListCSSOMWrapper); 448 visitor->trace(m_ruleListCSSOMWrapper);
444 StyleSheet::trace(visitor); 449 StyleSheet::trace(visitor);
445 } 450 }
446 451
447 } // namespace blink 452 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698