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/TimingInput.h" | 6 #include "core/animation/TimingInput.h" |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
9 #include "core/css/parser/BisonCSSParser.h" | 9 #include "core/css/parser/CSSParser.h" |
10 #include "core/css/resolver/CSSToStyleMap.h" | 10 #include "core/css/resolver/CSSToStyleMap.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 void TimingInput::setStartDelay(Timing& timing, double startDelay) | 14 void TimingInput::setStartDelay(Timing& timing, double startDelay) |
15 { | 15 { |
16 if (std::isfinite(startDelay)) | 16 if (std::isfinite(startDelay)) |
17 timing.startDelay = startDelay / 1000; | 17 timing.startDelay = startDelay / 1000; |
18 else | 18 else |
19 timing.startDelay = Timing::defaults().startDelay; | 19 timing.startDelay = Timing::defaults().startDelay; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 timing.direction = Timing::PlaybackDirectionAlternate; | 82 timing.direction = Timing::PlaybackDirectionAlternate; |
83 } else if (direction == "alternate-reverse") { | 83 } else if (direction == "alternate-reverse") { |
84 timing.direction = Timing::PlaybackDirectionAlternateReverse; | 84 timing.direction = Timing::PlaybackDirectionAlternateReverse; |
85 } else { | 85 } else { |
86 timing.direction = Timing::defaults().direction; | 86 timing.direction = Timing::defaults().direction; |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 void TimingInput::setTimingFunction(Timing& timing, const String& timingFunction
String) | 90 void TimingInput::setTimingFunction(Timing& timing, const String& timingFunction
String) |
91 { | 91 { |
92 if (RefPtrWillBeRawPtr<CSSValue> timingFunctionValue = BisonCSSParser::parse
AnimationTimingFunctionValue(timingFunctionString)) | 92 if (RefPtrWillBeRawPtr<CSSValue> timingFunctionValue = CSSParser::parseAnima
tionTimingFunctionValue(timingFunctionString)) |
93 timing.timingFunction = CSSToStyleMap::mapAnimationTimingFunction(timing
FunctionValue.get(), true); | 93 timing.timingFunction = CSSToStyleMap::mapAnimationTimingFunction(timing
FunctionValue.get(), true); |
94 else | 94 else |
95 timing.timingFunction = Timing::defaults().timingFunction; | 95 timing.timingFunction = Timing::defaults().timingFunction; |
96 } | 96 } |
97 | 97 |
98 Timing TimingInput::convert(const Dictionary& timingInputDictionary) | 98 Timing TimingInput::convert(const Dictionary& timingInputDictionary) |
99 { | 99 { |
100 Timing result; | 100 Timing result; |
101 | 101 |
102 // FIXME: This method needs to be refactored to handle invalid | 102 // FIXME: This method needs to be refactored to handle invalid |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 Timing TimingInput::convert(double duration) | 147 Timing TimingInput::convert(double duration) |
148 { | 148 { |
149 Timing result; | 149 Timing result; |
150 setIterationDuration(result, duration); | 150 setIterationDuration(result, duration); |
151 return result; | 151 return result; |
152 } | 152 } |
153 | 153 |
154 } // namespace blink | 154 } // namespace blink |
OLD | NEW |