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

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

Issue 942553002: Make element.style["color"] work in Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add back removeProperty Created 5 years, 10 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 | « sky/engine/core/animation/AnimationNodeTiming.h ('k') | sky/engine/core/animation/Timing.idl » ('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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/animation/AnimationNodeTiming.h" 6 #include "sky/engine/core/animation/AnimationNodeTiming.h"
7 7
8 #include "sky/engine/core/animation/Animation.h" 8 #include "sky/engine/core/animation/Animation.h"
9 #include "sky/engine/core/animation/AnimationNode.h" 9 #include "sky/engine/core/animation/AnimationNode.h"
10 #include "sky/engine/platform/animation/TimingFunction.h" 10 #include "sky/engine/platform/animation/TimingFunction.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 double AnimationNodeTiming::iterationStart() 53 double AnimationNodeTiming::iterationStart()
54 { 54 {
55 return m_parent->specifiedTiming().iterationStart; 55 return m_parent->specifiedTiming().iterationStart;
56 } 56 }
57 57
58 double AnimationNodeTiming::iterations() 58 double AnimationNodeTiming::iterations()
59 { 59 {
60 return m_parent->specifiedTiming().iterationCount; 60 return m_parent->specifiedTiming().iterationCount;
61 } 61 }
62 62
63 // This logic was copied from the example in bindings/tests/idls/TestInterface.i dl 63 String AnimationNodeTiming::getDuration(String propertyName)
64 // and bindings/tests/results/V8TestInterface.cpp.
65 // 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 void AnimationNodeTiming::getDuration(String propertyName, Nullable<double>& ele ment0, String& element1)
68 { 64 {
69 if (propertyName != "duration") 65 if (propertyName != "duration")
70 return; 66 return String();
71 67
72 if (std::isnan(m_parent->specifiedTiming().iterationDuration)) { 68 if (std::isnan(m_parent->specifiedTiming().iterationDuration))
73 element1 = "auto"; 69 return "auto";
74 return; 70
75 } 71 return String::number(m_parent->specifiedTiming().iterationDuration * 1000);
76 element0.set(m_parent->specifiedTiming().iterationDuration * 1000);
77 return;
78 } 72 }
79 73
80 double AnimationNodeTiming::playbackRate() 74 double AnimationNodeTiming::playbackRate()
81 { 75 {
82 return m_parent->specifiedTiming().playbackRate; 76 return m_parent->specifiedTiming().playbackRate;
83 } 77 }
84 78
85 String AnimationNodeTiming::direction() 79 String AnimationNodeTiming::direction()
86 { 80 {
87 Timing::PlaybackDirection direction = m_parent->specifiedTiming().direction; 81 Timing::PlaybackDirection direction = m_parent->specifiedTiming().direction;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 158 }
165 159
166 void AnimationNodeTiming::setEasing(String easing) 160 void AnimationNodeTiming::setEasing(String easing)
167 { 161 {
168 Timing timing = m_parent->specifiedTiming(); 162 Timing timing = m_parent->specifiedTiming();
169 TimingInput::setTimingFunction(timing, easing); 163 TimingInput::setTimingFunction(timing, easing);
170 m_parent->updateSpecifiedTiming(timing); 164 m_parent->updateSpecifiedTiming(timing);
171 } 165 }
172 166
173 } // namespace blink 167 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/animation/AnimationNodeTiming.h ('k') | sky/engine/core/animation/Timing.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698