Changeset 97225 in webkit


Ignore:
Timestamp:
Oct 11, 2011 9:05:11 PM (13 years ago)
Author:
haraken@chromium.org
Message:

Implement a WebKitTransitionEvent constructor for JSC
https://bugs.webkit.org/show_bug.cgi?id=69829

Reviewed by Adam Barth.

Source/WebCore:

There is no spec for the WebKitTransitionEvent constructor
since it is WebKit-specific. However, judging from the current
IDL of initWebKitTransitionEvent(), the constructor IDL
should be as follows.

[Constructor(DOMString type, optional WebKitTransitionEventInit eventInitDict)]
interface WebKitTransitionEvent : Event {

...;

}

dictionary WebKitTransitionEventInit : EventInit {

DOMString propertyName;
double elapsedTime;

}

Test: fast/events/constructors/webkit-transition-event-constructor.html

  • bindings/generic/EventConstructors.h: Added a definition for the WebKitTransitionEvent constructor.
  • bindings/js/JSEventConstructors.cpp: Added #includes for WebKitTransitionEvent.
  • dom/WebKitTransitionEvent.cpp:

(WebCore::WebKitTransitionEventInit::WebKitTransitionEventInit):
(WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
(WebCore::WebKitTransitionEvent::initWebKitTransitionEvent):

  • dom/WebKitTransitionEvent.h: Added a definition for WebKitTransitionEventInit.

(WebCore::WebKitTransitionEvent::create):
(WebCore::WebKitTransitionEvent::isWebKitTransitionEvent):

  • dom/WebKitTransitionEvent.idl: Makes WebKitTransitionEvent constructible.

LayoutTests:

webkit-transition-event-constructor.html checks the behavior of the WebKitTransitionEvent constructor.

  • fast/dom/constructed-objects-prototypes-expected.txt:
  • fast/events/constructors/webkit-transition-event-constructor-expected.txt: Added.
  • fast/events/constructors/webkit-transition-event-constructor.html: Added.
  • platform/chromium/test_expectations.txt: Skipped webkit-transition-event-constructor.html, since V8 does not yet have the WebKitTransitionEvent constructor.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r97224 r97225  
     12011-10-11  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement a WebKitTransitionEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=69829
     5
     6        Reviewed by Adam Barth.
     7
     8        webkit-transition-event-constructor.html checks the behavior of the WebKitTransitionEvent constructor.
     9
     10        * fast/dom/constructed-objects-prototypes-expected.txt:
     11        * fast/events/constructors/webkit-transition-event-constructor-expected.txt: Added.
     12        * fast/events/constructors/webkit-transition-event-constructor.html: Added.
     13        * platform/chromium/test_expectations.txt: Skipped webkit-transition-event-constructor.html, since V8 does not yet have the WebKitTransitionEvent constructor.
     14
    1152011-10-11  Sameer Patil  <mkrp87@motorola.com>
    216
  • trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt

    r96179 r97225  
    3636PASS (new inner.WebKitAnimationEvent()).isInner is true
    3737PASS (new inner.WebKitAnimationEvent()).constructor.isInner is true
     38PASS (new inner.WebKitTransitionEvent()).isInner is true
     39PASS (new inner.WebKitTransitionEvent()).constructor.isInner is true
    3840PASS (new inner.WebKitCSSMatrix()).isInner is true
    3941PASS (new inner.WebKitCSSMatrix()).constructor.isInner is true
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r97209 r97225  
    8383// Tests for WebVTT parser for <track>.  Feature is not yet functional.
    8484BUGWK43668 SKIP : media/track/ = TIMEOUT
     85
     86// This will soon be fixed after implementing a WebKitTransitionEvent constructor for V8.
     87BUGWK69829 : fast/events/constructors/webkit-transition-event-constructor.html = FAIL
    8588
    8689// Tests for MediaSource API. Feature is not yet functional.
  • trunk/Source/WebCore/ChangeLog

    r97224 r97225  
     12011-10-11  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement a WebKitTransitionEvent constructor for JSC
     4        https://bugs.webkit.org/show_bug.cgi?id=69829
     5
     6        Reviewed by Adam Barth.
     7
     8        There is no spec for the WebKitTransitionEvent constructor
     9        since it is WebKit-specific. However, judging from the current
     10        IDL of initWebKitTransitionEvent(), the constructor IDL
     11        should be as follows.
     12
     13        [Constructor(DOMString type, optional WebKitTransitionEventInit eventInitDict)]
     14        interface WebKitTransitionEvent : Event {
     15            ...;
     16        }
     17
     18        dictionary WebKitTransitionEventInit : EventInit {
     19            DOMString propertyName;
     20            double elapsedTime;
     21        }
     22
     23        Test: fast/events/constructors/webkit-transition-event-constructor.html
     24
     25        * bindings/generic/EventConstructors.h: Added a definition for the WebKitTransitionEvent constructor.
     26        * bindings/js/JSEventConstructors.cpp: Added #includes for WebKitTransitionEvent.
     27        * dom/WebKitTransitionEvent.cpp:
     28        (WebCore::WebKitTransitionEventInit::WebKitTransitionEventInit):
     29        (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
     30        (WebCore::WebKitTransitionEvent::initWebKitTransitionEvent):
     31        * dom/WebKitTransitionEvent.h: Added a definition for WebKitTransitionEventInit.
     32        (WebCore::WebKitTransitionEvent::create):
     33        (WebCore::WebKitTransitionEvent::isWebKitTransitionEvent):
     34        * dom/WebKitTransitionEvent.idl: Makes WebKitTransitionEvent constructible.
     35
    1362011-10-11  Sameer Patil  <mkrp87@motorola.com>
    237
  • trunk/Source/WebCore/bindings/generic/EventConstructors.h

    r96179 r97225  
    111111    DICTIONARY_END(MessageEvent)
    112112
     113#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     114    \
     115    DICTIONARY_START(WebKitTransitionEvent) \
     116        FILL_PARENT_PROPERTIES(Event) \
     117        FILL_PROPERTY(propertyName) \
     118        FILL_PROPERTY(elapsedTime) \
     119    DICTIONARY_END(WebKitTransitionEvent)
     120
    113121
    114122#define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     
    123131    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CLOSE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    124132    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_MESSAGE_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     133    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_TRANSITION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
    125134
    126135} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp

    r96179 r97225  
    4343#include "JSProgressEvent.h"
    4444#include "JSWebKitAnimationEvent.h"
     45#include "JSWebKitTransitionEvent.h"
    4546#include "MessageEvent.h"
    4647#include "PageTransitionEvent.h"
     
    4849#include "ProgressEvent.h"
    4950#include "WebKitAnimationEvent.h"
     51#include "WebKitTransitionEvent.h"
    5052#include <runtime/Error.h>
    5153
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.cpp

    r95901 r97225  
    3030
    3131namespace WebCore {
    32        
     32
     33WebKitTransitionEventInit::WebKitTransitionEventInit()
     34    : propertyName()
     35    , elapsedTime(0)
     36{
     37}
     38
    3339WebKitTransitionEvent::WebKitTransitionEvent()
    3440    : m_propertyName()
    35     , m_elapsedTime(0.0)
     41    , m_elapsedTime(0)
    3642{
    3743}
     
    4147    , m_propertyName(propertyName)
    4248    , m_elapsedTime(elapsedTime)
     49{
     50}
     51
     52WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const WebKitTransitionEventInit& initializer)
     53    : Event(type, initializer)
     54    , m_propertyName(initializer.propertyName)
     55    , m_elapsedTime(initializer.elapsedTime)
    4356{
    4457}
     
    5669    if (dispatched())
    5770        return;
    58    
     71
    5972    initEvent(type, canBubbleArg, cancelableArg);
    60    
     73
    6174    m_propertyName = propertyName;
    6275    m_elapsedTime = elapsedTime;
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.h

    r95901 r97225  
    3030
    3131namespace WebCore {
    32        
    33     class WebKitTransitionEvent : public Event {
    34     public:
    35         static PassRefPtr<WebKitTransitionEvent> create()
    36         {
    37             return adoptRef(new WebKitTransitionEvent);
    38         }
    39         static PassRefPtr<WebKitTransitionEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
    40         {
    41             return adoptRef(new WebKitTransitionEvent(type, animationName, elapsedTime));
    42         }
    4332
    44         virtual ~WebKitTransitionEvent();
    45        
    46         void initWebKitTransitionEvent(const AtomicString& type,
    47                                 bool canBubbleArg,
    48                                 bool cancelableArg,
    49                                 const String& propertyName,
    50                                 double elapsedTime);
    51                        
    52         const String& propertyName() const;
    53         double elapsedTime() const;
    54        
    55         virtual bool isWebKitTransitionEvent() const { return true; }
    56        
    57     private:
    58         WebKitTransitionEvent();
    59         WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime);
     33struct WebKitTransitionEventInit : public EventInit {
     34    WebKitTransitionEventInit();
    6035
    61         String m_propertyName;
    62         double m_elapsedTime;
    63     };
    64    
     36    String propertyName;
     37    double elapsedTime;
     38};
     39
     40class WebKitTransitionEvent : public Event {
     41public:
     42    static PassRefPtr<WebKitTransitionEvent> create()
     43    {
     44        return adoptRef(new WebKitTransitionEvent);
     45    }
     46    static PassRefPtr<WebKitTransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime)
     47    {
     48        return adoptRef(new WebKitTransitionEvent(type, propertyName, elapsedTime));
     49    }
     50    static PassRefPtr<WebKitTransitionEvent> create(const AtomicString& type, const WebKitTransitionEventInit& initializer)
     51    {
     52        return adoptRef(new WebKitTransitionEvent(type, initializer));
     53    }
     54
     55    virtual ~WebKitTransitionEvent();
     56
     57    void initWebKitTransitionEvent(const AtomicString& type,
     58                                   bool canBubbleArg,
     59                                   bool cancelableArg,
     60                                   const String& propertyName,
     61                                   double elapsedTime);
     62
     63    const String& propertyName() const;
     64    double elapsedTime() const;
     65
     66    virtual bool isWebKitTransitionEvent() const { return true; }
     67
     68private:
     69    WebKitTransitionEvent();
     70    WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime);
     71    WebKitTransitionEvent(const AtomicString& type, const WebKitTransitionEventInit& initializer);
     72
     73    String m_propertyName;
     74    double m_elapsedTime;
     75};
     76
    6577} // namespace WebCore
    6678
  • trunk/Source/WebCore/dom/WebKitTransitionEvent.idl

    r91617 r97225  
    2626module events {
    2727
    28     interface WebKitTransitionEvent : Event {
    29      readonly attribute DOMString          propertyName;
    30      readonly attribute double             elapsedTime;
    31      void               initWebKitTransitionEvent(in [Optional=CallWithDefaultValue] DOMString typeArg,
    32                                            in [Optional=CallWithDefaultValue] boolean canBubbleArg,
    33                                            in [Optional=CallWithDefaultValue] boolean cancelableArg,
    34                                            in [Optional=CallWithDefaultValue] DOMString propertyNameArg,
    35                                            in [Optional=CallWithDefaultValue] double elapsedTimeArg);
     28    interface [
     29        CanBeConstructed,
     30        JSCustomConstructor
     31    ] WebKitTransitionEvent : Event {
     32    readonly attribute DOMString          propertyName;
     33    readonly attribute double             elapsedTime;
     34    void               initWebKitTransitionEvent(in [Optional=CallWithDefaultValue] DOMString typeArg,
     35                                                 in [Optional=CallWithDefaultValue] boolean canBubbleArg,
     36                                                 in [Optional=CallWithDefaultValue] boolean cancelableArg,
     37                                                 in [Optional=CallWithDefaultValue] DOMString propertyNameArg,
     38                                                 in [Optional=CallWithDefaultValue] double elapsedTimeArg);
    3639};
    3740
Note: See TracChangeset for help on using the changeset viewer.