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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 months 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 DCHECK(!isXSLStyleSheet(node)); 208 DCHECK(!isXSLStyleSheet(node));
209 TreeScope& treeScope = node.treeScope(); 209 TreeScope& treeScope = node.treeScope();
210 TreeScopeStyleSheetCollection* collection = 210 TreeScopeStyleSheetCollection* collection =
211 ensureStyleSheetCollectionFor(treeScope); 211 ensureStyleSheetCollectionFor(treeScope);
212 DCHECK(collection); 212 DCHECK(collection);
213 collection->addStyleSheetCandidateNode(node); 213 collection->addStyleSheetCandidateNode(node);
214 214
215 setNeedsActiveStyleUpdate(treeScope); 215 setNeedsActiveStyleUpdate(treeScope);
216 if (treeScope != m_document) 216 if (treeScope != m_document)
217 m_activeTreeScopes.add(&treeScope); 217 m_activeTreeScopes.insert(&treeScope);
218 } 218 }
219 219
220 void StyleEngine::removeStyleSheetCandidateNode(Node& node, 220 void StyleEngine::removeStyleSheetCandidateNode(Node& node,
221 ContainerNode& insertionPoint) { 221 ContainerNode& insertionPoint) {
222 DCHECK(!isXSLStyleSheet(node)); 222 DCHECK(!isXSLStyleSheet(node));
223 DCHECK(insertionPoint.isConnected()); 223 DCHECK(insertionPoint.isConnected());
224 224
225 ShadowRoot* shadowRoot = node.containingShadowRoot(); 225 ShadowRoot* shadowRoot = node.containingShadowRoot();
226 if (!shadowRoot) 226 if (!shadowRoot)
227 shadowRoot = insertionPoint.containingShadowRoot(); 227 shadowRoot = insertionPoint.containingShadowRoot();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 void StyleEngine::updateActiveStyleSheetsInShadow( 300 void StyleEngine::updateActiveStyleSheetsInShadow(
301 TreeScope* treeScope, 301 TreeScope* treeScope,
302 UnorderedTreeScopeSet& treeScopesRemoved) { 302 UnorderedTreeScopeSet& treeScopesRemoved) {
303 DCHECK_NE(treeScope, m_document); 303 DCHECK_NE(treeScope, m_document);
304 ShadowTreeStyleSheetCollection* collection = 304 ShadowTreeStyleSheetCollection* collection =
305 toShadowTreeStyleSheetCollection(styleSheetCollectionFor(*treeScope)); 305 toShadowTreeStyleSheetCollection(styleSheetCollectionFor(*treeScope));
306 DCHECK(collection); 306 DCHECK(collection);
307 collection->updateActiveStyleSheets(*this); 307 collection->updateActiveStyleSheets(*this);
308 if (!collection->hasStyleSheetCandidateNodes()) { 308 if (!collection->hasStyleSheetCandidateNodes()) {
309 treeScopesRemoved.add(treeScope); 309 treeScopesRemoved.insert(treeScope);
310 // When removing TreeScope from ActiveTreeScopes, 310 // When removing TreeScope from ActiveTreeScopes,
311 // its resolver should be destroyed by invoking resetAuthorStyle. 311 // its resolver should be destroyed by invoking resetAuthorStyle.
312 DCHECK(!treeScope->scopedStyleResolver()); 312 DCHECK(!treeScope->scopedStyleResolver());
313 } 313 }
314 } 314 }
315 315
316 void StyleEngine::updateActiveStyleSheets() { 316 void StyleEngine::updateActiveStyleSheets() {
317 if (!needsActiveStyleSheetUpdate()) 317 if (!needsActiveStyleSheetUpdate())
318 return; 318 return;
319 319
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 m_resolver->invalidateMatchedPropertiesCache(); 498 m_resolver->invalidateMatchedPropertiesCache();
499 } 499 }
500 500
501 void StyleEngine::markTreeScopeDirty(TreeScope& scope) { 501 void StyleEngine::markTreeScopeDirty(TreeScope& scope) {
502 if (scope == m_document) { 502 if (scope == m_document) {
503 markDocumentDirty(); 503 markDocumentDirty();
504 return; 504 return;
505 } 505 }
506 506
507 DCHECK(m_styleSheetCollectionMap.contains(&scope)); 507 DCHECK(m_styleSheetCollectionMap.contains(&scope));
508 m_dirtyTreeScopes.add(&scope); 508 m_dirtyTreeScopes.insert(&scope);
509 document().scheduleLayoutTreeUpdateIfNeeded(); 509 document().scheduleLayoutTreeUpdateIfNeeded();
510 } 510 }
511 511
512 void StyleEngine::markDocumentDirty() { 512 void StyleEngine::markDocumentDirty() {
513 m_documentScopeDirty = true; 513 m_documentScopeDirty = true;
514 if (RuntimeEnabledFeatures::cssViewportEnabled()) 514 if (RuntimeEnabledFeatures::cssViewportEnabled())
515 viewportRulesChanged(); 515 viewportRulesChanged();
516 if (document().importLoader()) 516 if (document().importLoader())
517 document().importsController()->master()->styleEngine().markDocumentDirty(); 517 document().importsController()->master()->styleEngine().markDocumentDirty();
518 else 518 else
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 } 1146 }
1147 1147
1148 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1148 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1149 for (auto sheet : m_injectedAuthorStyleSheets) { 1149 for (auto sheet : m_injectedAuthorStyleSheets) {
1150 visitor->traceWrappers(sheet); 1150 visitor->traceWrappers(sheet);
1151 } 1151 }
1152 visitor->traceWrappers(m_documentStyleSheetCollection); 1152 visitor->traceWrappers(m_documentStyleSheetCollection);
1153 } 1153 }
1154 1154
1155 } // namespace blink 1155 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/SecurityContext.h ('k') | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698