2008-09-09 Dean Jackson <dino@apple.com>
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Sep 2008 19:50:25 +0000 (19:50 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Sep 2008 19:50:25 +0000 (19:50 +0000)
        Reviewed by Sam Weinig.

        Document::createEvent missing cases for animation and
        transition events.
        https://bugs.webkit.org/show_bug.cgi?id=20734

        Test: transitions/transition-end-event-create.html
        Test: animations/animation-events-create.html

        * dom/Document.cpp:
        (WebCore::Document::createEvent):
            - add the two cases

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36299 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/animations/animation-events-create-expected.txt [new file with mode: 0644]
LayoutTests/animations/animation-events-create.html [new file with mode: 0644]
LayoutTests/transitions/transition-end-event-create-expected.txt [new file with mode: 0644]
LayoutTests/transitions/transition-end-event-create.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Document.cpp

index cd370fb14500df2e624dd3185678c438ea4e6085..0e2d772f320561aeb554d68c5168e52df0fd3724 100644 (file)
@@ -1,3 +1,15 @@
+2008-09-09  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Test Document::createEvent for Animation and Transition events
+        https://bugs.webkit.org/show_bug.cgi?id=20734
+
+        * animations/animation-events-create.html: Added.
+        * animations/animation-events-create-expected.txt: Added.
+        * transitions/transition-end-event-create-expected.txt: Added.
+        * transitions/transition-end-event-create.html: Added.
+
 2008-09-09  Jungshik Shin  <jungshik.shin@gmail.com>
 
         Reviewed by Alexey Proskuryakov.
@@ -30,7 +42,7 @@
 
         * fast/dom/Window/window-properties-expected.txt:
 
-2008-09-05  Dean Jackson  <dino@apple.com>
+2008-09-08  Dean Jackson  <dino@apple.com>
 
         Reviewed by Dan Bernstein.
 
diff --git a/LayoutTests/animations/animation-events-create-expected.txt b/LayoutTests/animations/animation-events-create-expected.txt
new file mode 100644 (file)
index 0000000..2528d4a
--- /dev/null
@@ -0,0 +1,21 @@
+Test dynamic creation of WebKitAnimationEvent.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.createEvent exists
+
+Test creation of WebKitAnimationEvent
+PASS typeof(ev) is 'object'
+PASS ev.animationName is ''
+PASS ev.elapsedTime is 0.0
+
+Create a MouseEvent and make sure it doesn't have the WebKitAnimationEnd event properties
+PASS typeof(ev) is 'object'
+PASS ev.animationName is undefined
+PASS ev.elapsedTime is undefined
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/animations/animation-events-create.html b/LayoutTests/animations/animation-events-create.html
new file mode 100644 (file)
index 0000000..3ab6fce
--- /dev/null
@@ -0,0 +1,42 @@
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test dynamic creation of WebKitAnimationEvent.");
+
+if (document.createEvent)
+    testPassed("document.createEvent exists");
+else
+    testFailed("document.createEvent missing");
+
+debug("");
+debug("Test creation of WebKitAnimationEvent");
+
+var ev = document.createEvent("WebKitAnimationEvent");
+
+shouldBe("typeof(ev)", "'object'");
+shouldBe("ev.animationName", "''");
+shouldBe("ev.elapsedTime", "0.0");
+
+debug("");
+debug("Create a MouseEvent and make sure it doesn't have the WebKitAnimationEnd event properties");
+
+ev = document.createEvent("MouseEvent");
+
+shouldBe("typeof(ev)", "'object'");
+shouldBe("ev.animationName", "undefined");
+shouldBe("ev.elapsedTime", "undefined");
+
+debug("");
+successfullyParsed = true;
+
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/transitions/transition-end-event-create-expected.txt b/LayoutTests/transitions/transition-end-event-create-expected.txt
new file mode 100644 (file)
index 0000000..2fb53bf
--- /dev/null
@@ -0,0 +1,21 @@
+Test dynamic creation of WebKitTransitionEnd event.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.createEvent exists
+
+Test creation of WebKitTransitionEvent
+PASS typeof(ev) is 'object'
+PASS ev.propertyName is ''
+PASS ev.elapsedTime is 0.0
+
+Create a MouseEvent and make sure it doesn't have the WebKitTransitionEnd event properties
+PASS typeof(ev) is 'object'
+PASS ev.propertyName is undefined
+PASS ev.elapsedTime is undefined
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/transitions/transition-end-event-create.html b/LayoutTests/transitions/transition-end-event-create.html
new file mode 100644 (file)
index 0000000..f6d5c55
--- /dev/null
@@ -0,0 +1,42 @@
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test dynamic creation of WebKitTransitionEnd event.");
+
+if (document.createEvent)
+    testPassed("document.createEvent exists");
+else
+    testFailed("document.createEvent missing");
+
+debug("");
+debug("Test creation of WebKitTransitionEvent");
+
+var ev = document.createEvent("WebKitTransitionEvent");
+
+shouldBe("typeof(ev)", "'object'");
+shouldBe("ev.propertyName", "''");
+shouldBe("ev.elapsedTime", "0.0");
+
+debug("");
+debug("Create a MouseEvent and make sure it doesn't have the WebKitTransitionEnd event properties");
+
+ev = document.createEvent("MouseEvent");
+
+shouldBe("typeof(ev)", "'object'");
+shouldBe("ev.propertyName", "undefined");
+shouldBe("ev.elapsedTime", "undefined");
+
+debug("");
+successfullyParsed = true;
+
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index 93aff540eebe894601a0d5f5391b13af478e82ff..5ce4018e6d521df12b19c1d1b5866d885c587636 100644 (file)
@@ -1,3 +1,18 @@
+2008-09-09  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Document::createEvent missing cases for animation and
+        transition events.
+        https://bugs.webkit.org/show_bug.cgi?id=20734
+
+        Test: transitions/transition-end-event-create.html
+        Test: animations/animation-events-create.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::createEvent):
+            - add the two cases
+
 2008-09-09  Dan Bernstein  <mitz@apple.com>
 
         - Tiger build fix
index 2113134edf79ec6f6027fe24ba693f03950c539a..f17bed7f88e846657bb8c86bbb6acfccad120617 100644 (file)
 #include "TextResourceDecoder.h"
 #include "TreeWalker.h"
 #include "UIEvent.h"
+#include "WebKitAnimationEvent.h"
+#include "WebKitTransitionEvent.h"
 #include "WheelEvent.h"
 #include "XMLHttpRequest.h"
 #include "XMLNames.h"
@@ -2637,6 +2639,10 @@ PassRefPtr<Event> Document::createEvent(const String& eventType, ExceptionCode&
 #endif
     if (eventType == "MessageEvent")
         return MessageEvent::create();
+    if (eventType == "WebKitAnimationEvent")
+        return WebKitAnimationEvent::create();
+    if (eventType == "WebKitTransitionEvent")
+        return WebKitTransitionEvent::create();
     ec = NOT_SUPPORTED_ERR;
     return 0;
 }