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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // sync. 178 // sync.
179 DCHECK_GT(m_pendingScriptBlockingStylesheets, 0); 179 DCHECK_GT(m_pendingScriptBlockingStylesheets, 0);
180 180
181 m_pendingScriptBlockingStylesheets--; 181 m_pendingScriptBlockingStylesheets--;
182 if (m_pendingScriptBlockingStylesheets) 182 if (m_pendingScriptBlockingStylesheets)
183 return; 183 return;
184 184
185 document().didRemoveAllPendingStylesheet(); 185 document().didRemoveAllPendingStylesheet();
186 } 186 }
187 187
188 void StyleEngine::setNeedsActiveStyleUpdate( 188 void StyleEngine::setNeedsActiveStyleUpdate(TreeScope& treeScope) {
189 StyleSheet* sheet,
190 StyleResolverUpdateMode updateMode) {
191 // resolverChanged() is called for inactive non-master documents because
192 // import documents are inactive documents. resolverChanged() for imports
193 // will call resolverChanged() for the master document and update the active
194 // stylesheets including the ones from the import.
195 if (!document().isActive() && isMaster()) 189 if (!document().isActive() && isMaster())
196 return; 190 return;
197 191
198 if (sheet && document().isActive()) { 192 markTreeScopeDirty(treeScope);
199 Node* node = sheet->ownerNode();
200 if (node && node->isConnected())
201 markTreeScopeDirty(node->treeScope());
202 }
203
204 resolverChanged(updateMode);
205 } 193 }
206 194
207 void StyleEngine::addStyleSheetCandidateNode(Node& node) { 195 void StyleEngine::addStyleSheetCandidateNode(Node& node) {
208 if (!node.isConnected() || document().isDetached()) 196 if (!node.isConnected() || document().isDetached())
209 return; 197 return;
210 198
211 DCHECK(!isXSLStyleSheet(node)); 199 DCHECK(!isXSLStyleSheet(node));
212 TreeScope& treeScope = node.treeScope(); 200 TreeScope& treeScope = node.treeScope();
213 TreeScopeStyleSheetCollection* collection = 201 TreeScopeStyleSheetCollection* collection =
214 ensureStyleSheetCollectionFor(treeScope); 202 ensureStyleSheetCollectionFor(treeScope);
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 } 1232 }
1245 1233
1246 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1234 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1247 for (auto sheet : m_injectedAuthorStyleSheets) { 1235 for (auto sheet : m_injectedAuthorStyleSheets) {
1248 visitor->traceWrappers(sheet); 1236 visitor->traceWrappers(sheet);
1249 } 1237 }
1250 visitor->traceWrappers(m_documentStyleSheetCollection); 1238 visitor->traceWrappers(m_documentStyleSheetCollection);
1251 } 1239 }
1252 1240
1253 } // namespace blink 1241 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698