| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 if (CSSVariableParser::isValidVariableName(property)) | 35 if (CSSVariableParser::isValidVariableName(property)) |
| 36 return CSSPropertyVariable; | 36 return CSSPropertyVariable; |
| 37 | 37 |
| 38 // Disallow prefixed properties. | 38 // Disallow prefixed properties. |
| 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 if (property == "cssOffset") |
| 46 return CSSPropertyOffset; |
| 45 | 47 |
| 46 StringBuilder builder; | 48 StringBuilder builder; |
| 47 for (size_t i = 0; i < property.length(); ++i) { | 49 for (size_t i = 0; i < property.length(); ++i) { |
| 48 // Disallow hyphenated properties. | 50 // Disallow hyphenated properties. |
| 49 if (property[i] == '-') | 51 if (property[i] == '-') |
| 50 return CSSPropertyInvalid; | 52 return CSSPropertyInvalid; |
| 51 if (isASCIIUpper(property[i])) | 53 if (isASCIIUpper(property[i])) |
| 52 builder.append('-'); | 54 builder.append('-'); |
| 53 builder.append(property[i]); | 55 builder.append(property[i]); |
| 54 } | 56 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 251 } |
| 250 const CSSValueList* valueList = toCSSValueList(value); | 252 const CSSValueList* valueList = toCSSValueList(value); |
| 251 if (valueList->length() > 1) { | 253 if (valueList->length() > 1) { |
| 252 exceptionState.throwTypeError("Easing may not be set to a list of values"); | 254 exceptionState.throwTypeError("Easing may not be set to a list of values"); |
| 253 return nullptr; | 255 return nullptr; |
| 254 } | 256 } |
| 255 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true); | 257 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true); |
| 256 } | 258 } |
| 257 | 259 |
| 258 } // namespace blink | 260 } // namespace blink |
| OLD | NEW |