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

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

Issue 2526233002: Web Animations: Retire warning for hyphenated property names (Closed)
Patch Set: retire deprecation warning 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 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 28 matching lines...) Expand all
39 if (property[0] == '-') 39 if (property[0] == '-')
40 return CSSPropertyInvalid; 40 return CSSPropertyInvalid;
41 if (isASCIIUpper(property[0])) 41 if (isASCIIUpper(property[0]))
42 return CSSPropertyInvalid; 42 return CSSPropertyInvalid;
43 if (property == "cssFloat") 43 if (property == "cssFloat")
44 return CSSPropertyFloat; 44 return CSSPropertyFloat;
45 45
46 StringBuilder builder; 46 StringBuilder builder;
47 for (size_t i = 0; i < property.length(); ++i) { 47 for (size_t i = 0; i < property.length(); ++i) {
48 // Disallow hyphenated properties. 48 // Disallow hyphenated properties.
49 if (property[i] == '-') { 49 if (property[i] == '-')
50 if (cssPropertyID(property) != CSSPropertyInvalid)
51 Deprecation::countDeprecation(
52 document, UseCounter::WebAnimationHyphenatedProperty);
53 return CSSPropertyInvalid; 50 return CSSPropertyInvalid;
54 }
55 if (isASCIIUpper(property[i])) 51 if (isASCIIUpper(property[i]))
56 builder.append('-'); 52 builder.append('-');
57 builder.append(property[i]); 53 builder.append(property[i]);
58 } 54 }
59 return cssPropertyID(builder.toString()); 55 return cssPropertyID(builder.toString());
60 } 56 }
61 57
62 CSSPropertyID AnimationInputHelpers::keyframeAttributeToPresentationAttribute( 58 CSSPropertyID AnimationInputHelpers::keyframeAttributeToPresentationAttribute(
63 const String& property, 59 const String& property,
64 const Element& element) { 60 const Element& element) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 249 }
254 const CSSValueList* valueList = toCSSValueList(value); 250 const CSSValueList* valueList = toCSSValueList(value);
255 if (valueList->length() > 1) { 251 if (valueList->length() > 1) {
256 exceptionState.throwTypeError("Easing may not be set to a list of values"); 252 exceptionState.throwTypeError("Easing may not be set to a list of values");
257 return nullptr; 253 return nullptr;
258 } 254 }
259 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true); 255 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true);
260 } 256 }
261 257
262 } // namespace blink 258 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698