[Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Dec 2017 18:02:37 +0000 (18:02 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Dec 2017 18:02:37 +0000 (18:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180647
<rdar://problem/35966325>

Reviewed by Dean Jackson.

We implement the AnimationPlaybackEvent interface and AnimationPlaybackEventInit dictionary
as the first step towards dispatching animation "finish" and "cancel" events.

Animation playback events will be dispatched on Animation objects and expose the timeline time
and animation current time at the time they were constructed. Dispatch itself, which will be
the focus of the next patch, is not synchronous, so it's important to track those values
at creation time.

No new tests yet, followup patches will enable event dispatch and existing Web Platform Tests
will show progressions.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationPlaybackEvent.cpp: Added.
(WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
(WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
(WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
* animation/AnimationPlaybackEvent.h: Added.
* animation/AnimationPlaybackEvent.idl: Added.
* animation/AnimationPlaybackEventInit.h: Added.
* animation/AnimationPlaybackEventInit.idl: Added.
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/animation/AnimationPlaybackEvent.cpp [new file with mode: 0644]
Source/WebCore/animation/AnimationPlaybackEvent.h [new file with mode: 0644]
Source/WebCore/animation/AnimationPlaybackEvent.idl [new file with mode: 0644]
Source/WebCore/animation/AnimationPlaybackEventInit.h [new file with mode: 0644]
Source/WebCore/animation/AnimationPlaybackEventInit.idl [new file with mode: 0644]
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/EventNames.in

index 348c762..3973f59 100644 (file)
@@ -424,6 +424,8 @@ set(WebCore_NON_SVG_IDL_FILES
     animation/Animatable.idl
     animation/AnimationEffect.idl
     animation/AnimationEffectTiming.idl
+    animation/AnimationPlaybackEvent.idl
+    animation/AnimationPlaybackEventInit.idl
     animation/AnimationTimeline.idl
     animation/DocumentTimeline.idl
     animation/KeyframeEffect.idl
index d329a3d..08540b9 100644 (file)
@@ -1,3 +1,37 @@
+2017-12-11  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
+        https://bugs.webkit.org/show_bug.cgi?id=180647
+        <rdar://problem/35966325>
+
+        Reviewed by Dean Jackson.
+
+        We implement the AnimationPlaybackEvent interface and AnimationPlaybackEventInit dictionary
+        as the first step towards dispatching animation "finish" and "cancel" events.
+
+        Animation playback events will be dispatched on Animation objects and expose the timeline time
+        and animation current time at the time they were constructed. Dispatch itself, which will be
+        the focus of the next patch, is not synchronous, so it's important to track those values
+        at creation time.
+
+        No new tests yet, followup patches will enable event dispatch and existing Web Platform Tests
+        will show progressions.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/AnimationPlaybackEvent.cpp: Added.
+        (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
+        (WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
+        (WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
+        * animation/AnimationPlaybackEvent.h: Added.
+        * animation/AnimationPlaybackEvent.idl: Added.
+        * animation/AnimationPlaybackEventInit.h: Added.
+        * animation/AnimationPlaybackEventInit.idl: Added.
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.in:
+
 2017-12-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
 
         [WinCairo] DumpRenderTree times out for all non-http tests
index 876cbaa..0f2961f 100644 (file)
@@ -348,6 +348,8 @@ JS_BINDING_IDLS = \
     $(WebCore)/animation/Animatable.idl \
     $(WebCore)/animation/AnimationEffect.idl \
     $(WebCore)/animation/AnimationEffectTiming.idl \
+    $(WebCore)/animation/AnimationPlaybackEvent.idl \
+    $(WebCore)/animation/AnimationPlaybackEventInit.idl \
     $(WebCore)/animation/AnimationTimeline.idl \
     $(WebCore)/animation/DocumentTimeline.idl \
     $(WebCore)/animation/KeyframeEffect.idl \
index 8a18675..4ac8def 100644 (file)
@@ -322,6 +322,7 @@ accessibility/AccessibleNode.cpp
 
 animation/AnimationEffect.cpp
 animation/AnimationEffectTiming.cpp
+animation/AnimationPlaybackEvent.cpp
 animation/AnimationTimeline.cpp
 animation/DocumentTimeline.cpp
 animation/KeyframeEffect.cpp
@@ -2289,6 +2290,8 @@ JSAnalyserNode.cpp
 JSAnimationEvent.cpp
 JSAnimationEffect.cpp
 JSAnimationEffectTiming.cpp
+JSAnimationPlaybackEvent.cpp
+JSAnimationPlaybackEventInit.cpp
 JSAnimationTimeline.cpp
 JSAttr.cpp
 JSAudioBuffer.cpp
index d07c3c8..430e726 100644 (file)
                7118FED515685CC60030B79A /* JSSVGViewSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118FED315685CC60030B79A /* JSSVGViewSpec.h */; };
                713171341FBE78DB00F758DE /* CSSPropertyBlendingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 713171321FBE78C500F758DE /* CSSPropertyBlendingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7134496E146941B300720312 /* SVGLengthContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7134496C146941B300720312 /* SVGLengthContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C651FDAD27B00F2BEE1 /* AnimationPlaybackEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               714C7C671FDAD2A900F2BEE1 /* AnimationPlaybackEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C621FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               714C7C6C1FDADAF300F2BEE1 /* JSAnimationPlaybackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C6A1FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.h */; };
+               714C7C6D1FDADAF600F2BEE1 /* JSAnimationPlaybackEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C6B1FDADAD500F2BEE1 /* JSAnimationPlaybackEventInit.h */; };
                71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */ = {isa = PBXBuildFile; fileRef = 715379FF146BD9D6008BD615 /* SVGPathData.h */; };
                71556CB21F9F09BA00E78D08 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAD1F9F099D00E78D08 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
                714131481DC9D6EF00336107 /* js-files */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "js-files"; sourceTree = "<group>"; };
                7146DF8B1DEFC2ED0046F98B /* tracks-panel.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "tracks-panel.css"; sourceTree = "<group>"; };
                7146DF8C1DEFC2ED0046F98B /* tracks-panel.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tracks-panel.js"; sourceTree = "<group>"; };
+               714C7C601FDAD27900F2BEE1 /* AnimationPlaybackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationPlaybackEvent.cpp; sourceTree = "<group>"; };
+               714C7C621FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationPlaybackEventInit.h; sourceTree = "<group>"; };
+               714C7C631FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationPlaybackEventInit.idl; sourceTree = "<group>"; };
+               714C7C641FDAD27B00F2BEE1 /* AnimationPlaybackEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationPlaybackEvent.idl; sourceTree = "<group>"; };
+               714C7C651FDAD27B00F2BEE1 /* AnimationPlaybackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationPlaybackEvent.h; sourceTree = "<group>"; };
+               714C7C681FDADAD400F2BEE1 /* JSAnimationPlaybackEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationPlaybackEventInit.cpp; sourceTree = "<group>"; };
+               714C7C691FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationPlaybackEvent.cpp; sourceTree = "<group>"; };
+               714C7C6A1FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationPlaybackEvent.h; sourceTree = "<group>"; };
+               714C7C6B1FDADAD500F2BEE1 /* JSAnimationPlaybackEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationPlaybackEventInit.h; sourceTree = "<group>"; };
                714F5B051DEE5F740075BD17 /* invalid-placard.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "invalid-placard.js"; sourceTree = "<group>"; };
                714F5B061DEE5F8A0075BD17 /* invalid-placard@1x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "invalid-placard@1x.png"; sourceTree = "<group>"; };
                714F5B071DEE5F8A0075BD17 /* invalid-placard@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "invalid-placard@2x.png"; sourceTree = "<group>"; };
                                71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */,
                                71556CBB1F9F09FE00E78D08 /* JSAnimationEffectTiming.cpp */,
                                71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */,
+                               714C7C691FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.cpp */,
+                               714C7C6A1FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.h */,
+                               714C7C681FDADAD400F2BEE1 /* JSAnimationPlaybackEventInit.cpp */,
+                               714C7C6B1FDADAD500F2BEE1 /* JSAnimationPlaybackEventInit.h */,
                                71025EDA1F99F1A7004A250C /* JSAnimationTimeline.cpp */,
                                71025ED91F99F1A7004A250C /* JSAnimationTimeline.h */,
                                71025EDB1F99F1A8004A250C /* JSDocumentTimeline.cpp */,
                                71556CAC1F9F099D00E78D08 /* AnimationEffectTiming.cpp */,
                                71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */,
                                71556CAF1F9F099E00E78D08 /* AnimationEffectTiming.idl */,
+                               714C7C601FDAD27900F2BEE1 /* AnimationPlaybackEvent.cpp */,
+                               714C7C651FDAD27B00F2BEE1 /* AnimationPlaybackEvent.h */,
+                               714C7C641FDAD27B00F2BEE1 /* AnimationPlaybackEvent.idl */,
+                               714C7C621FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.h */,
+                               714C7C631FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.idl */,
                                71025EC61F99F096004A250C /* AnimationTimeline.cpp */,
                                71025EC71F99F096004A250C /* AnimationTimeline.h */,
                                71025EC91F99F096004A250C /* AnimationTimeline.idl */,
                                71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */,
                                319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
                                49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */,
+                               714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */,
+                               714C7C671FDAD2A900F2BEE1 /* AnimationPlaybackEventInit.h in Headers */,
                                71025ECD1F99F0CE004A250C /* AnimationTimeline.h in Headers */,
                                31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */,
                                0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */,
                                71556CBC1F9F0A4900E78D08 /* JSAnimationEffect.h in Headers */,
                                71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */,
                                3198480C1A1E6CE800A13318 /* JSAnimationEvent.h in Headers */,
+                               714C7C6C1FDADAF300F2BEE1 /* JSAnimationPlaybackEvent.h in Headers */,
+                               714C7C6D1FDADAF600F2BEE1 /* JSAnimationPlaybackEventInit.h in Headers */,
                                71025EDE1F99F1EC004A250C /* JSAnimationTimeline.h in Headers */,
                                A1DF5A991F7EC8C00058A477 /* JSApplePayContactField.h in Headers */,
                                7C6579F01E00856600E3A27A /* JSApplePayLineItem.h in Headers */,
diff --git a/Source/WebCore/animation/AnimationPlaybackEvent.cpp b/Source/WebCore/animation/AnimationPlaybackEvent.cpp
new file mode 100644 (file)
index 0000000..8928a78
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "AnimationPlaybackEvent.h"
+#include "config.h"
+
+namespace WebCore {
+
+AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, const AnimationPlaybackEventInit& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
+{
+    if (initializer.currentTime == std::nullopt)
+        m_currentTime = std::nullopt;
+    else
+        m_currentTime = Seconds::fromMilliseconds(initializer.currentTime.value());
+
+    if (initializer.timelineTime == std::nullopt)
+        m_timelineTime = std::nullopt;
+    else
+        m_timelineTime = Seconds::fromMilliseconds(initializer.timelineTime.value());
+}
+
+AnimationPlaybackEvent::AnimationPlaybackEvent(const AtomicString& type, std::optional<Seconds> currentTime, std::optional<Seconds> timelineTime)
+    : Event(type, true, false)
+    , m_currentTime(currentTime)
+    , m_timelineTime(timelineTime)
+{
+}
+
+AnimationPlaybackEvent::~AnimationPlaybackEvent() = default;
+
+std::optional<double> AnimationPlaybackEvent::bindingsCurrentTime() const
+{
+    if (!m_currentTime)
+        return std::nullopt;
+    return m_currentTime->milliseconds();
+}
+
+std::optional<double> AnimationPlaybackEvent::bindingsTimelineTime() const
+{
+    if (!m_timelineTime)
+        return std::nullopt;
+    return m_timelineTime->milliseconds();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/animation/AnimationPlaybackEvent.h b/Source/WebCore/animation/AnimationPlaybackEvent.h
new file mode 100644 (file)
index 0000000..384ce3e
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "Event.h"
+#include "AnimationPlaybackEventInit.h"
+
+namespace WebCore {
+
+class AnimationPlaybackEvent final : public Event {
+public:
+    static Ref<AnimationPlaybackEvent> create(const AtomicString& type, std::optional<Seconds> currentTime, std::optional<Seconds> timelineTime)
+    {
+        return adoptRef(*new AnimationPlaybackEvent(type, currentTime, timelineTime));
+    }
+
+    static Ref<AnimationPlaybackEvent> create(const AtomicString& type, const AnimationPlaybackEventInit& initializer, IsTrusted isTrusted = IsTrusted::No)
+    {
+        return adoptRef(*new AnimationPlaybackEvent(type, initializer, isTrusted));
+    }
+
+    virtual ~AnimationPlaybackEvent();
+
+    std::optional<double> bindingsCurrentTime() const;
+    std::optional<Seconds> currentTime() const { return m_currentTime; }
+    std::optional<double> bindingsTimelineTime() const;
+    std::optional<Seconds> timelineTime() const { return m_timelineTime; }
+
+    EventInterface eventInterface() const override { return AnimationPlaybackEventInterfaceType; }
+
+private:
+    AnimationPlaybackEvent(const AtomicString&, std::optional<Seconds>, std::optional<Seconds>);
+    AnimationPlaybackEvent(const AtomicString&, const AnimationPlaybackEventInit&, IsTrusted);
+
+    std::optional<Seconds> m_currentTime;
+    std::optional<Seconds> m_timelineTime;
+};
+
+}
diff --git a/Source/WebCore/animation/AnimationPlaybackEvent.idl b/Source/WebCore/animation/AnimationPlaybackEvent.idl
new file mode 100644 (file)
index 0000000..9200996
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebAnimations,
+    Exposed=Window,
+    Constructor(DOMString type, optional AnimationPlaybackEventInit eventInitDict)
+] interface AnimationPlaybackEvent : Event {
+    [ImplementedAs=bindingsCurrentTime] readonly attribute double? currentTime;
+    [ImplementedAs=bindingsTimelineTime] readonly attribute double? timelineTime;
+};
diff --git a/Source/WebCore/animation/AnimationPlaybackEventInit.h b/Source/WebCore/animation/AnimationPlaybackEventInit.h
new file mode 100644 (file)
index 0000000..98a4130
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "EventInit.h"
+
+namespace WebCore {
+
+struct AnimationPlaybackEventInit : EventInit {
+    std::optional<double> currentTime;
+    std::optional<double> timelineTime;
+};
+
+}
diff --git a/Source/WebCore/animation/AnimationPlaybackEventInit.idl b/Source/WebCore/animation/AnimationPlaybackEventInit.idl
new file mode 100644 (file)
index 0000000..88712d9
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebAnimations
+] dictionary AnimationPlaybackEventInit : EventInit {
+    double? currentTime = null;
+    double? timelineTime = null;
+};
index ac77fdf..b3a4144 100644 (file)
@@ -35,6 +35,7 @@ namespace WebCore {
     macro(Animation) \
     macro(AnimationEffect) \
     macro(AnimationEffectTiming) \
+    macro(AnimationPlaybackEvent) \
     macro(AnimationTimeline) \
     macro(ApplePaySession) \
     macro(AttachmentElement) \
index 1baac9e..1889069 100644 (file)
@@ -4,6 +4,7 @@ Event
 Events interfaceName=Event
 HTMLEvents interfaceName=Event
 AnimationEvent
+AnimationPlaybackEvent
 BeforeLoadEvent
 BeforeUnloadEvent
 ClipboardEvent