Title: [94861] trunk
Revision
94861
Author
rolandstei...@chromium.org
Date
2011-09-09 10:27:50 -0700 (Fri, 09 Sep 2011)

Log Message

Implement a WebKitAnimationEvent constructor.
https://bugs.webkit.org/show_bug.cgi?id=67825

Source/WebCore:

Patch by Kentaro Hara <hara...@google.com> on 2011-09-08
Reviewed by Sam Weinig.

There is no spec for the WebKitAnimationEvent constructor
since it is WebKit-specific. However, based on the current
IDL of initWebKitAnimationEvent(), the constructor IDL
should be as follows.

[Constructor(DOMString type, optional WebKitAnimationEventInit eventInitDict)]
interface WebKitAnimationEvent : Event {
    ...;
}

dictionary WebKitAnimationEventInit : EventInit {
    DOMString animationName;
    double elapsedTime;
}

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

* bindings/generic/EventConstructors.h: Added a definition for the WebKitAnimationEvent constructor.
* bindings/js/JSEventConstructors.cpp: Added #includes for WebKitAnimationEvent.
* dom/WebKitAnimationEvent.cpp:
(WebCore::WebKitAnimationEventInit::WebKitAnimationEventInit):
(WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
* dom/WebKitAnimationEvent.h: Added a definition for WebKitAnimationEventInit.
(WebCore::WebKitAnimationEvent::create):
* dom/WebKitAnimationEvent.idl: Makes WebKitAnimationEvent constructible.

LayoutTests:

Checks the behavior of the WebKitAnimationEvent constructor.

Patch by Kentaro Hara <hara...@google.com> on 2011-09-08
Reviewed by Sam Weinig.

* fast/dom/constructed-objects-prototypes-expected.txt:
* fast/events/constructors/webkit-animation-event-constructor-expected.txt: Added.
* fast/events/constructors/webkit-animation-event-constructor.html: Added.
* platform/chromium/test_expectations.txt: Skipped webkit-animation-event-constructor.html, since V8 does not yet have the WebKitAnimationEvent constructor.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94860 => 94861)


--- trunk/LayoutTests/ChangeLog	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/LayoutTests/ChangeLog	2011-09-09 17:27:50 UTC (rev 94861)
@@ -1,3 +1,17 @@
+2011-09-08  Kentaro Hara  <hara...@google.com>
+
+        Implement a WebKitAnimationEvent constructor.
+        https://bugs.webkit.org/show_bug.cgi?id=67825
+
+        Checks the behavior of the WebKitAnimationEvent constructor.
+
+        Reviewed by Sam Weinig.
+
+        * fast/dom/constructed-objects-prototypes-expected.txt:
+        * fast/events/constructors/webkit-animation-event-constructor-expected.txt: Added.
+        * fast/events/constructors/webkit-animation-event-constructor.html: Added.
+        * platform/chromium/test_expectations.txt: Skipped webkit-animation-event-constructor.html, since V8 does not yet have the WebKitAnimationEvent constructor.
+
 2011-09-09  Csaba Osztrogonác  <o...@webkit.org>
 
         [Qt] Unreviewed gardening after r94857. Add platform specific expected files.

Modified: trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt (94860 => 94861)


--- trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt	2011-09-09 17:27:50 UTC (rev 94861)
@@ -21,6 +21,8 @@
 PASS (new inner.Option()).constructor.isInner is true
 PASS (new inner.ProgressEvent()).isInner is true
 PASS (new inner.ProgressEvent()).constructor.isInner is true
+PASS (new inner.WebKitAnimationEvent()).isInner is true
+PASS (new inner.WebKitAnimationEvent()).constructor.isInner is true
 PASS (new inner.WebKitCSSMatrix()).isInner is true
 PASS (new inner.WebKitCSSMatrix()).constructor.isInner is true
 PASS (new inner.WebKitPoint()).isInner is true

Added: trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor-expected.txt (0 => 94861)


--- trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor-expected.txt	2011-09-09 17:27:50 UTC (rev 94861)
@@ -0,0 +1,52 @@
+This tests the constructor for the WebKitAnimationEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new WebKitAnimationEvent('eventType').bubbles is false
+PASS new WebKitAnimationEvent('eventType').cancelable is false
+PASS new WebKitAnimationEvent('eventType').animationName is ""
+PASS new WebKitAnimationEvent('eventType').elapsedTime is 0
+PASS new WebKitAnimationEvent('eventType', { bubbles: false }).bubbles is false
+PASS new WebKitAnimationEvent('eventType', { bubbles: true }).bubbles is true
+PASS new WebKitAnimationEvent('eventType', { cancelable: false }).cancelable is false
+PASS new WebKitAnimationEvent('eventType', { cancelable: true }).cancelable is true
+PASS new WebKitAnimationEvent('eventType', { animationName: 'doremi' }).animationName is "doremi"
+PASS new WebKitAnimationEvent('eventType', { animationName: '' }).animationName is ""
+PASS new WebKitAnimationEvent('eventType', { animationName: undefined }).animationName is "undefined"
+PASS new WebKitAnimationEvent('eventType', { animationName: null }).animationName is "null"
+PASS new WebKitAnimationEvent('eventType', { animationName: false }).animationName is "false"
+PASS new WebKitAnimationEvent('eventType', { animationName: true }).animationName is "true"
+PASS new WebKitAnimationEvent('eventType', { animationName: 12345 }).animationName is "12345"
+PASS new WebKitAnimationEvent('eventType', { animationName: 18446744073709551615 }).animationName is "18446744073709552000"
+PASS new WebKitAnimationEvent('eventType', { animationName: NaN }).animationName is "NaN"
+PASS new WebKitAnimationEvent('eventType', { animationName: [] }).animationName is ""
+PASS new WebKitAnimationEvent('eventType', { animationName: [1, 2, 3] }).animationName is "1,2,3"
+PASS new WebKitAnimationEvent('eventType', { animationName: {doremi: 12345} }).animationName is "[object Object]"
+PASS new WebKitAnimationEvent('eventType', { animationName: {valueOf: function () { return 'doremi'; } } }).animationName is "[object Object]"
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: 0 }).elapsedTime is 0
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: 123.45 }).elapsedTime is 123.45
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: -123.45 }).elapsedTime is -123.45
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime is 18446744073709551615
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: NaN }).elapsedTime is NaN
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: Infinity }).elapsedTime is Infinity
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: -Infinity }).elapsedTime is -Infinity
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: undefined }).elapsedTime is NaN
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: null }).elapsedTime is 0
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: false }).elapsedTime is 0
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: true }).elapsedTime is 1
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: '' }).elapsedTime is 0
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime is NaN
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: [] }).elapsedTime is 0
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: [123.45] }).elapsedTime is 123.45
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime is NaN
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime is NaN
+PASS new WebKitAnimationEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime is 123.45
+PASS new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).bubbles is true
+PASS new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).cancelable is true
+PASS new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).animationName is 'doremi'
+PASS new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).elapsedTime is 123.45
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor.html (0 => 94861)


--- trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/constructors/webkit-animation-event-constructor.html	2011-09-09 17:27:50 UTC (rev 94861)
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests the constructor for the WebKitAnimationEvent DOM class.");
+
+// No initializer is passed.
+shouldBe("new WebKitAnimationEvent('eventType').bubbles", "false");
+shouldBe("new WebKitAnimationEvent('eventType').cancelable", "false");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType').animationName", "");
+shouldBe("new WebKitAnimationEvent('eventType').elapsedTime", "0");
+
+// bubbles is passed.
+shouldBe("new WebKitAnimationEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new WebKitAnimationEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new WebKitAnimationEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new WebKitAnimationEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// animationName is passed.
+// Strings.
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: 'doremi' }).animationName", "doremi");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: '' }).animationName", "");
+
+// Non-strings.
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: undefined }).animationName", "undefined");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: null }).animationName", "null");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: false }).animationName", "false");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: true }).animationName", "true");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: 12345 }).animationName", "12345");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: 18446744073709551615 }).animationName", "18446744073709552000");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: NaN }).animationName", "NaN");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: [] }).animationName", "");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: [1, 2, 3] }).animationName", "1,2,3");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: {doremi: 12345} }).animationName", "[object Object]");
+shouldBeEqualToString("new WebKitAnimationEvent('eventType', { animationName: {valueOf: function () { return 'doremi'; } } }).animationName", "[object Object]");
+
+// elapsedTime is passed.
+// Numeric values.
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: 0 }).elapsedTime", "0");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: 123.45 }).elapsedTime", "123.45");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: -123.45 }).elapsedTime", "-123.45");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime", "18446744073709551615");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: NaN }).elapsedTime", "NaN");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "Infinity");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "-Infinity");
+
+// Non-numeric values.
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: undefined }).elapsedTime", "NaN");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: null }).elapsedTime", "0");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: false }).elapsedTime", "0");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: true }).elapsedTime", "1");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: '' }).elapsedTime", "0");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "NaN");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: [] }).elapsedTime", "0");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: [123.45] }).elapsedTime", "123.45");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "NaN");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "NaN");
+shouldBe("new WebKitAnimationEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime", "123.45");
+
+// All initializers are passed.
+shouldBe("new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).bubbles", "true");
+shouldBe("new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).cancelable", "true");
+shouldBe("new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).animationName", "'doremi'");
+shouldBe("new WebKitAnimationEvent('eventType', { bubbles: true, cancelable: true, animationName: 'doremi', elapsedTime: 123.45 }).elapsedTime", "123.45");
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (94860 => 94861)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-09-09 17:27:50 UTC (rev 94861)
@@ -63,6 +63,9 @@
 BUGWK60877 SKIP : loader/navigation-while-deferring-loads.html = FAIL
 BUGWK60877 SKIP : loader/load-defer-resume-crash.html = FAIL
 
