Title: [251840] trunk
Revision
251840
Author
[email protected]
Date
2019-10-31 05:43:37 -0700 (Thu, 31 Oct 2019)

Log Message

[Web Animations] Add support for AnimationEvent.pseudoElement
https://bugs.webkit.org/show_bug.cgi?id=203671

Patch by Antoine Quint <[email protected]> on 2019-10-31
Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

* web-platform-tests/css/css-animations/animationevent-interface-expected.txt:
* web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt:
* web-platform-tests/css/css-animations/animationevent-types-expected.txt:
* web-platform-tests/css/css-animations/idlharness-expected.txt:

Source/WebCore:

* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::enqueueDOMEvent):
* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):
(WebCore::AnimationEvent::pseudoElement const):
* dom/AnimationEvent.h:
* dom/AnimationEvent.idl:
* dom/WebKitAnimationEvent.cpp:
(WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
(WebCore::WebKitAnimationEvent::pseudoElement const):
* dom/WebKitAnimationEvent.h:
* dom/WebKitAnimationEvent.idl:
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (251839 => 251840)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-10-31 12:43:37 UTC (rev 251840)
@@ -1,5 +1,19 @@
 2019-10-31  Antoine Quint  <[email protected]>
 
+        [Web Animations] Add support for AnimationEvent.pseudoElement
+        https://bugs.webkit.org/show_bug.cgi?id=203671
+
+        Reviewed by Dean Jackson.
+
+        Mark WPT progressions.
+
+        * web-platform-tests/css/css-animations/animationevent-interface-expected.txt:
+        * web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt:
+        * web-platform-tests/css/css-animations/animationevent-types-expected.txt:
+        * web-platform-tests/css/css-animations/idlharness-expected.txt:
+
+2019-10-31  Antoine Quint  <[email protected]>
+
         [Web Animations] transform property is always "none" for getKeyframes() output of a CSS Animation
         https://bugs.webkit.org/show_bug.cgi?id=203669
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-interface-expected.txt (251839 => 251840)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-interface-expected.txt	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-interface-expected.txt	2019-10-31 12:43:37 UTC (rev 251840)
@@ -12,7 +12,7 @@
 PASS animationEventInit argument is null 
 PASS animationEventInit argument is undefined 
 PASS animationEventInit argument is empty dictionary 
-FAIL AnimationEvent.pseudoElement initialized from the dictionary assert_equals: expected (string) "::testPseudo" but got (undefined) undefined
+PASS AnimationEvent.pseudoElement initialized from the dictionary 
 PASS animationName set to 'sample' 
 PASS animationName set to undefined 
 PASS animationName set to null 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt (251839 => 251840)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt	2019-10-31 12:43:37 UTC (rev 251840)
@@ -1,3 +1,3 @@
 
-FAIL AnimationEvent should have the correct pseudoElement memeber assert_equals: expected (string) "::before" but got (undefined) undefined
+PASS AnimationEvent should have the correct pseudoElement memeber 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-types-expected.txt (251839 => 251840)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-types-expected.txt	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-types-expected.txt	2019-10-31 12:43:37 UTC (rev 251840)
@@ -1,6 +1,6 @@
 Filler Text
 
-FAIL animationstart event is instanceof AnimationEvent assert_idl_attribute: animationstart has pseudoElement property property "pseudoElement" not found in prototype chain
-FAIL animationend event is instanceof AnimationEvent assert_idl_attribute: animationstart has pseudoElement property property "pseudoElement" not found in prototype chain
-FAIL animationiteration event is instanceof AnimationEvent assert_idl_attribute: animationstart has pseudoElement property property "pseudoElement" not found in prototype chain
+PASS animationstart event is instanceof AnimationEvent 
+PASS animationend event is instanceof AnimationEvent 
+PASS animationiteration event is instanceof AnimationEvent 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/idlharness-expected.txt (251839 => 251840)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/idlharness-expected.txt	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/idlharness-expected.txt	2019-10-31 12:43:37 UTC (rev 251840)
@@ -10,12 +10,12 @@
 PASS AnimationEvent interface: existence and properties of interface prototype object's @@unscopables property 
 PASS AnimationEvent interface: attribute animationName 
 PASS AnimationEvent interface: attribute elapsedTime 
-FAIL AnimationEvent interface: attribute pseudoElement assert_true: The prototype object must have a property "pseudoElement" expected true got false
+PASS AnimationEvent interface: attribute pseudoElement 
 PASS AnimationEvent must be primary interface of new AnimationEvent("animationstart") 
 PASS Stringification of new AnimationEvent("animationstart") 
 PASS AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "animationName" with the proper type 
 PASS AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "elapsedTime" with the proper type 
-FAIL AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "pseudoElement" with the proper type assert_inherits: property "pseudoElement" not found in prototype chain
+PASS AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "pseudoElement" with the proper type 
 PASS CSSKeyframeRule interface: existence and properties of interface object 
 PASS CSSKeyframeRule interface object length 
 PASS CSSKeyframeRule interface object name 

Modified: trunk/Source/WebCore/ChangeLog (251839 => 251840)


--- trunk/Source/WebCore/ChangeLog	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/ChangeLog	2019-10-31 12:43:37 UTC (rev 251840)
@@ -1,5 +1,27 @@
 2019-10-31  Antoine Quint  <[email protected]>
 
+        [Web Animations] Add support for AnimationEvent.pseudoElement
+        https://bugs.webkit.org/show_bug.cgi?id=203671
+
+        Reviewed by Dean Jackson.
+
+        * animation/DeclarativeAnimation.cpp:
+        (WebCore::DeclarativeAnimation::enqueueDOMEvent):
+        * dom/AnimationEvent.cpp:
+        (WebCore::AnimationEvent::AnimationEvent):
+        (WebCore::AnimationEvent::pseudoElement const):
+        * dom/AnimationEvent.h:
+        * dom/AnimationEvent.idl:
+        * dom/WebKitAnimationEvent.cpp:
+        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
+        (WebCore::WebKitAnimationEvent::pseudoElement const):
+        * dom/WebKitAnimationEvent.h:
+        * dom/WebKitAnimationEvent.idl:
+        * page/animation/CSSAnimationController.cpp:
+        (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
+
+2019-10-31  Antoine Quint  <[email protected]>
+
         [Web Animations] transform property is always "none" for getKeyframes() output of a CSS Animation
         https://bugs.webkit.org/show_bug.cgi?id=203669
 

Modified: trunk/Source/WebCore/animation/DeclarativeAnimation.cpp (251839 => 251840)


--- trunk/Source/WebCore/animation/DeclarativeAnimation.cpp	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/animation/DeclarativeAnimation.cpp	2019-10-31 12:43:37 UTC (rev 251840)
@@ -341,7 +341,7 @@
     ASSERT(m_owningElement);
     auto time = secondsToWebAnimationsAPITime(elapsedTime) / 1000;
     if (is<CSSAnimation>(this))
-        m_eventQueue->enqueueEvent(AnimationEvent::create(eventType, downcast<CSSAnimation>(this)->animationName(), time));
+        m_eventQueue->enqueueEvent(AnimationEvent::create(eventType, downcast<CSSAnimation>(this)->animationName(), time, PseudoElement::pseudoElementNameForEvents(m_owningElement->pseudoId())));
     else if (is<CSSTransition>(this))
         m_eventQueue->enqueueEvent(TransitionEvent::create(eventType, downcast<CSSTransition>(this)->transitionProperty(), time, PseudoElement::pseudoElementNameForEvents(m_owningElement->pseudoId())));
 }

Modified: trunk/Source/WebCore/dom/AnimationEvent.cpp (251839 => 251840)


--- trunk/Source/WebCore/dom/AnimationEvent.cpp	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/dom/AnimationEvent.cpp	2019-10-31 12:43:37 UTC (rev 251840)
@@ -36,13 +36,15 @@
     : Event(type, initializer, isTrusted)
     , m_animationName(initializer.animationName)
     , m_elapsedTime(initializer.elapsedTime)
+    , m_pseudoElement(initializer.pseudoElement)
 {
 }
 
-AnimationEvent::AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime)
+AnimationEvent::AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
     : Event(type, CanBubble::Yes, IsCancelable::No)
     , m_animationName(animationName)
     , m_elapsedTime(elapsedTime)
