Title: [225745] trunk/Source/WebCore
Revision
225745
Author
[email protected]
Date
2017-12-11 10:02:37 -0800 (Mon, 11 Dec 2017)

Log Message

[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:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (225744 => 225745)


--- trunk/Source/WebCore/CMakeLists.txt	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-12-11 18:02:37 UTC (rev 225745)
@@ -424,6 +424,8 @@
     animation/Animatable.idl
     animation/AnimationEffect.idl
     animation/AnimationEffectTiming.idl
+    animation/AnimationPlaybackEvent.idl
+    animation/AnimationPlaybackEventInit.idl
     animation/AnimationTimeline.idl
     animation/DocumentTimeline.idl
     animation/KeyframeEffect.idl

Modified: trunk/Source/WebCore/ChangeLog (225744 => 225745)


--- trunk/Source/WebCore/ChangeLog	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/ChangeLog	2017-12-11 18:02:37 UTC (rev 225745)
@@ -1,3 +1,37 @@
+2017-12-11  Antoine Quint  <[email protected]>
+
+        [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  <[email protected]>
 
         [WinCairo] DumpRenderTree times out for all non-http tests

Modified: trunk/Source/WebCore/DerivedSources.make (225744 => 225745)


--- trunk/Source/WebCore/DerivedSources.make	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/DerivedSources.make	2017-12-11 18:02:37 UTC (rev 225745)
@@ -348,6 +348,8 @@
     $(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 \

Modified: trunk/Source/WebCore/Sources.txt (225744 => 225745)


--- trunk/Source/WebCore/Sources.txt	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/Sources.txt	2017-12-11 18:02:37 UTC (rev 225745)
@@ -322,6 +322,7 @@
 
 animation/AnimationEffect.cpp
 animation/AnimationEffectTiming.cpp
+animation/AnimationPlaybackEvent.cpp
 animation/AnimationTimeline.cpp
 animation/DocumentTimeline.cpp
 animation/KeyframeEffect.cpp
@@ -2289,6 +2290,8 @@
 JSAnimationEvent.cpp
 JSAnimationEffect.cpp
 JSAnimationEffectTiming.cpp
+JSAnimationPlaybackEvent.cpp
+JSAnimationPlaybackEventInit.cpp
 JSAnimationTimeline.cpp
 JSAttr.cpp
 JSAudioBuffer.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (225744 => 225745)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-12-11 18:02:37 UTC (rev 225745)
@@ -1867,6 +1867,10 @@
 		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, ); }; };
@@ -8609,6 +8613,15 @@
 		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 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
 		714F5B071DEE5F8A0075BD17 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -15174,6 +15187,10 @@
 				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 */,
@@ -18695,6 +18712,11 @@
 				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 */,
@@ -26071,6 +26093,8 @@
 				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 */,
@@ -27350,6 +27374,8 @@
 				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 */,

Added: trunk/Source/WebCore/animation/AnimationPlaybackEvent.cpp (0 => 225745)


--- trunk/Source/WebCore/animation/AnimationPlaybackEvent.cpp	                        (rev 0)
+++ trunk/Source/WebCore/animation/AnimationPlaybackEvent.cpp	2017-12-11 18:02:37 UTC (rev 225745)
@@ -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

Added: trunk/Source/WebCore/animation/AnimationPlaybackEvent.h (0 => 225745)


--- trunk/Source/WebCore/animation/AnimationPlaybackEvent.h	                        (rev 0)
+++ trunk/Source/WebCore/animation/AnimationPlaybackEvent.h	2017-12-11 18:02:37 UTC (rev 225745)
@@ -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;
+};
+
+}

Added: trunk/Source/WebCore/animation/AnimationPlaybackEvent.idl (0 => 225745)


--- trunk/Source/WebCore/animation/AnimationPlaybackEvent.idl	                        (rev 0)
+++ trunk/Source/WebCore/animation/AnimationPlaybackEvent.idl	2017-12-11 18:02:37 UTC (rev 225745)
@@ -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;
+};

Added: trunk/Source/WebCore/animation/AnimationPlaybackEventInit.h (0 => 225745)


--- trunk/Source/WebCore/animation/AnimationPlaybackEventInit.h	                        (rev 0)
+++ trunk/Source/WebCore/animation/AnimationPlaybackEventInit.h	2017-12-11 18:02:37 UTC (rev 225745)
@@ -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;
+};
+
+}

Added: trunk/Source/WebCore/animation/AnimationPlaybackEventInit.idl (0 => 225745)


--- trunk/Source/WebCore/animation/AnimationPlaybackEventInit.idl	                        (rev 0)
+++ trunk/Source/WebCore/animation/AnimationPlaybackEventInit.idl	2017-12-11 18:02:37 UTC (rev 225745)
@@ -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;
+};

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (225744 => 225745)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2017-12-11 18:02:37 UTC (rev 225745)
@@ -35,6 +35,7 @@
     macro(Animation) \
     macro(AnimationEffect) \
     macro(AnimationEffectTiming) \
+    macro(AnimationPlaybackEvent) \
     macro(AnimationTimeline) \
     macro(ApplePaySession) \
     macro(AttachmentElement) \

Modified: trunk/Source/WebCore/dom/EventNames.in (225744 => 225745)


--- trunk/Source/WebCore/dom/EventNames.in	2017-12-11 17:46:26 UTC (rev 225744)
+++ trunk/Source/WebCore/dom/EventNames.in	2017-12-11 18:02:37 UTC (rev 225745)
@@ -4,6 +4,7 @@
 Events interfaceName=Event
 HTMLEvents interfaceName=Event
 AnimationEvent
+AnimationPlaybackEvent
 BeforeLoadEvent
 BeforeUnloadEvent
 ClipboardEvent
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to