+// This will soon be fixed after implementing a WebKitAnimationEvent constructor for V8.
+BUGWK67825 : fast/events/constructors/webkit-animation-event-constructor.html = FAIL
+
 // CSS3 Selectors3 test suite
 BUGCR89468 : css3/selectors3 = PASS FAIL
 

Modified: trunk/Source/WebCore/ChangeLog (94860 => 94861)


--- trunk/Source/WebCore/ChangeLog	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/Source/WebCore/ChangeLog	2011-09-09 17:27:50 UTC (rev 94861)
@@ -1,3 +1,36 @@
+2011-09-08  Kentaro Hara  <hara...@google.com>
+
+        Implement a WebKitAnimationEvent constructor.
+        https://bugs.webkit.org/show_bug.cgi?id=67825
+
+        Reviewed by Sam Weinig.
+
+        There is no spec for the WebKitAnimationEvent constructor
+        since it is WebKit-specific. However, based on the current
+        IDL of initWebKitAnimationEvent(), the constructor IDL
+        should be as follows.
+
+        [Constructor(DOMString type, optional WebKitAnimationEventInit eventInitDict)]
+        interface WebKitAnimationEvent : Event {
+            ...;
+        }
+
+        dictionary WebKitAnimationEventInit : EventInit {
+            DOMString animationName;
+            double elapsedTime;
+        }
+
+        Test: fast/events/constructors/webkit-animation-event-constructor.html
+
+        * bindings/generic/EventConstructors.h: Added a definition for the WebKitAnimationEvent constructor.
+        * bindings/js/JSEventConstructors.cpp: Added #includes for WebKitAnimationEvent.
+        * dom/WebKitAnimationEvent.cpp:
+        (WebCore::WebKitAnimationEventInit::WebKitAnimationEventInit):
+        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
+        * dom/WebKitAnimationEvent.h: Added a definition for WebKitAnimationEventInit.
+        (WebCore::WebKitAnimationEvent::create):
+        * dom/WebKitAnimationEvent.idl: Makes WebKitAnimationEvent constructible.
+
 2011-09-08  Abhishek Arya  <infe...@chromium.org>
 
         :before content rendering issues with list markers and run-ins.

Modified: trunk/Source/WebCore/bindings/generic/EventConstructors.h (94860 => 94861)


--- trunk/Source/WebCore/bindings/generic/EventConstructors.h	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/Source/WebCore/bindings/generic/EventConstructors.h	2011-09-09 17:27:50 UTC (rev 94861)
@@ -51,11 +51,20 @@
         FILL_PROPERTY(total) \
     DICTIONARY_END(ProgressEvent)
 
+#define INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_ANIMATION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
+    \
+    DICTIONARY_START(WebKitAnimationEvent) \
+        FILL_PARENT_PROPERTIES(Event) \
+        FILL_PROPERTY(animationName) \
+        FILL_PROPERTY(elapsedTime) \
+    DICTIONARY_END(WebKitAnimationEvent)
 
+
 #define INSTANTIATE_ALL_EVENT_INITIALIZING_CONSTRUCTORS(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_CUSTOM_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
     INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_PROGRESS_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
+    INSTANTIATE_INITIALIZING_CONSTRUCTOR_FOR_WEBKIT_ANIMATION_EVENT(DICTIONARY_START, DICTIONARY_END, FILL_PARENT_PROPERTIES, FILL_PROPERTY) \
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp (94860 => 94861)


--- trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/Source/WebCore/bindings/js/JSEventConstructors.cpp	2011-09-09 17:27:50 UTC (rev 94861)
@@ -32,7 +32,9 @@
 #include "JSDictionary.h"
 #include "JSEvent.h"
 #include "JSProgressEvent.h"