+    , m_pseudoElement(pseudoElement)
 {
 }
 
@@ -58,6 +60,11 @@
     return m_elapsedTime;
 }
 
+const String& AnimationEvent::pseudoElement() const
+{
+    return m_pseudoElement;
+}
+
 EventInterface AnimationEvent::eventInterface() const
 {
     return AnimationEventInterfaceType;

Modified: trunk/Source/WebCore/dom/AnimationEvent.h (251839 => 251840)


--- trunk/Source/WebCore/dom/AnimationEvent.h	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/dom/AnimationEvent.h	2019-10-31 12:43:37 UTC (rev 251840)
@@ -32,14 +32,15 @@
 class AnimationEvent final : public Event {
     WTF_MAKE_ISO_ALLOCATED(AnimationEvent);
 public:
-    static Ref<AnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime)
+    static Ref<AnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
     {
-        return adoptRef(*new AnimationEvent(type, animationName, elapsedTime));
+        return adoptRef(*new AnimationEvent(type, animationName, elapsedTime, pseudoElement));
     }
 
     struct Init : EventInit {
         String animationName;
         double elapsedTime { 0 };
+        String pseudoElement;
     };
 
     static Ref<AnimationEvent> create(const AtomString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
@@ -51,15 +52,17 @@
 
     const String& animationName() const;
     double elapsedTime() const;
+    const String& pseudoElement() const;
 
     EventInterface eventInterface() const override;
 
 private:
-    AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime);
+    AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement);
     AnimationEvent(const AtomString&, const Init&, IsTrusted);
 
     String m_animationName;
     double m_elapsedTime;
