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

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

Issue 796913002: Use C++11 range-based loop for core/clipboard, core/dom and core/testing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: make auto clear Created 6 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 r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return m_documentScopeDirty || updateMode == FullStyleUpdate; 339 return m_documentScopeDirty || updateMode == FullStyleUpdate;
340 } 340 }
341 341
342 bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdate Mode updateMode) const 342 bool StyleEngine::shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdate Mode updateMode) const
343 { 343 {
344 return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate; 344 return !m_dirtyTreeScopes.isEmpty() || updateMode == FullStyleUpdate;
345 } 345 }
346 346
347 void StyleEngine::clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet tree Scopes) 347 void StyleEngine::clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet tree Scopes)
348 { 348 {
349 for (TreeScopeSet::iterator it = treeScopes.begin(); it != treeScopes.end(); ++it) { 349 for (auto& scope : treeScopes) {
Julien - ping for review 2015/01/02 09:42:02 auto == TreeScope* I think it's OK to do a pointe
zhaoze.zhou 2015/01/05 15:17:57 Done.
350 TreeScope& treeScope = **it; 350 TreeScope& treeScope = *scope;
351 ASSERT(treeScope != m_document); 351 ASSERT(treeScope != m_document);
352 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyle SheetCollection*>(styleSheetCollectionFor(treeScope)); 352 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeStyle SheetCollection*>(styleSheetCollectionFor(treeScope));
353 ASSERT(collection); 353 ASSERT(collection);
354 collection->clearMediaQueryRuleSetStyleSheets(); 354 collection->clearMediaQueryRuleSetStyleSheets();
355 } 355 }
356 } 356 }
357 357
358 void StyleEngine::clearMediaQueryRuleSetStyleSheets() 358 void StyleEngine::clearMediaQueryRuleSetStyleSheets()
359 { 359 {
360 documentStyleSheetCollection()->clearMediaQueryRuleSetStyleSheets(); 360 documentStyleSheetCollection()->clearMediaQueryRuleSetStyleSheets();
(...skipping 18 matching lines...) Expand all
379 if (!document().isActive()) 379 if (!document().isActive())
380 return; 380 return;
381 381
382 if (shouldUpdateDocumentStyleSheetCollection(updateMode)) 382 if (shouldUpdateDocumentStyleSheetCollection(updateMode))
383 documentStyleSheetCollection()->updateActiveStyleSheets(this, updateMode ); 383 documentStyleSheetCollection()->updateActiveStyleSheets(this, updateMode );
384 384
385 if (shouldUpdateShadowTreeStyleSheetCollection(updateMode)) { 385 if (shouldUpdateShadowTreeStyleSheetCollection(updateMode)) {
386 TreeScopeSet treeScopes = updateMode == FullStyleUpdate ? m_activeTreeSc opes : m_dirtyTreeScopes; 386 TreeScopeSet treeScopes = updateMode == FullStyleUpdate ? m_activeTreeSc opes : m_dirtyTreeScopes;
387 HashSet<TreeScope*> treeScopesRemoved; 387 HashSet<TreeScope*> treeScopesRemoved;
388 388
389 for (TreeScopeSet::iterator it = treeScopes.begin(); it != treeScopes.en d(); ++it) { 389 for (auto* treeScope : treeScopes) {
Julien - ping for review 2015/01/02 09:42:02 Similar comment.
zhaoze.zhou 2015/01/05 15:17:57 Done.
390 TreeScope* treeScope = *it;
391 ASSERT(treeScope != m_document); 390 ASSERT(treeScope != m_document);
392 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeS tyleSheetCollection*>(styleSheetCollectionFor(*treeScope)); 391 ShadowTreeStyleSheetCollection* collection = static_cast<ShadowTreeS tyleSheetCollection*>(styleSheetCollectionFor(*treeScope));
393 ASSERT(collection); 392 ASSERT(collection);
394 collection->updateActiveStyleSheets(this, updateMode); 393 collection->updateActiveStyleSheets(this, updateMode);
395 if (!collection->hasStyleSheetCandidateNodes()) { 394 if (!collection->hasStyleSheetCandidateNodes()) {
396 treeScopesRemoved.add(treeScope); 395 treeScopesRemoved.add(treeScope);
397 // When removing TreeScope from ActiveTreeScopes, 396 // When removing TreeScope from ActiveTreeScopes,
398 // its resolver should be destroyed by invoking resetAuthorStyle . 397 // its resolver should be destroyed by invoking resetAuthorStyle .
399 ASSERT(!treeScope->scopedStyleResolver()); 398 ASSERT(!treeScope->scopedStyleResolver());
400 } 399 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 visitor->trace(m_styleSheetCollectionMap); 682 visitor->trace(m_styleSheetCollectionMap);
684 visitor->trace(m_resolver); 683 visitor->trace(m_resolver);
685 visitor->trace(m_fontSelector); 684 visitor->trace(m_fontSelector);
686 visitor->trace(m_textToSheetCache); 685 visitor->trace(m_textToSheetCache);
687 visitor->trace(m_sheetToTextCache); 686 visitor->trace(m_sheetToTextCache);
688 #endif 687 #endif
689 CSSFontSelectorClient::trace(visitor); 688 CSSFontSelectorClient::trace(visitor);
690 } 689 }
691 690
692 } 691 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698