+#include "JSWebKitAnimationEvent.h"
 #include "ProgressEvent.h"
+#include "WebKitAnimationEvent.h"
 #include <runtime/Error.h>
 
 using namespace JSC;

Modified: trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp (94860 => 94861)


--- trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/Source/WebCore/dom/WebKitAnimationEvent.cpp	2011-09-09 17:27:50 UTC (rev 94861)
@@ -30,11 +30,24 @@
 
 namespace WebCore {
 
+WebKitAnimationEventInit::WebKitAnimationEventInit()
+    : animationName()
+    , elapsedTime(0.0)
+{
+}
+
 WebKitAnimationEvent::WebKitAnimationEvent()
     : m_elapsedTime(0.0)
 {
 }
 
+WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const WebKitAnimationEventInit& initializer)
+    : Event(type, initializer)
+    , m_animationName(initializer.animationName)
+    , m_elapsedTime(initializer.elapsedTime)
+{
+}
+
 WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime)
     : Event(type, true, true)
     , m_animationName(animationName)

Modified: trunk/Source/WebCore/dom/WebKitAnimationEvent.h (94860 => 94861)


--- trunk/Source/WebCore/dom/WebKitAnimationEvent.h	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/Source/WebCore/dom/WebKitAnimationEvent.h	2011-09-09 17:27:50 UTC (rev 94861)
@@ -29,39 +29,51 @@
 #include "Event.h"
 
 namespace WebCore {
-        
-    class WebKitAnimationEvent : public Event {
-    public:
-        static PassRefPtr<WebKitAnimationEvent> create()
-        {
-            return adoptRef(new WebKitAnimationEvent);
-        }
-        static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
-        {
-            return adoptRef(new WebKitAnimationEvent(type, animationName, elapsedTime));
-        }
 
-        virtual ~WebKitAnimationEvent();
-        
-        void initWebKitAnimationEvent(const AtomicString& type, 
-                                bool canBubbleArg,
-                                bool cancelableArg,
-                                const String& animationName,
-                                double elapsedTime);
-                        
-        const String& animationName() const;
-        double elapsedTime() const;
-        
-        virtual bool isWebKitAnimationEvent() const { return true; }
-        
-    private:
-        WebKitAnimationEvent();
-        WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
+struct WebKitAnimationEventInit : public EventInit {
+    WebKitAnimationEventInit();
 
-        String m_animationName;
-        double m_elapsedTime;
-    };
-    
+    String animationName;
+    double elapsedTime;
+};
+
+class WebKitAnimationEvent : public Event {
+public:
+    static PassRefPtr<WebKitAnimationEvent> create()
+    {
+        return adoptRef(new WebKitAnimationEvent);
+    }
+    static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
+    {
+        return adoptRef(new WebKitAnimationEvent(type, animationName, elapsedTime));
+    }
+    static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const WebKitAnimationEventInit& initializer)
+    {
+        return adoptRef(new WebKitAnimationEvent(type, initializer));
+    }
+
+    virtual ~WebKitAnimationEvent();
+
+    void initWebKitAnimationEvent(const AtomicString& type,
+                                  bool canBubbleArg,
+                                  bool cancelableArg,
+                                  const String& animationName,
+                                  double elapsedTime);
+
+    const String& animationName() const;
+    double elapsedTime() const;
+
+    virtual bool isWebKitAnimationEvent() const { return true; }
+
+private:
+    WebKitAnimationEvent();
+    WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);
+    WebKitAnimationEvent(const AtomicString&, const WebKitAnimationEventInit&);
+
+    String m_animationName;
+    double m_elapsedTime;
+};
+
 } // namespace WebCore
 
 #endif // WebKitAnimationEvent_h

Modified: trunk/Source/WebCore/dom/WebKitAnimationEvent.idl (94860 => 94861)


--- trunk/Source/WebCore/dom/WebKitAnimationEvent.idl	2011-09-09 17:24:59 UTC (rev 94860)
+++ trunk/Source/WebCore/dom/WebKitAnimationEvent.idl	2011-09-09 17:27:50 UTC (rev 94861)
@@ -25,7 +25,10 @@
 
 module events {
 
-    interface WebKitAnimationEvent : Event {
+    interface [
+        CanBeConstructed,
+        CustomConstructFunction
+    ] WebKitAnimationEvent : Event {
      readonly attribute DOMString          animationName;
      readonly attribute double             elapsedTime;
      void               initWebKitAnimationEvent(in [Optional=CallWithDefaultValue] DOMString typeArg,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to