Changeset 207188 in webkit


Ignore:
Timestamp:
Oct 11, 2016 9:48:13 PM (7 years ago)
Author:
Chris Dumez
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:

  • dom/AnimationEvent.cpp:

(WebCore::AnimationEvent::AnimationEvent):

  • dom/AnimationEvent.h:
  • dom/AnimationEvent.idl:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207187 r207188  
     12016-10-11  Chris Dumez  <cdumez@apple.com>
     2
     3        Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
     4        https://bugs.webkit.org/show_bug.cgi?id=163312
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Update AnimationEvent to stop using legacy [ConstructorTemplate=Event]
     9        and use a regular constructor as in the specification:
     10        - https://drafts.csswg.org/css-animations/#interface-animationevent
     11
     12        * dom/AnimationEvent.cpp:
     13        (WebCore::AnimationEvent::AnimationEvent):
     14        * dom/AnimationEvent.h:
     15        * dom/AnimationEvent.idl:
     16
    1172016-10-11  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/dom/AnimationEvent.cpp

    r198837 r207188  
    3131namespace WebCore {
    3232
    33 AnimationEvent::AnimationEvent(const AtomicString& type, const AnimationEventInit& initializer)
    34     : Event(type, initializer)
     33AnimationEvent::AnimationEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
     34    : Event(type, initializer, isTrusted)
    3535    , m_animationName(initializer.animationName)
    3636    , m_elapsedTime(initializer.elapsedTime)
  • trunk/Source/WebCore/dom/AnimationEvent.h

    r197563 r207188  
    3131namespace WebCore {
    3232
    33 struct AnimationEventInit : public EventInit {
    34     String animationName;
    35     double elapsedTime { 0 };
    36 };
    37 
    3833class AnimationEvent final : public Event {
    3934public:
     
    4338    }
    4439
    45     static Ref<AnimationEvent> createForBindings(const AtomicString& type, const AnimationEventInit& initializer)
     40    struct Init : EventInit {
     41        String animationName;
     42        double elapsedTime { 0 };
     43    };
     44
     45    static Ref<AnimationEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
    4646    {
    47         return adoptRef(*new AnimationEvent(type, initializer));
     47        return adoptRef(*new AnimationEvent(type, initializer, isTrusted));
    4848    }
    4949
     
    5757private:
    5858    AnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
    59     AnimationEvent(const AtomicString&, const AnimationEventInit&);
     59    AnimationEvent(const AtomicString&, const Init&, IsTrusted);
    6060
    6161    String m_animationName;
  • trunk/Source/WebCore/dom/AnimationEvent.idl

    r176423 r207188  
    2525
    2626[
    27     ConstructorTemplate=Event
     27    Constructor(DOMString type, optional AnimationEventInit animationEventInitDict),
    2828] interface AnimationEvent : Event {
    29     [InitializedByEventConstructor] readonly attribute DOMString animationName;
    30     [InitializedByEventConstructor] readonly attribute unrestricted double elapsedTime;
     29    readonly attribute DOMString animationName;
     30    readonly attribute double elapsedTime;
     31
     32    // FIXME: This is not supported yet.
     33    // readonly attribute DOMString pseudoElement;
    3134};
    3235
     36dictionary AnimationEventInit : EventInit {
     37    DOMString animationName = "";
     38    double elapsedTime = 0.0;
     39
     40    // FIXME: This is not supported yet.
     41    // DOMString pseudoElement = "";
     42};
     43
Note: See TracChangeset for help on using the changeset viewer.