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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationInputHelpers.cpp

Issue 2309873003: Extend PropertyHandle to include custom property identifiers (Closed)
Patch Set: Add unit tests Created 4 years, 2 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 | « no previous file | third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/animation/AnimationInputHelpers.h" 5 #include "core/animation/AnimationInputHelpers.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/SVGNames.h" 8 #include "core/SVGNames.h"
9 #include "core/css/CSSValueList.h" 9 #include "core/css/CSSValueList.h"
10 #include "core/css/parser/CSSParser.h" 10 #include "core/css/parser/CSSParser.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 static String removeSVGPrefix(const String& property) 27 static String removeSVGPrefix(const String& property)
28 { 28 {
29 DCHECK(isSVGPrefixed(property)); 29 DCHECK(isSVGPrefixed(property));
30 return property.substring(kSVGPrefixLength); 30 return property.substring(kSVGPrefixLength);
31 } 31 }
32 32
33 CSSPropertyID AnimationInputHelpers::keyframeAttributeToCSSProperty(const String & property, const Document& document) 33 CSSPropertyID AnimationInputHelpers::keyframeAttributeToCSSProperty(const String & property, const Document& document)
34 { 34 {
35 // TODO(crbug.com/644148): Allow custom properties that begin with "--".
36
35 // Disallow prefixed properties. 37 // Disallow prefixed properties.
36 if (property[0] == '-' || isASCIIUpper(property[0])) 38 if (property[0] == '-' || isASCIIUpper(property[0]))
37 return CSSPropertyInvalid; 39 return CSSPropertyInvalid;
38 if (property == "cssFloat") 40 if (property == "cssFloat")
39 return CSSPropertyFloat; 41 return CSSPropertyFloat;
40 42
41 StringBuilder builder; 43 StringBuilder builder;
42 for (size_t i = 0; i < property.length(); ++i) { 44 for (size_t i = 0; i < property.length(); ++i) {
43 // Disallow hyphenated properties. 45 // Disallow hyphenated properties.
44 if (property[i] == '-') { 46 if (property[i] == '-') {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 239 }
238 const CSSValueList* valueList = toCSSValueList(value); 240 const CSSValueList* valueList = toCSSValueList(value);
239 if (valueList->length() > 1) { 241 if (valueList->length() > 1) {
240 exceptionState.throwTypeError("Easing may not be set to a list of values "); 242 exceptionState.throwTypeError("Easing may not be set to a list of values ");
241 return nullptr; 243 return nullptr;
242 } 244 }
243 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true); 245 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true);
244 } 246 }
245 247
246 } // namespace blink 248 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698