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 "config.h" | 5 #include "config.h" |
6 #include "core/animation/AnimationInputHelpers.h" | 6 #include "core/animation/AnimationInputHelpers.h" |
7 | 7 |
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 15 matching lines...) Expand all Loading... |
26 builder.append(propertyName[i]); | 26 builder.append(propertyName[i]); |
27 } | 27 } |
28 return cssPropertyID(builder.toString()); | 28 return cssPropertyID(builder.toString()); |
29 } | 29 } |
30 | 30 |
31 PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const Stri
ng& string) | 31 PassRefPtr<TimingFunction> AnimationInputHelpers::parseTimingFunction(const Stri
ng& string) |
32 { | 32 { |
33 if (string.isEmpty()) | 33 if (string.isEmpty()) |
34 return nullptr; | 34 return nullptr; |
35 | 35 |
36 RefPtrWillBeRawPtr<CSSValue> value = CSSParser::parseSingleValue(CSSProperty
TransitionTimingFunction, string); | 36 RefPtr<CSSValue> value = CSSParser::parseSingleValue(CSSPropertyTransitionTi
mingFunction, string); |
37 if (!value || !value->isValueList()) { | 37 if (!value || !value->isValueList()) { |
38 ASSERT(!value || value->isCSSWideKeyword()); | 38 ASSERT(!value || value->isCSSWideKeyword()); |
39 return nullptr; | 39 return nullptr; |
40 } | 40 } |
41 CSSValueList* valueList = toCSSValueList(value.get()); | 41 CSSValueList* valueList = toCSSValueList(value.get()); |
42 if (valueList->length() > 1) | 42 if (valueList->length() > 1) |
43 return nullptr; | 43 return nullptr; |
44 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true); | 44 return CSSToStyleMap::mapAnimationTimingFunction(valueList->item(0), true); |
45 } | 45 } |
46 | 46 |
47 } // namespace blink | 47 } // namespace blink |
OLD | NEW |