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

Side by Side Diff: Source/core/css/CSSStyleDeclaration.cpp

Issue 1116903002: [bindings] Remove custom namedPropertyEnumerator from CSSStyleDeclaration (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.h ('k') | Source/core/css/CSSStyleDeclaration.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "config.h" 5 #include "config.h"
6 #include "core/css/CSSStyleDeclaration.h" 6 #include "core/css/CSSStyleDeclaration.h"
7 7
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "core/css/CSSPropertyMetadata.h" 9 #include "core/css/CSSPropertyMetadata.h"
10 #include "core/css/parser/CSSParser.h" 10 #include "core/css/parser/CSSParser.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 CSSPropertyID unresolvedProperty = cssPropertyInfo(name, scriptState->isolat e()); 118 CSSPropertyID unresolvedProperty = cssPropertyInfo(name, scriptState->isolat e());
119 if (!unresolvedProperty) 119 if (!unresolvedProperty)
120 return false; 120 return false;
121 121
122 setPropertyInternal(unresolvedProperty, propertyValue, false, exceptionState ); 122 setPropertyInternal(unresolvedProperty, propertyValue, false, exceptionState );
123 if (exceptionState.throwIfNeeded()) 123 if (exceptionState.throwIfNeeded())
124 return false; 124 return false;
125 return true; 125 return true;
126 } 126 }
127 127
128 void CSSStyleDeclaration::namedPropertyEnumerator(Vector<String>& names, Excepti onState&)
129 {
130 typedef Vector<String, numCSSProperties - 1> PreAllocatedPropertyVector;
131 DEFINE_STATIC_LOCAL(PreAllocatedPropertyVector, propertyNames, ());
132 static unsigned propertyNamesLength = 0;
133 if (propertyNames.isEmpty()) {
134 for (int id = firstCSSProperty; id <= lastCSSProperty; ++id) {
135 CSSPropertyID propertyId = static_cast<CSSPropertyID>(id);
136 if (CSSPropertyMetadata::isEnabledProperty(propertyId))
137 propertyNames.append(getJSPropertyName(propertyId));
138 }
139 std::sort(propertyNames.begin(), propertyNames.end(), codePointCompareLe ssThan);
140 propertyNamesLength = propertyNames.size();
141 }
142 for (unsigned i = 0; i < propertyNamesLength; ++i) {
143 String key = propertyNames.at(i);
144 ASSERT(!key.isNull());
145 names.append(key);
146 }
128 } 147 }
148
149 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.h ('k') | Source/core/css/CSSStyleDeclaration.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698