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

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

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "core/animation/AnimationNodeTiming.h" 6 #include "core/animation/AnimationNodeTiming.h"
7 7
8 #include "bindings/core/v8/UnionTypesCore.h"
8 #include "core/animation/Animation.h" 9 #include "core/animation/Animation.h"
9 #include "core/animation/AnimationNode.h" 10 #include "core/animation/AnimationNode.h"
10 #include "platform/animation/TimingFunction.h" 11 #include "platform/animation/TimingFunction.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 PassRefPtrWillBeRawPtr<AnimationNodeTiming> AnimationNodeTiming::create(Animatio nNode* parent) 15 PassRefPtrWillBeRawPtr<AnimationNodeTiming> AnimationNodeTiming::create(Animatio nNode* parent)
15 { 16 {
16 return adoptRefWillBeNoop(new AnimationNodeTiming(parent)); 17 return adoptRefWillBeNoop(new AnimationNodeTiming(parent));
17 } 18 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 58
58 double AnimationNodeTiming::iterations() 59 double AnimationNodeTiming::iterations()
59 { 60 {
60 return m_parent->specifiedTiming().iterationCount; 61 return m_parent->specifiedTiming().iterationCount;
61 } 62 }
62 63
63 // This logic was copied from the example in bindings/tests/idls/TestInterface.i dl 64 // This logic was copied from the example in bindings/tests/idls/TestInterface.i dl
64 // and bindings/tests/results/V8TestInterface.cpp. 65 // and bindings/tests/results/V8TestInterface.cpp.
65 // FIXME: It might be possible to have 'duration' defined as an attribute in the idl. 66 // FIXME: It might be possible to have 'duration' defined as an attribute in the idl.
66 // If possible, fix will be in a follow-up patch. 67 // If possible, fix will be in a follow-up patch.
67 void AnimationNodeTiming::getDuration(String propertyName, Nullable<double>& ele ment0, String& element1) 68 // http://crbug.com/240176
69 void AnimationNodeTiming::getDuration(String propertyName, DoubleOrString& retur nValue)
68 { 70 {
69 if (propertyName != "duration") 71 if (propertyName != "duration")
70 return; 72 return;
71 73
72 if (std::isnan(m_parent->specifiedTiming().iterationDuration)) { 74 if (std::isnan(m_parent->specifiedTiming().iterationDuration)) {
73 element1 = "auto"; 75 returnValue.setString("auto");
74 return; 76 return;
75 } 77 }
76 element0.set(m_parent->specifiedTiming().iterationDuration * 1000); 78 returnValue.setDouble(m_parent->specifiedTiming().iterationDuration * 1000);
77 return; 79 return;
78 } 80 }
79 81
80 double AnimationNodeTiming::playbackRate() 82 double AnimationNodeTiming::playbackRate()
81 { 83 {
82 return m_parent->specifiedTiming().playbackRate; 84 return m_parent->specifiedTiming().playbackRate;
83 } 85 }
84 86
85 String AnimationNodeTiming::direction() 87 String AnimationNodeTiming::direction()
86 { 88 {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 TimingInput::setTimingFunction(timing, easing); 171 TimingInput::setTimingFunction(timing, easing);
170 m_parent->updateSpecifiedTiming(timing); 172 m_parent->updateSpecifiedTiming(timing);
171 } 173 }
172 174
173 void AnimationNodeTiming::trace(Visitor* visitor) 175 void AnimationNodeTiming::trace(Visitor* visitor)
174 { 176 {
175 visitor->trace(m_parent); 177 visitor->trace(m_parent);
176 } 178 }
177 179
178 } // namespace blink 180 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698