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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp

Issue 2032243003: Make CSSValueList store const CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_computedstyledeclaration_return_const
Patch Set: Small fix n CSSOM Created 4 years, 6 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 // 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/StylePropertyMap.h" 5 #include "core/css/cssom/StylePropertyMap.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/css/CSSValueList.h" 8 #include "core/css/CSSValueList.h"
9 #include "core/css/cssom/CSSSimpleLength.h" 9 #include "core/css/cssom/CSSSimpleLength.h"
10 #include "core/css/cssom/CSSStyleValue.h" 10 #include "core/css/cssom/CSSStyleValue.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 { 121 {
122 StyleValueVector styleValueVector; 122 StyleValueVector styleValueVector;
123 123
124 if (!cssValue.isValueList()) { 124 if (!cssValue.isValueList()) {
125 CSSStyleValue* styleValue = StyleValueFactory::create(propertyID, cssVal ue); 125 CSSStyleValue* styleValue = StyleValueFactory::create(propertyID, cssVal ue);
126 if (styleValue) 126 if (styleValue)
127 styleValueVector.append(styleValue); 127 styleValueVector.append(styleValue);
128 return styleValueVector; 128 return styleValueVector;
129 } 129 }
130 130
131 for (CSSValue* value : *toCSSValueList(&cssValue)) { 131 for (const CSSValue* value : toCSSValueList(cssValue)) {
132 CSSStyleValue* styleValue = StyleValueFactory::create(propertyID, *value ); 132 CSSStyleValue* styleValue = StyleValueFactory::create(propertyID, *value );
133 if (!styleValue) 133 if (!styleValue)
134 return StyleValueVector(); 134 return StyleValueVector();
135 styleValueVector.append(styleValue); 135 styleValueVector.append(styleValue);
136 } 136 }
137 return styleValueVector; 137 return styleValueVector;
138 } 138 }
139 139
140 StylePropertyMap::IterationSource* StylePropertyMap::startIteration(ScriptState* , ExceptionState&) 140 StylePropertyMap::IterationSource* StylePropertyMap::startIteration(ScriptState* , ExceptionState&)
141 { 141 {
142 return new StylePropertyMapIterationSource(getIterationEntries()); 142 return new StylePropertyMapIterationSource(getIterationEntries());
143 } 143 }
144 144
145 } // namespace blink 145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698