Changeset 251840 in webkit


Ignore:
Timestamp:
Oct 31, 2019 5:43:37 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Antoine Quint <Antoine Quint> 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):

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r251839 r251840  
     12019-10-31  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Add support for AnimationEvent.pseudoElement
     4        https://bugs.webkit.org/show_bug.cgi?id=203671
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-animations/animationevent-interface-expected.txt:
     11        * web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt:
     12        * web-platform-tests/css/css-animations/animationevent-types-expected.txt:
     13        * web-platform-tests/css/css-animations/idlharness-expected.txt:
     14
    1152019-10-31  Antoine Quint  <graouts@apple.com>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-interface-expected.txt

    r251591 r251840  
    1313PASS animationEventInit argument is undefined
    1414PASS animationEventInit argument is empty dictionary
    15 FAIL AnimationEvent.pseudoElement initialized from the dictionary assert_equals: expected (string) "::testPseudo" but got (undefined) undefined
     15PASS AnimationEvent.pseudoElement initialized from the dictionary
    1616PASS animationName set to 'sample'
    1717PASS animationName set to undefined
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-pseudoelement-expected.txt

    r232288 r251840  
    11
    2 FAIL AnimationEvent should have the correct pseudoElement memeber assert_equals: expected (string) "::before" but got (undefined) undefined
     2PASS AnimationEvent should have the correct pseudoElement memeber
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animationevent-types-expected.txt

    r232288 r251840  
    11Filler Text
    22
    3 FAIL animationstart event is instanceof AnimationEvent assert_idl_attribute: animationstart has pseudoElement property property "pseudoElement" not found in prototype chain
    4 FAIL animationend event is instanceof AnimationEvent assert_idl_attribute: animationstart has pseudoElement property property "pseudoElement" not found in prototype chain
    5 FAIL animationiteration event is instanceof AnimationEvent assert_idl_attribute: animationstart has pseudoElement property property "pseudoElement" not found in prototype chain
     3PASS animationstart event is instanceof AnimationEvent
     4PASS animationend event is instanceof AnimationEvent
     5PASS animationiteration event is instanceof AnimationEvent
    66
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/idlharness-expected.txt

    r251591 r251840  
    1111PASS AnimationEvent interface: attribute animationName
    1212PASS AnimationEvent interface: attribute elapsedTime
    13 FAIL AnimationEvent interface: attribute pseudoElement assert_true: The prototype object must have a property "pseudoElement" expected true got false
     13PASS AnimationEvent interface: attribute pseudoElement
    1414PASS AnimationEvent must be primary interface of new AnimationEvent("animationstart")
    1515PASS Stringification of new AnimationEvent("animationstart")
    1616PASS AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "animationName" with the proper type
    1717PASS AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "elapsedTime" with the proper type
    18 FAIL AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "pseudoElement" with the proper type assert_inherits: property "pseudoElement" not found in prototype chain
     18PASS AnimationEvent interface: new AnimationEvent("animationstart") must inherit property "pseudoElement" with the proper type
    1919PASS CSSKeyframeRule interface: existence and properties of interface object
    2020PASS CSSKeyframeRule interface object length
  • trunk/Source/WebCore/ChangeLog

    r251839 r251840  
     12019-10-31  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Add support for AnimationEvent.pseudoElement
     4        https://bugs.webkit.org/show_bug.cgi?id=203671
     5
     6        Reviewed by Dean Jackson.
     7
     8        * animation/DeclarativeAnimation.cpp:
     9        (WebCore::DeclarativeAnimation::enqueueDOMEvent):
     10        * dom/AnimationEvent.cpp:
     11        (WebCore::AnimationEvent::AnimationEvent):
     12        (WebCore::AnimationEvent::pseudoElement const):
     13        * dom/AnimationEvent.h:
     14        * dom/AnimationEvent.idl:
     15        * dom/WebKitAnimationEvent.cpp:
     16        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
     17        (WebCore::WebKitAnimationEvent::pseudoElement const):
     18        * dom/WebKitAnimationEvent.h:
     19        * dom/WebKitAnimationEvent.idl:
     20        * page/animation/CSSAnimationController.cpp:
     21        (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
     22
    1232019-10-31  Antoine Quint  <graouts@apple.com>
    224
  • trunk/Source/WebCore/animation/DeclarativeAnimation.cpp

    r251742 r251840  
    342342    auto time = secondsToWebAnimationsAPITime(elapsedTime) / 1000;
    343343    if (is<CSSAnimation>(this))
    344         m_eventQueue->enqueueEvent(AnimationEvent::create(eventType, downcast<CSSAnimation>(this)->animationName(), time));
     344        m_eventQueue->enqueueEvent(AnimationEvent::create(eventType, downcast<CSSAnimation>(this)->animationName(), time, PseudoElement::pseudoElementNameForEvents(m_owningElement->pseudoId())));
    345345    else if (is<CSSTransition>(this))
    346346        m_eventQueue->enqueueEvent(TransitionEvent::create(eventType, downcast<CSSTransition>(this)->transitionProperty(), time, PseudoElement::pseudoElementNameForEvents(m_owningElement->pseudoId())));
  • trunk/Source/WebCore/dom/AnimationEvent.cpp

    r250060 r251840  
    3737    , m_animationName(initializer.animationName)
    3838    , m_elapsedTime(initializer.elapsedTime)
     39    , m_pseudoElement(initializer.pseudoElement)
    3940{
    4041}
    4142
    42 AnimationEvent::AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime)
     43AnimationEvent::AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
    4344    : Event(type, CanBubble::Yes, IsCancelable::No)
    4445    , m_animationName(animationName)
    4546    , m_elapsedTime(elapsedTime)
     47    , m_pseudoElement(pseudoElement)
    4648{
    4749}
     
    5961}
    6062
     63const String& AnimationEvent::pseudoElement() const
     64{
     65    return m_pseudoElement;
     66}
     67
    6168EventInterface AnimationEvent::eventInterface() const
    6269{
  • trunk/Source/WebCore/dom/AnimationEvent.h

    r250060 r251840  
    3333    WTF_MAKE_ISO_ALLOCATED(AnimationEvent);
    3434public:
    35     static Ref<AnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime)
     35    static Ref<AnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
    3636    {
    37         return adoptRef(*new AnimationEvent(type, animationName, elapsedTime));
     37        return adoptRef(*new AnimationEvent(type, animationName, elapsedTime, pseudoElement));
    3838    }
    3939
     
    4141        String animationName;
    4242        double elapsedTime { 0 };
     43        String pseudoElement;
    4344    };
    4445
     
    5253    const String& animationName() const;
    5354    double elapsedTime() const;
     55    const String& pseudoElement() const;
    5456
    5557    EventInterface eventInterface() const override;
    5658
    5759private:
    58     AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime);
     60    AnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement);
    5961    AnimationEvent(const AtomString&, const Init&, IsTrusted);
    6062
    6163    String m_animationName;
    6264    double m_elapsedTime;
     65    String m_pseudoElement;
    6366};
    6467
  • trunk/Source/WebCore/dom/AnimationEvent.idl

    r207188 r251840  
    2929    readonly attribute DOMString animationName;
    3030    readonly attribute double elapsedTime;
    31 
    32     // FIXME: This is not supported yet.
    33     // readonly attribute DOMString pseudoElement;
     31    readonly attribute DOMString pseudoElement;
    3432};
    3533
     
    3735    DOMString animationName = "";
    3836    double elapsedTime = 0.0;
    39 
    40     // FIXME: This is not supported yet.
    41     // DOMString pseudoElement = "";
     37    DOMString pseudoElement = "";
    4238};
    4339
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp

    r250060 r251840  
    3737    , m_animationName(initializer.animationName)
    3838    , m_elapsedTime(initializer.elapsedTime)
     39    , m_pseudoElement(initializer.pseudoElement)
    3940{
    4041}
    4142
    42 WebKitAnimationEvent::WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime)
     43WebKitAnimationEvent::WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
    4344    : Event(type, CanBubble::Yes, IsCancelable::Yes)
    4445    , m_animationName(animationName)
    4546    , m_elapsedTime(elapsedTime)
     47    , m_pseudoElement(pseudoElement)
    4648{
    4749}
     
    5961}
    6062
     63const String& WebKitAnimationEvent::pseudoElement() const
     64{
     65    return m_pseudoElement;
     66}
     67
    6168EventInterface WebKitAnimationEvent::eventInterface() const
    6269{
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.h

    r250060 r251840  
    3333    WTF_MAKE_ISO_ALLOCATED(WebKitAnimationEvent);
    3434public:
    35     static Ref<WebKitAnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime)
     35    static Ref<WebKitAnimationEvent> create(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement)
    3636    {
    37         return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime));
     37        return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime, pseudoElement));
    3838    }
    3939
     
    4141        String animationName;
    4242        double elapsedTime { 0.0 };
     43        String pseudoElement;
    4344    };
    4445
     
    5253    const String& animationName() const;
    5354    double elapsedTime() const;
     55    const String& pseudoElement() const;
    5456
    5557    EventInterface eventInterface() const override;
    5658
    5759private:
    58     WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime);
     60    WebKitAnimationEvent(const AtomString& type, const String& animationName, double elapsedTime, const String& pseudoElement);
    5961    WebKitAnimationEvent(const AtomString&, const Init&, IsTrusted);
    6062
    6163    String m_animationName;
    6264    double m_elapsedTime;
     65    String m_pseudoElement;
    6366};
    6467
  • trunk/Source/WebCore/dom/WebKitAnimationEvent.idl

    r207215 r251840  
    2929    readonly attribute DOMString animationName;
    3030    readonly attribute double elapsedTime;
     31    readonly attribute DOMString pseudoElement;
    3132};
    3233
     
    3435    DOMString animationName = "";
    3536    double elapsedTime = 0;
     37    DOMString pseudoElement = "";
    3638};
  • trunk/Source/WebCore/page/animation/CSSAnimationController.cpp

    r251220 r251840  
    228228            element.dispatchEvent(TransitionEvent::create(event.eventType, event.name, event.elapsedTime, PseudoElement::pseudoElementNameForEvents(element.pseudoId())));
    229229        else
    230             element.dispatchEvent(AnimationEvent::create(event.eventType, event.name, event.elapsedTime));
     230            element.dispatchEvent(AnimationEvent::create(event.eventType, event.name, event.elapsedTime, PseudoElement::pseudoElementNameForEvents(element.pseudoId())));
    231231    }
    232232
Note: See TracChangeset for help on using the changeset viewer.