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

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

Issue 466323002: IDL: Use Nullable for union type return value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/AnimationNodeTiming.h ('k') | Source/core/animation/AnimationTest.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/AnimationNodeTiming.h" 6 #include "core/animation/AnimationNodeTiming.h"
7 7
8 #include "core/animation/Animation.h" 8 #include "core/animation/Animation.h"
9 #include "core/animation/AnimationNode.h" 9 #include "core/animation/AnimationNode.h"
10 #include "platform/animation/TimingFunction.h" 10 #include "platform/animation/TimingFunction.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 double AnimationNodeTiming::iterations() 59 double AnimationNodeTiming::iterations()
60 { 60 {
61 return m_parent->specifiedTiming().iterationCount; 61 return m_parent->specifiedTiming().iterationCount;
62 } 62 }
63 63
64 // 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
65 // and bindings/tests/results/V8TestInterface.cpp. 65 // and bindings/tests/results/V8TestInterface.cpp.
66 // 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.
67 // If possible, fix will be in a follow-up patch. 67 // If possible, fix will be in a follow-up patch.
68 void AnimationNodeTiming::getDuration(String propertyName, bool& element0Enabled , double& element0, bool& element1Enabled, String& element1) 68 void AnimationNodeTiming::getDuration(String propertyName, Nullable<double>& ele ment0, String& element1)
69 { 69 {
70 if (propertyName != "duration") 70 if (propertyName != "duration")
71 return; 71 return;
72 72
73 if (std::isnan(m_parent->specifiedTiming().iterationDuration)) { 73 if (std::isnan(m_parent->specifiedTiming().iterationDuration)) {
74 element1Enabled = true;
75 element1 = "auto"; 74 element1 = "auto";
76 return; 75 return;
77 } 76 }
78 element0Enabled = true; 77 element0.set(m_parent->specifiedTiming().iterationDuration * 1000);
79 element0 = m_parent->specifiedTiming().iterationDuration * 1000;
80 return; 78 return;
81 } 79 }
82 80
83 double AnimationNodeTiming::playbackRate() 81 double AnimationNodeTiming::playbackRate()
84 { 82 {
85 return m_parent->specifiedTiming().playbackRate; 83 return m_parent->specifiedTiming().playbackRate;
86 } 84 }
87 85
88 String AnimationNodeTiming::direction() 86 String AnimationNodeTiming::direction()
89 { 87 {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 TimingInput::setTimingFunction(timing, easing); 170 TimingInput::setTimingFunction(timing, easing);
173 m_parent->updateSpecifiedTiming(timing); 171 m_parent->updateSpecifiedTiming(timing);
174 } 172 }
175 173
176 void AnimationNodeTiming::trace(Visitor* visitor) 174 void AnimationNodeTiming::trace(Visitor* visitor)
177 { 175 {
178 visitor->trace(m_parent); 176 visitor->trace(m_parent);
179 } 177 }
180 178
181 } // namespace blink 179 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationNodeTiming.h ('k') | Source/core/animation/AnimationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698