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

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

Issue 1771733002: Web Animations: Use of hyphens is no longer supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 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 "core/SVGNames.h" 7 #include "core/SVGNames.h"
8 #include "core/css/CSSValueList.h" 8 #include "core/css/CSSValueList.h"
9 #include "core/css/parser/CSSParser.h" 9 #include "core/css/parser/CSSParser.h"
10 #include "core/css/resolver/CSSToStyleMap.h" 10 #include "core/css/resolver/CSSToStyleMap.h"
(...skipping 14 matching lines...) Expand all
25 25
26 static String removeSVGPrefix(const String& property) 26 static String removeSVGPrefix(const String& property)
27 { 27 {
28 ASSERT(isSVGPrefixed(property)); 28 ASSERT(isSVGPrefixed(property));
29 return property.substring(kSVGPrefixLength); 29 return property.substring(kSVGPrefixLength);
30 } 30 }
31 31
32 CSSPropertyID AnimationInputHelpers::keyframeAttributeToCSSProperty(const String & property, const Document& document) 32 CSSPropertyID AnimationInputHelpers::keyframeAttributeToCSSProperty(const String & property, const Document& document)
33 { 33 {
34 // Disallow prefixed properties. 34 // Disallow prefixed properties.
35 if (property[0] == '-' || isASCIIUpper(property[0])) 35 if (isASCIIUpper(property[0]))
36 return CSSPropertyInvalid; 36 return CSSPropertyInvalid;
37 if (property == "cssFloat") 37 if (property == "cssFloat")
38 return CSSPropertyFloat; 38 return CSSPropertyFloat;
39 StringBuilder builder; 39 StringBuilder builder;
40 for (size_t i = 0; i < property.length(); ++i) { 40 for (size_t i = 0; i < property.length(); ++i) {
41 if (property[i] == '-') 41 if (property[i] == '-')
42 Deprecation::countDeprecation(document, UseCounter::WebAnimationHyph enatedProperty); 42 return CSSPropertyInvalid;
43 if (isASCIIUpper(property[i])) 43 if (isASCIIUpper(property[i]))
44 builder.append('-'); 44 builder.append('-');
45 builder.append(property[i]); 45 builder.append(property[i]);
46 } 46 }
47 return cssPropertyID(builder.toString()); 47 return cssPropertyID(builder.toString());
48 } 48 }
49 49
50 CSSPropertyID AnimationInputHelpers::keyframeAttributeToPresentationAttribute(co nst String& property, const Element& element) 50 CSSPropertyID AnimationInputHelpers::keyframeAttributeToPresentationAttribute(co nst String& property, const Element& element)
51 { 51 {
52 if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !element.isSVGElem ent() || !isSVGPrefixed(property)) 52 if (!RuntimeEnabledFeatures::webAnimationsSVGEnabled() || !element.isSVGElem ent() || !isSVGPrefixed(property))
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 ASSERT(!value || value->isCSSWideKeyword()); 206 ASSERT(!value || value->isCSSWideKeyword());
207 return nullptr; 207 return nullptr;
208 } 208 }
209 CSSValueList* valueList = toCSSValueList(value.get()); 209 CSSValueList* valueList = toCSSValueList(value.get());
210 if (valueList->length() > 1) 210 if (valueList->length() > 1)
211 return nullptr; 211 return nullptr;
212 return CSSToStyleMap::mapAnimationTimingFunction(*valueList->item(0), true); 212 return CSSToStyleMap::mapAnimationTimingFunction(*valueList->item(0), true);
213 } 213 }
214 214
215 } // namespace blink 215 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698