+    String m_pseudoElement;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/AnimationEvent.idl (251839 => 251840)


--- trunk/Source/WebCore/dom/AnimationEvent.idl	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/dom/AnimationEvent.idl	2019-10-31 12:43:37 UTC (rev 251840)
@@ -28,16 +28,12 @@
 ] interface AnimationEvent : Event {
     readonly attribute DOMString animationName;
     readonly attribute double elapsedTime;
-
-    // FIXME: This is not supported yet.
-    // readonly attribute DOMString pseudoElement;
+    readonly attribute DOMString pseudoElement;
 };
 
 dictionary AnimationEventInit : EventInit {
     DOMString animationName = "";
     double elapsedTime = 0.0;
-
-    // FIXME: This is not supported yet.
-    // DOMString pseudoElement = "";
+    DOMString pseudoElement = "";
 };
 

Modified: trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp (251839 => 251840)


--- trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp	2019-10-31 12:43:37 UTC (rev 251840)
@@ -36,13 +36,15 @@
     : Event(type, initializer, isTrusted)
     , m_animationName(initializer.animationName)
     , m_elapsedTime(initializer.elapsedTime)
+    , m_pseudoElement(initializer.pseudoElement)
 {
 }
 
-WebKitAnimationEvent::WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime)
+WebKitAnimationEvent::WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
     : Event(type, CanBubble::Yes, IsCancelable::Yes)
     , m_animationName(animationName)
     , m_elapsedTime(elapsedTime)
+    , m_pseudoElement(pseudoElement)
 {
 }
 
@@ -58,6 +60,11 @@
     return m_elapsedTime;
 }
 
+const String& WebKitAnimationEvent::pseudoElement() const
+{
+    return m_pseudoElement;
+}
+
 EventInterface WebKitAnimationEvent::eventInterface() const
 {
     return WebKitAnimationEventInterfaceType;

Modified: trunk/Source/WebCore/dom/WebKitAnimationEvent.h (251839 => 251840)


--- trunk/Source/WebCore/dom/WebKitAnimationEvent.h	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/dom/WebKitAnimationEvent.h	2019-10-31 12:43:37 UTC (rev 251840)
@@ -32,14 +32,15 @@
 class WebKitAnimationEvent final : public Event {
     WTF_MAKE_ISO_ALLOCATED(WebKitAnimationEvent);
 public:
-    static Ref<WebKitAnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime)
+    static Ref<WebKitAnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
     {
-        return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime));
+        return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime, pseudoElement));
     }
 
     struct Init : EventInit {
         String animationName;
         double elapsedTime { 0.0 };
+        String pseudoElement;
     };
 
     static Ref<WebKitAnimationEvent> create(const AtomString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
@@ -51,15 +52,17 @@
 
     const String& animationName() const;
     double elapsedTime() const;
+    const String& pseudoElement() const;
 
     EventInterface eventInterface() const override;
 
 private:
-    WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime);
+    WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement);
     WebKitAnimationEvent(const AtomString&, const Init&, IsTrusted);
 
     String m_animationName;
     double m_elapsedTime;
+    String m_pseudoElement;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/WebKitAnimationEvent.idl (251839 => 251840)


--- trunk/Source/WebCore/dom/WebKitAnimationEvent.idl	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/dom/WebKitAnimationEvent.idl	2019-10-31 12:43:37 UTC (rev 251840)
@@ -28,9 +28,11 @@
 ] interface WebKitAnimationEvent : Event {
     readonly attribute DOMString animationName;
     readonly attribute double elapsedTime;
+    readonly attribute DOMString pseudoElement;
 };
 
 dictionary WebKitAnimationEventInit : EventInit {
     DOMString animationName = "";
     double elapsedTime = 0;
+    DOMString pseudoElement = "";
 };

Modified: trunk/Source/WebCore/page/animation/CSSAnimationController.cpp (251839 => 251840)


--- trunk/Source/WebCore/page/animation/CSSAnimationController.cpp	2019-10-31 12:42:55 UTC (rev 251839)
+++ trunk/Source/WebCore/page/animation/CSSAnimationController.cpp	2019-10-31 12:43:37 UTC (rev 251840)
@@ -227,7 +227,7 @@
         if (event.eventType == eventNames().transitionendEvent)
             element.dispatchEvent(TransitionEvent::create(event.eventType, event.name, event.elapsedTime, PseudoElement::pseudoElementNameForEvents(element.pseudoId())));
         else
-            element.dispatchEvent(AnimationEvent::create(event.eventType, event.name, event.elapsedTime));
+            element.dispatchEvent(AnimationEvent::create(event.eventType, event.name, event.elapsedTime, PseudoElement::pseudoElementNameForEvents(element.pseudoId())));
     }
 
     for (auto& change : m_elementChangesToDispatch)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to