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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/cssom/InlineStylePropertyMap.h" 5 #include "core/css/cssom/InlineStylePropertyMap.h"
6 6
7 #include "bindings/core/v8/Iterable.h" 7 #include "bindings/core/v8/Iterable.h"
8 #include "core/CSSPropertyNames.h" 8 #include "core/CSSPropertyNames.h"
9 #include "core/css/CSSCustomIdentValue.h" 9 #include "core/css/CSSCustomIdentValue.h"
10 #include "core/css/CSSCustomPropertyDeclaration.h" 10 #include "core/css/CSSCustomPropertyDeclaration.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 Vector<String> result; 87 Vector<String> result;
88 bool containsAtApply = false; 88 bool containsAtApply = false;
89 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(); 89 StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle();
90 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { 90 for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) {
91 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id(); 91 CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id();
92 if (propertyID == CSSPropertyVariable) { 92 if (propertyID == CSSPropertyVariable) {
93 StylePropertySet::PropertyReference propertyReference = 93 StylePropertySet::PropertyReference propertyReference =
94 inlineStyleSet.propertyAt(i); 94 inlineStyleSet.propertyAt(i);
95 const CSSCustomPropertyDeclaration& customDeclaration = 95 const CSSCustomPropertyDeclaration& customDeclaration =
96 toCSSCustomPropertyDeclaration(propertyReference.value()); 96 toCSSCustomPropertyDeclaration(propertyReference.value());
97 result.append(customDeclaration.name()); 97 result.push_back(customDeclaration.name());
98 } else if (propertyID == CSSPropertyApplyAtRule) { 98 } else if (propertyID == CSSPropertyApplyAtRule) {
99 if (!containsAtApply) { 99 if (!containsAtApply) {
100 result.append(kAtApply); 100 result.push_back(kAtApply);
101 containsAtApply = true; 101 containsAtApply = true;
102 } 102 }
103 } else { 103 } else {
104 result.append(getPropertyNameString(propertyID)); 104 result.push_back(getPropertyNameString(propertyID));
105 } 105 }
106 } 106 }
107 return result; 107 return result;
108 } 108 }
109 109
110 void InlineStylePropertyMap::set( 110 void InlineStylePropertyMap::set(
111 CSSPropertyID propertyID, 111 CSSPropertyID propertyID,
112 CSSStyleValueOrCSSStyleValueSequenceOrString& item, 112 CSSStyleValueOrCSSStyleValueSequenceOrString& item,
113 ExceptionState& exceptionState) { 113 ExceptionState& exceptionState) {
114 const CSSValue* cssValue = nullptr; 114 const CSSValue* cssValue = nullptr;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } else { 220 } else {
221 name = getPropertyNameString(propertyID); 221 name = getPropertyNameString(propertyID);
222 CSSStyleValueVector styleValueVector = 222 CSSStyleValueVector styleValueVector =
223 StyleValueFactory::cssValueToStyleValueVector( 223 StyleValueFactory::cssValueToStyleValueVector(
224 propertyID, propertyReference.value()); 224 propertyID, propertyReference.value());
225 if (styleValueVector.size() == 1) 225 if (styleValueVector.size() == 1)
226 value.setCSSStyleValue(styleValueVector[0]); 226 value.setCSSStyleValue(styleValueVector[0]);
227 else 227 else
228 value.setCSSStyleValueSequence(styleValueVector); 228 value.setCSSStyleValueSequence(styleValueVector);
229 } 229 }
230 result.append(std::make_pair(name, value)); 230 result.push_back(std::make_pair(name, value));
231 } 231 }
232 return result; 232 return result;
233 } 233 }
234 234
235 } // namespace blink 235 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698