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

Side by Side Diff: sky/engine/core/animation/Animation.cpp

Issue 760183003: Enable/Unprefix Animations & Transitions, add basic tests (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: patch for landing Created 6 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 namespace blink { 46 namespace blink {
47 47
48 PassRefPtr<Animation> Animation::create(Element* target, PassRefPtr<AnimationEff ect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate) 48 PassRefPtr<Animation> Animation::create(Element* target, PassRefPtr<AnimationEff ect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate)
49 { 49 {
50 return adoptRef(new Animation(target, effect, timing, priority, eventDelegat e)); 50 return adoptRef(new Animation(target, effect, timing, priority, eventDelegat e));
51 } 51 }
52 52
53 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf fect> effect, const Dictionary& timingInputDictionary) 53 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf fect> effect, const Dictionary& timingInputDictionary)
54 { 54 {
55 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
56 return create(element, effect, TimingInput::convert(timingInputDictionary)); 55 return create(element, effect, TimingInput::convert(timingInputDictionary));
57 } 56 }
58 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf fect> effect, double duration) 57 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf fect> effect, double duration)
59 { 58 {
60 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
61 return create(element, effect, TimingInput::convert(duration)); 59 return create(element, effect, TimingInput::convert(duration));
62 } 60 }
63 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf fect> effect) 61 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtr<AnimationEf fect> effect)
64 { 62 {
65 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
66 return create(element, effect, Timing()); 63 return create(element, effect, Timing());
67 } 64 }
68 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception State& exceptionState) 65 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception State& exceptionState)
69 { 66 {
70 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
71 if (element) 67 if (element)
72 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming); 68 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming);
73 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), TimingInput::convert(timingInputDictionary)); 69 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), TimingInput::convert(timingInputDictionary));
74 } 70 }
75 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState) 71 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
76 { 72 {
77 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
78 if (element) 73 if (element)
79 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectDoubleTiming); 74 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectDoubleTiming);
80 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), TimingInput::convert(duration)); 75 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), TimingInput::convert(duration));
81 } 76 }
82 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, ExceptionState& exceptionState) 77 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, ExceptionState& exceptionState)
83 { 78 {
84 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
85 if (element) 79 if (element)
86 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming); 80 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming);
87 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), Timing()); 81 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), Timing());
88 } 82 }
89 83
90 Animation::Animation(Element* target, PassRefPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate) 84 Animation::Animation(Element* target, PassRefPtr<AnimationEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelegate> eventDelegate)
91 : AnimationNode(timing, eventDelegate) 85 : AnimationNode(timing, eventDelegate)
92 , m_target(target) 86 , m_target(target)
93 , m_effect(effect) 87 , m_effect(effect)
94 , m_sampledEffect(nullptr) 88 , m_sampledEffect(nullptr)
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // clear m_sampledEffect first. 215 // clear m_sampledEffect first.
222 m_target = nullptr; 216 m_target = nullptr;
223 clearEventDelegate(); 217 clearEventDelegate();
224 SampledEffect* sampledEffect = m_sampledEffect; 218 SampledEffect* sampledEffect = m_sampledEffect;
225 m_sampledEffect = nullptr; 219 m_sampledEffect = nullptr;
226 if (sampledEffect) 220 if (sampledEffect)
227 sampledEffect->clear(); 221 sampledEffect->clear();
228 } 222 }
229 223
230 } // namespace blink 224 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl ('k') | sky/engine/core/animation/Animation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698