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

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

Issue 1851003002: Throw TypeError if easing string is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix "liner"->"linear" typo in ui/file_manager js file Created 4 years, 8 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/AnimationEffectTiming.h" 5 #include "core/animation/AnimationEffectTiming.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h"
7 #include "bindings/core/v8/UnionTypesCore.h" 8 #include "bindings/core/v8/UnionTypesCore.h"
8 #include "core/animation/AnimationEffect.h" 9 #include "core/animation/AnimationEffect.h"
9 #include "core/animation/KeyframeEffect.h" 10 #include "core/animation/KeyframeEffect.h"
10 #include "platform/animation/TimingFunction.h" 11 #include "platform/animation/TimingFunction.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 AnimationEffectTiming* AnimationEffectTiming::create(AnimationEffect* parent) 15 AnimationEffectTiming* AnimationEffectTiming::create(AnimationEffect* parent)
15 { 16 {
16 return new AnimationEffectTiming(parent); 17 return new AnimationEffectTiming(parent);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 m_parent->updateSpecifiedTiming(timing); 121 m_parent->updateSpecifiedTiming(timing);
121 } 122 }
122 123
123 void AnimationEffectTiming::setDirection(String direction) 124 void AnimationEffectTiming::setDirection(String direction)
124 { 125 {
125 Timing timing = m_parent->specifiedTiming(); 126 Timing timing = m_parent->specifiedTiming();
126 TimingInput::setPlaybackDirection(timing, direction); 127 TimingInput::setPlaybackDirection(timing, direction);
127 m_parent->updateSpecifiedTiming(timing); 128 m_parent->updateSpecifiedTiming(timing);
128 } 129 }
129 130
130 void AnimationEffectTiming::setEasing(String easing) 131 void AnimationEffectTiming::setEasing(String easing, ExceptionState& exceptionSt ate)
131 { 132 {
132 Timing timing = m_parent->specifiedTiming(); 133 Timing timing = m_parent->specifiedTiming();
133 // The AnimationEffectTiming might not be attached to a document at this 134 // The AnimationEffectTiming might not be attached to a document at this
134 // point, so we pass nullptr in to setTimingFunction. This means that these 135 // point, so we pass nullptr in to setTimingFunction. This means that these
135 // calls are not considered in the WebAnimationsEasingAsFunction* 136 // calls are not considered in the WebAnimationsEasingAsFunction*
136 // UseCounters, but the bug we are tracking there does not come through 137 // UseCounters, but the bug we are tracking there does not come through
137 // this interface. 138 // this interface.
138 TimingInput::setTimingFunction(timing, easing, nullptr); 139 if (TimingInput::setTimingFunction(timing, easing, nullptr, exceptionState))
139 m_parent->updateSpecifiedTiming(timing); 140 m_parent->updateSpecifiedTiming(timing);
140 } 141 }
141 142
142 DEFINE_TRACE(AnimationEffectTiming) 143 DEFINE_TRACE(AnimationEffectTiming)
143 { 144 {
144 visitor->trace(m_parent); 145 visitor->trace(m_parent);
145 } 146 }
146 147
147 } // namespace blink 148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698