Title: [207188] trunk/Source/WebCore
Revision
207188
Author
[email protected]
Date
2016-10-11 21:48:13 -0700 (Tue, 11 Oct 2016)

Log Message

Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163312

Reviewed by Ryosuke Niwa.

Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
and use a regular constructor as in the specification:
- https://drafts.csswg.org/css-animations/#interface-animationevent

* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):
* dom/AnimationEvent.h:
* dom/AnimationEvent.idl:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (207187 => 207188)


--- trunk/Source/WebCore/ChangeLog	2016-10-12 04:47:00 UTC (rev 207187)
+++ trunk/Source/WebCore/ChangeLog	2016-10-12 04:48:13 UTC (rev 207188)
@@ -1,5 +1,21 @@
 2016-10-11  Chris Dumez  <[email protected]>
 
+        Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
+        https://bugs.webkit.org/show_bug.cgi?id=163312
+
+        Reviewed by Ryosuke Niwa.
+
+        Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
+        and use a regular constructor as in the specification:
+        - https://drafts.csswg.org/css-animations/#interface-animationevent
+
+        * dom/AnimationEvent.cpp:
+        (WebCore::AnimationEvent::AnimationEvent):
+        * dom/AnimationEvent.h:
+        * dom/AnimationEvent.idl:
+
+2016-10-11  Chris Dumez  <[email protected]>
+
         Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event]
         https://bugs.webkit.org/show_bug.cgi?id=163311
 

Modified: trunk/Source/WebCore/dom/AnimationEvent.cpp (207187 => 207188)


--- trunk/Source/WebCore/dom/AnimationEvent.cpp	2016-10-12 04:47:00 UTC (rev 207187)
+++ trunk/Source/WebCore/dom/AnimationEvent.cpp	2016-10-12 04:48:13 UTC (rev 207188)
@@ -30,8 +30,8 @@
 
 namespace WebCore {
 
-AnimationEvent::AnimationEvent(const AtomicString& type, const AnimationEventInit& initializer)
-    : Event(type, initializer)
+AnimationEvent::AnimationEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
     , m_animationName(initializer.animationName)
     , m_elapsedTime(initializer.elapsedTime)
 {

Modified: trunk/Source/WebCore/dom/AnimationEvent.h (207187 => 207188)


--- trunk/Source/WebCore/dom/AnimationEvent.h	2016-10-12 04:47:00 UTC (rev 207187)
+++ trunk/Source/WebCore/dom/AnimationEvent.h	2016-10-12 04:48:13 UTC (rev 207188)
@@ -30,11 +30,6 @@
 
 namespace WebCore {
 
-struct AnimationEventInit : public EventInit {
-    String animationName;
-    double elapsedTime { 0 };
-};
-
 class AnimationEvent final : public Event {
 public:
     static Ref<AnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
@@ -42,9 +37,14 @@
         return adoptRef(*new AnimationEvent(type, animationName, elapsedTime));
     }
 
-    static Ref<AnimationEvent> createForBindings(const AtomicString& type, const AnimationEventInit& initializer)
+    struct Init : EventInit {
+        String animationName;
+        double elapsedTime { 0 };
+    };
+
+    static Ref<AnimationEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
     {
-        return adoptRef(*new AnimationEvent(type, initializer));
+        return adoptRef(*new AnimationEvent(type, initializer, isTrusted));
     }
 
     virtual ~AnimationEvent();
@@ -56,7 +56,7 @@
 
 private:
     AnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
-    AnimationEvent(const AtomicString&, const AnimationEventInit&);
+    AnimationEvent(const AtomicString&, const Init&, IsTrusted);
 
     String m_animationName;
     double m_elapsedTime;

Modified: trunk/Source/WebCore/dom/AnimationEvent.idl (207187 => 207188)


--- trunk/Source/WebCore/dom/AnimationEvent.idl	2016-10-12 04:47:00 UTC (rev 207187)
+++ trunk/Source/WebCore/dom/AnimationEvent.idl	2016-10-12 04:48:13 UTC (rev 207188)
@@ -24,9 +24,20 @@
  */
 
 [
-    ConstructorTemplate=Event
+    Constructor(DOMString type, optional AnimationEventInit animationEventInitDict),
 ] interface AnimationEvent : Event {
-    [InitializedByEventConstructor] readonly attribute DOMString animationName;
-    [InitializedByEventConstructor] readonly attribute unrestricted double elapsedTime;
+    readonly attribute DOMString animationName;
+    readonly attribute double elapsedTime;
+
+    // FIXME: This is not supported yet.
+    // readonly attribute DOMString pseudoElement;
 };
 
+dictionary AnimationEventInit : EventInit {
+    DOMString animationName = "";
+    double elapsedTime = 0.0;
+
+    // FIXME: This is not supported yet.
+    // DOMString pseudoElement = "";
+};
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to