Chromium Code Reviews| Index: third_party/WebKit/Source/core/events/AnimationPlaybackEvent.cpp |
| diff --git a/third_party/WebKit/Source/core/events/AnimationPlaybackEvent.cpp b/third_party/WebKit/Source/core/events/AnimationPlaybackEvent.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..845db5ca0d3c04d4e8678198d42d30362a6ae134 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/events/AnimationPlaybackEvent.cpp |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/events/AnimationPlaybackEvent.h" |
| + |
| +namespace blink { |
| + |
| +AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, double currentTime, double timelineTime) |
| + : Event(type, false, false) |
| + , m_currentTime(currentTime) |
| + , m_timelineTime(timelineTime) |
| +{ |
| +} |
| + |
| +AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, const AnimationPlaybackEventInit& initializer) |
| + : Event(type, initializer) |
| + , m_currentTime(0.0) |
| + , m_timelineTime(0.0) |
| +{ |
| + if (initializer.hasCurrentTime()) |
|
foolip
2016/09/15 15:49:17
Per spec, but do you know if the only reason that
|
| + m_currentTime = initializer.currentTime(); |
| + if (initializer.hasTimelineTime()) |
| + m_timelineTime = initializer.timelineTime(); |
| +} |
| + |
| +AnimationPlaybackEvent::~AnimationPlaybackEvent() |
| +{ |
| +} |
| + |
| +double AnimationPlaybackEvent::currentTime(bool& isNull) const |
| +{ |
| + double result = currentTime(); |
| + isNull = std::isnan(result); |
| + return result; |
| +} |
| + |
| +double AnimationPlaybackEvent::currentTime() const |
| +{ |
| + return m_currentTime; |
| +} |
| + |
| +double AnimationPlaybackEvent::timelineTime(bool& isNull) const |
| +{ |
| + double result = timelineTime(); |
| + isNull = std::isnan(result); |
| + return result; |
| +} |
| + |
| +double AnimationPlaybackEvent::timelineTime() const |
| +{ |
| + return m_timelineTime; |
| +} |
| + |
| +const AtomicString& AnimationPlaybackEvent::interfaceName() const |
| +{ |
| + return EventNames::AnimationPlaybackEvent; |
| +} |
| + |
| +DEFINE_TRACE(AnimationPlaybackEvent) |
| +{ |
| + Event::trace(visitor); |
| +} |
| + |
| +} // namespace blink |