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

Side by Side Diff: Source/core/animation/TimingInput.cpp

Issue 293113007: Simplify animation/transition parsing slightly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/core/animation/EffectInput.cpp ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/animation/TimingInput.h" 6 #include "core/animation/TimingInput.h"
7 7
8 #include "bindings/v8/Dictionary.h" 8 #include "bindings/v8/Dictionary.h"
9 #include "core/css/parser/BisonCSSParser.h" 9 #include "core/css/parser/BisonCSSParser.h"
10 #include "core/css/resolver/CSSToStyleMap.h" 10 #include "core/css/resolver/CSSToStyleMap.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RefPtrWillBeRawPtr<CSSValue> timingFunctionValue = BisonCSSParser::parseAnim ationTimingFunctionValue(timingFunctionString); 92 if (RefPtrWillBeRawPtr<CSSValue> timingFunctionValue = BisonCSSParser::parse AnimationTimingFunctionValue(timingFunctionString))
93
94 if (timingFunctionValue && !timingFunctionValue->isInitialValue())
95 timing.timingFunction = CSSToStyleMap::mapAnimationTimingFunction(timing FunctionValue.get(), true); 93 timing.timingFunction = CSSToStyleMap::mapAnimationTimingFunction(timing FunctionValue.get(), true);
96 else 94 else
97 timing.timingFunction = Timing::defaults().timingFunction; 95 timing.timingFunction = Timing::defaults().timingFunction;
98 } 96 }
99 97
100 Timing TimingInput::convert(const Dictionary& timingInputDictionary) 98 Timing TimingInput::convert(const Dictionary& timingInputDictionary)
101 { 99 {
102 Timing result; 100 Timing result;
103 101
104 // 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
147 } 145 }
148 146
149 Timing TimingInput::convert(double duration) 147 Timing TimingInput::convert(double duration)
150 { 148 {
151 Timing result; 149 Timing result;
152 setIterationDuration(result, duration); 150 setIterationDuration(result, duration);
153 return result; 151 return result;
154 } 152 }
155 153
156 } // namespace WebCore 154 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/EffectInput.cpp ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698