OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/events/AnimationPlaybackEvent.h" | |
6 | |
7 namespace blink { | |
8 | |
9 AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, double currentTime, double timelineTime) | |
10 : Event(type, false, false) | |
11 , m_currentTime(currentTime) | |
12 , m_timelineTime(timelineTime) | |
13 { | |
14 } | |
15 | |
16 AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, const A nimationPlaybackEventInit& initializer) | |
17 : Event(type, initializer) | |
18 , m_currentTime(0.0) | |
19 , m_timelineTime(0.0) | |
20 { | |
21 if (initializer.hasCurrentTime()) | |
foolip
2016/09/15 15:49:17
Per spec, but do you know if the only reason that
| |
22 m_currentTime = initializer.currentTime(); | |
23 if (initializer.hasTimelineTime()) | |
24 m_timelineTime = initializer.timelineTime(); | |
25 } | |
26 | |
27 AnimationPlaybackEvent::~AnimationPlaybackEvent() | |
28 { | |
29 } | |
30 | |
31 double AnimationPlaybackEvent::currentTime(bool& isNull) const | |
32 { | |
33 double result = currentTime(); | |
34 isNull = std::isnan(result); | |
35 return result; | |
36 } | |
37 | |
38 double AnimationPlaybackEvent::currentTime() const | |
39 { | |
40 return m_currentTime; | |
41 } | |
42 | |
43 double AnimationPlaybackEvent::timelineTime(bool& isNull) const | |
44 { | |
45 double result = timelineTime(); | |
46 isNull = std::isnan(result); | |
47 return result; | |
48 } | |
49 | |
50 double AnimationPlaybackEvent::timelineTime() const | |
51 { | |
52 return m_timelineTime; | |
53 } | |
54 | |
55 const AtomicString& AnimationPlaybackEvent::interfaceName() const | |
56 { | |
57 return EventNames::AnimationPlaybackEvent; | |
58 } | |
59 | |
60 DEFINE_TRACE(AnimationPlaybackEvent) | |
61 { | |
62 Event::trace(visitor); | |
63 } | |
64 | |
65 } // namespace blink | |
OLD | NEW |