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

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

Issue 2566403003: Migrate WTF::Vector::append() to ::push_back() [part 3 of N] (Closed)
Patch Set: 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2012 Google Inc. All rights reserved. 5 * Copyright (C) 2012 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 treeScope().document().styleEngine().ruleSetForSheet(cssSheet); 88 treeScope().document().styleEngine().ruleSetForSheet(cssSheet);
89 89
90 m_viewportDependentMediaQueryResults.appendVector( 90 m_viewportDependentMediaQueryResults.appendVector(
91 cssSheet.viewportDependentMediaQueryResults()); 91 cssSheet.viewportDependentMediaQueryResults());
92 m_deviceDependentMediaQueryResults.appendVector( 92 m_deviceDependentMediaQueryResults.appendVector(
93 cssSheet.deviceDependentMediaQueryResults()); 93 cssSheet.deviceDependentMediaQueryResults());
94 if (!ruleSet) 94 if (!ruleSet)
95 return; 95 return;
96 96
97 unsigned index = m_authorStyleSheets.size(); 97 unsigned index = m_authorStyleSheets.size();
98 m_authorStyleSheets.append(&cssSheet); 98 m_authorStyleSheets.push_back(&cssSheet);
99 addKeyframeRules(*ruleSet); 99 addKeyframeRules(*ruleSet);
100 addFontFaceRules(*ruleSet); 100 addFontFaceRules(*ruleSet);
101 addTreeBoundaryCrossingRules(*ruleSet, &cssSheet, index); 101 addTreeBoundaryCrossingRules(*ruleSet, &cssSheet, index);
102 } 102 }
103 103
104 void ScopedStyleResolver::appendActiveStyleSheets( 104 void ScopedStyleResolver::appendActiveStyleSheets(
105 unsigned index, 105 unsigned index,
106 const ActiveStyleSheetVector& activeSheets) { 106 const ActiveStyleSheetVector& activeSheets) {
107 for (auto activeIterator = activeSheets.begin() + index; 107 for (auto activeIterator = activeSheets.begin() + index;
108 activeIterator != activeSheets.end(); activeIterator++) { 108 activeIterator != activeSheets.end(); activeIterator++) {
109 CSSStyleSheet* sheet = activeIterator->first; 109 CSSStyleSheet* sheet = activeIterator->first;
110 m_viewportDependentMediaQueryResults.appendVector( 110 m_viewportDependentMediaQueryResults.appendVector(
111 sheet->viewportDependentMediaQueryResults()); 111 sheet->viewportDependentMediaQueryResults());
112 m_deviceDependentMediaQueryResults.appendVector( 112 m_deviceDependentMediaQueryResults.appendVector(
113 sheet->deviceDependentMediaQueryResults()); 113 sheet->deviceDependentMediaQueryResults());
114 if (!activeIterator->second) 114 if (!activeIterator->second)
115 continue; 115 continue;
116 const RuleSet& ruleSet = *activeIterator->second; 116 const RuleSet& ruleSet = *activeIterator->second;
117 m_authorStyleSheets.append(sheet); 117 m_authorStyleSheets.push_back(sheet);
118 addKeyframeRules(ruleSet); 118 addKeyframeRules(ruleSet);
119 addFontFaceRules(ruleSet); 119 addFontFaceRules(ruleSet);
120 addTreeBoundaryCrossingRules(ruleSet, sheet, index++); 120 addTreeBoundaryCrossingRules(ruleSet, sheet, index++);
121 } 121 }
122 } 122 }
123 123
124 void ScopedStyleResolver::collectFeaturesTo( 124 void ScopedStyleResolver::collectFeaturesTo(
125 RuleFeatureSet& features, 125 RuleFeatureSet& features,
126 HeapHashSet<Member<const StyleSheetContents>>& 126 HeapHashSet<Member<const StyleSheetContents>>&
127 visitedSharedStyleSheetContents) const { 127 visitedSharedStyleSheetContents) const {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 addRules(ruleSetForScope, authorRules.contentPseudoElementRules()); 305 addRules(ruleSetForScope, authorRules.contentPseudoElementRules());
306 addRules(ruleSetForScope, authorRules.slottedPseudoElementRules()); 306 addRules(ruleSetForScope, authorRules.slottedPseudoElementRules());
307 } 307 }
308 308
309 if (!m_treeBoundaryCrossingRuleSet) { 309 if (!m_treeBoundaryCrossingRuleSet) {
310 m_treeBoundaryCrossingRuleSet = new CSSStyleSheetRuleSubSet(); 310 m_treeBoundaryCrossingRuleSet = new CSSStyleSheetRuleSubSet();
311 treeScope().document().styleEngine().addTreeBoundaryCrossingScope( 311 treeScope().document().styleEngine().addTreeBoundaryCrossingScope(
312 treeScope()); 312 treeScope());
313 } 313 }
314 314
315 m_treeBoundaryCrossingRuleSet->append( 315 m_treeBoundaryCrossingRuleSet->push_back(
316 RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope)); 316 RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope));
317 } 317 }
318 318
319 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { 319 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) {
320 visitor->trace(m_parentStyleSheet); 320 visitor->trace(m_parentStyleSheet);
321 visitor->trace(m_ruleSet); 321 visitor->trace(m_ruleSet);
322 } 322 }
323 323
324 } // namespace blink 324 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698