Allow construction of unprefixed transition DOM events.
authoralexis@webkit.org <alexis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2013 20:07:35 +0000 (20:07 +0000)
committeralexis@webkit.org <alexis@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jan 2013 20:07:35 +0000 (20:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107319

Reviewed by Dean Jackson.

Source/WebCore:

Make possible to construct unprefixed DOM events for transitions.
Unfortunately I have to duplicate the C++ implementation class of the
events (TransitionEvent.h and TransitionEvent.cpp). I can't find a
better way to re-use the WebKitTransitionEvent class to back the
TransitionEvent.idl as our code generators don't allow to have a
different name for the C++ class used in the generated file than the
interface name specified in the IDL file. Unfortunately
https://trac.webkit.org/wiki/WebKitIDL#InterfaceName doesn't help as
it's only a way to unlink the interface name specified in the IDL with
the one exposed in JavaScript. I don't think we should support such a
feature in our code generators as WebKitTransitionEvent class and more
exactly prefixed DOM events for transitions will be removed one day so
this use case will become obselete.

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

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/EventNames.in:
* dom/TransitionEvent.cpp: Added.
(WebCore):
(WebCore::TransitionEventInit::TransitionEventInit):
(WebCore::TransitionEvent::TransitionEvent):
(WebCore::TransitionEvent::~TransitionEvent):
(WebCore::TransitionEvent::propertyName):
(WebCore::TransitionEvent::elapsedTime):
(WebCore::TransitionEvent::interfaceName):
* dom/TransitionEvent.h: Added.
(WebCore):
(TransitionEventInit):
(TransitionEvent):
(WebCore::TransitionEvent::create):
* dom/TransitionEvent.idl: Added.
* page/DOMWindow.idl:
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): always
create a TransitionEvent now. EventTarget will be responsible to create
a WebKitTransitionEvent if necessary.

LayoutTests:

Add new tests to cover the feature. Update some existing ones with new
expected results as a new constructor was added.

* fast/dom/constructed-objects-prototypes.html:
* fast/dom/constructed-objects-prototypes-expected.txt:
* fast/events/constructors/transition-event-constructor-expected.txt: Added.
* fast/events/constructors/transition-event-constructor.html: Added.
* fast/events/event-creation.html:
* platform/chromium/TestExpectations: Chromium turns the feature off.

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

23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/constructors/transition-event-constructor.html [new file with mode: 0644]
LayoutTests/fast/events/event-creation.html
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/TransitionEvent.cpp [new file with mode: 0644]
Source/WebCore/dom/TransitionEvent.h [new file with mode: 0644]
Source/WebCore/dom/TransitionEvent.idl [new file with mode: 0644]
Source/WebCore/page/DOMWindow.idl
Source/WebCore/page/animation/AnimationController.cpp

index 8480970..1034157 100644 (file)
@@ -1,3 +1,20 @@
+2013-01-22  Alexis Menard  <alexis@webkit.org>
+
+        Allow construction of unprefixed transition DOM events.
+        https://bugs.webkit.org/show_bug.cgi?id=107319
+
+        Reviewed by Dean Jackson.
+
+        Add new tests to cover the feature. Update some existing ones with new
+        expected results as a new constructor was added.
+
+        * fast/dom/constructed-objects-prototypes.html:
+        * fast/dom/constructed-objects-prototypes-expected.txt:
+        * fast/events/constructors/transition-event-constructor-expected.txt: Added.
+        * fast/events/constructors/transition-event-constructor.html: Added.
+        * fast/events/event-creation.html:
+        * platform/chromium/TestExpectations: Chromium turns the feature off.
+
 2013-01-22  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r140435.
index f5e72b8..c46ffdb 100644 (file)
@@ -45,6 +45,8 @@ PASS (new inner.StorageEvent()).isInner is true
 PASS (new inner.StorageEvent()).constructor.isInner is true
 PASS (new inner.TrackEvent()).isInner is true
 PASS (new inner.TrackEvent()).constructor.isInner is true
+PASS (new inner.TransitionEvent()).isInner is true
+PASS (new inner.TransitionEvent()).constructor.isInner is true
 PASS (new inner.URL()).isInner is true
 PASS (new inner.URL()).constructor.isInner is true
 PASS (new inner.WebGLContextEvent()).isInner is true
diff --git a/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt b/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt
new file mode 100644 (file)
index 0000000..eef8f7c
--- /dev/null
@@ -0,0 +1,52 @@
+This tests the constructor for the TransitionEvent DOM class.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS new TransitionEvent('eventType').bubbles is false
+PASS new TransitionEvent('eventType').cancelable is false
+PASS new TransitionEvent('eventType').propertyName is ""
+PASS new TransitionEvent('eventType').elapsedTime is 0
+PASS new TransitionEvent('eventType', { bubbles: false }).bubbles is false
+PASS new TransitionEvent('eventType', { bubbles: true }).bubbles is true
+PASS new TransitionEvent('eventType', { cancelable: false }).cancelable is false
+PASS new TransitionEvent('eventType', { cancelable: true }).cancelable is true
+PASS new TransitionEvent('eventType', { propertyName: 'doremi' }).propertyName is "doremi"
+PASS new TransitionEvent('eventType', { propertyName: '' }).propertyName is ""
+PASS new TransitionEvent('eventType', { propertyName: undefined }).propertyName is "undefined"
+PASS new TransitionEvent('eventType', { propertyName: null }).propertyName is "null"
+PASS new TransitionEvent('eventType', { propertyName: false }).propertyName is "false"
+PASS new TransitionEvent('eventType', { propertyName: true }).propertyName is "true"
+PASS new TransitionEvent('eventType', { propertyName: 12345 }).propertyName is "12345"
+PASS new TransitionEvent('eventType', { propertyName: 18446744073709551615 }).propertyName is "18446744073709552000"
+PASS new TransitionEvent('eventType', { propertyName: NaN }).propertyName is "NaN"
+PASS new TransitionEvent('eventType', { propertyName: [] }).propertyName is ""
+PASS new TransitionEvent('eventType', { propertyName: [1, 2, 3] }).propertyName is "1,2,3"
+PASS new TransitionEvent('eventType', { propertyName: {doremi: 12345} }).propertyName is "[object Object]"
+PASS new TransitionEvent('eventType', { propertyName: {valueOf: function () { return 'doremi'; } } }).propertyName is "[object Object]"
+PASS new TransitionEvent('eventType', { elapsedTime: 0 }).elapsedTime is 0
+PASS new TransitionEvent('eventType', { elapsedTime: 123.45 }).elapsedTime is 123.45
+PASS new TransitionEvent('eventType', { elapsedTime: -123.45 }).elapsedTime is -123.45
+PASS new TransitionEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime is 18446744073709551615
+PASS new TransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime is NaN
+PASS new TransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime is Infinity
+PASS new TransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime is -Infinity
+PASS new TransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime is NaN
+PASS new TransitionEvent('eventType', { elapsedTime: null }).elapsedTime is 0
+PASS new TransitionEvent('eventType', { elapsedTime: false }).elapsedTime is 0
+PASS new TransitionEvent('eventType', { elapsedTime: true }).elapsedTime is 1
+PASS new TransitionEvent('eventType', { elapsedTime: '' }).elapsedTime is 0
+PASS new TransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime is NaN
+PASS new TransitionEvent('eventType', { elapsedTime: [] }).elapsedTime is 0
+PASS new TransitionEvent('eventType', { elapsedTime: [123.45] }).elapsedTime is 123.45
+PASS new TransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime is NaN
+PASS new TransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime is NaN
+PASS new TransitionEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime is 123.45
+PASS new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).bubbles is true
+PASS new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).cancelable is true
+PASS new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).propertyName is 'doremi'
+PASS new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).elapsedTime is 123.45
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/constructors/transition-event-constructor.html b/LayoutTests/fast/events/constructors/transition-event-constructor.html
new file mode 100644 (file)
index 0000000..8aef039
--- /dev/null
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+
+description("This tests the constructor for the TransitionEvent DOM class.");
+
+// No initializer is passed.
+shouldBe("new TransitionEvent('eventType').bubbles", "false");
+shouldBe("new TransitionEvent('eventType').cancelable", "false");
+shouldBeEqualToString("new TransitionEvent('eventType').propertyName", "");
+shouldBe("new TransitionEvent('eventType').elapsedTime", "0");
+
+// bubbles is passed.
+shouldBe("new TransitionEvent('eventType', { bubbles: false }).bubbles", "false");
+shouldBe("new TransitionEvent('eventType', { bubbles: true }).bubbles", "true");
+
+// cancelable is passed.
+shouldBe("new TransitionEvent('eventType', { cancelable: false }).cancelable", "false");
+shouldBe("new TransitionEvent('eventType', { cancelable: true }).cancelable", "true");
+
+// propertyName is passed.
+// Strings.
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: 'doremi' }).propertyName", "doremi");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: '' }).propertyName", "");
+
+// Non-strings.
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: undefined }).propertyName", "undefined");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: null }).propertyName", "null");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: false }).propertyName", "false");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: true }).propertyName", "true");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: 12345 }).propertyName", "12345");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: 18446744073709551615 }).propertyName", "18446744073709552000");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: NaN }).propertyName", "NaN");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: [] }).propertyName", "");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: [1, 2, 3] }).propertyName", "1,2,3");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: {doremi: 12345} }).propertyName", "[object Object]");
+shouldBeEqualToString("new TransitionEvent('eventType', { propertyName: {valueOf: function () { return 'doremi'; } } }).propertyName", "[object Object]");
+
+// elapsedTime is passed.
+// Numeric values.
+shouldBe("new TransitionEvent('eventType', { elapsedTime: 0 }).elapsedTime", "0");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: 123.45 }).elapsedTime", "123.45");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: -123.45 }).elapsedTime", "-123.45");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: 18446744073709551615 }).elapsedTime", "18446744073709551615");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: NaN }).elapsedTime", "NaN");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: Infinity }).elapsedTime", "Infinity");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: -Infinity }).elapsedTime", "-Infinity");
+
+// Non-numeric values.
+shouldBe("new TransitionEvent('eventType', { elapsedTime: undefined }).elapsedTime", "NaN");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: null }).elapsedTime", "0");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: false }).elapsedTime", "0");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: true }).elapsedTime", "1");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: '' }).elapsedTime", "0");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: 'doremi' }).elapsedTime", "NaN");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: [] }).elapsedTime", "0");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: [123.45] }).elapsedTime", "123.45");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: [123.45, 678.90] }).elapsedTime", "NaN");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: {doremi: 123.45} }).elapsedTime", "NaN");
+shouldBe("new TransitionEvent('eventType', { elapsedTime: {valueOf: function () { return 123.45 } } }).elapsedTime", "123.45");
+
+// All initializers are passed.
+shouldBe("new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).bubbles", "true");
+shouldBe("new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).cancelable", "true");
+shouldBe("new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).propertyName", "'doremi'");
+shouldBe("new TransitionEvent('eventType', { bubbles: true, cancelable: true, propertyName: 'doremi', elapsedTime: 123.45 }).elapsedTime", "123.45");
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
index 3117bfa..6a5e2c8 100644 (file)
     // shouldBeTrue("document.createEvent('AutocompleteErrorEvent') instanceof window.Event");
     // shouldBeTrue("document.createEvent('AutocompleteErrorEvent').constructor === window.AutocompleteErrorEvent");
 
+    // #if ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
+    // TransitionEvent
+    // shouldBeTrue("document.createEvent('TransitionEvent') instanceof window.TransitionEvent");
+    // shouldBeTrue("document.createEvent('TransitionEvent') instanceof window.Event");
+    // shouldBeTrue("document.createEvent('TransitionEvent').constructor === window.TransitionEvent");
 
     // We test both a hard coded set and the automated set below (using enumeration) to ensure that a constructor being removed
     // from the window is caught a regression.
index c9f8d1e..fd5756b 100644 (file)
@@ -4201,6 +4201,7 @@ webkit.org/b/104616 [ Win Mac ] fast/gradients/css3-linear-angle-gradients.html
 # Unprefixed transitions are disabled while they're being implemented.
 # See also http://wkb.ug/105647
 webkit.org/b/93136 transitions/transitions-parsing.html [ Failure ]
+webkit.org/b/93136 fast/events/constructors/transition-event-constructor.html [ Failure ]
 
 # Flaky
 webkit.org/b/104283 [ Win Release ] fonts/monospace.html [ Failure Pass ]
index a9c0dbc..b6197a9 100644 (file)
@@ -402,6 +402,7 @@ set(WebCore_IDL_FILES
     dom/TouchEvent.idl
     dom/Touch.idl
     dom/TouchList.idl
+    dom/TransitionEvent.idl
     dom/TreeWalker.idl
     dom/UIEvent.idl
     dom/WebKitAnimationEvent.idl
@@ -1245,6 +1246,7 @@ set(WebCore_SOURCES
     dom/TouchEvent.cpp
     dom/TouchList.cpp
     dom/TransformSourceLibxslt.cpp
+    dom/TransitionEvent.cpp
     dom/Traversal.cpp
     dom/TreeScope.cpp
     dom/TreeScopeAdopter.cpp
index a40e101..6253abf 100644 (file)
@@ -1,3 +1,57 @@
+2013-01-22  Alexis Menard  <alexis@webkit.org>
+
+        Allow construction of unprefixed transition DOM events.
+        https://bugs.webkit.org/show_bug.cgi?id=107319
+
+        Reviewed by Dean Jackson.
+
+        Make possible to construct unprefixed DOM events for transitions.
+        Unfortunately I have to duplicate the C++ implementation class of the
+        events (TransitionEvent.h and TransitionEvent.cpp). I can't find a
+        better way to re-use the WebKitTransitionEvent class to back the
+        TransitionEvent.idl as our code generators don't allow to have a
+        different name for the C++ class used in the generated file than the
+        interface name specified in the IDL file. Unfortunately
+        https://trac.webkit.org/wiki/WebKitIDL#InterfaceName doesn't help as
+        it's only a way to unlink the interface name specified in the IDL with
+        the one exposed in JavaScript. I don't think we should support such a
+        feature in our code generators as WebKitTransitionEvent class and more
+        exactly prefixed DOM events for transitions will be removed one day so
+        this use case will become obselete.
+
+        Test: fast/events/constructors/transition-event-constructor.html
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * DerivedSources.pri:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMAllInOne.cpp:
+        * dom/EventNames.in:
+        * dom/TransitionEvent.cpp: Added.
+        (WebCore):
+        (WebCore::TransitionEventInit::TransitionEventInit):
+        (WebCore::TransitionEvent::TransitionEvent):
+        (WebCore::TransitionEvent::~TransitionEvent):
+        (WebCore::TransitionEvent::propertyName):
+        (WebCore::TransitionEvent::elapsedTime):
+        (WebCore::TransitionEvent::interfaceName):
+        * dom/TransitionEvent.h: Added.
+        (WebCore):
+        (TransitionEventInit):
+        (TransitionEvent):
+        (WebCore::TransitionEvent::create):
+        * dom/TransitionEvent.idl: Added.
+        * page/DOMWindow.idl:
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): always
+        create a TransitionEvent now. EventTarget will be responsible to create
+        a WebKitTransitionEvent if necessary.
+
 2013-01-22  Adam Barth  <abarth@webkit.org>
 
         Wean BackgroundHTMLParser off HTMLInputStream
index 3797274..9f5be50 100644 (file)
 #include "JSTouch.cpp"
 #include "JSTouchEvent.cpp"
 #include "JSTouchList.cpp"
+#if ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
+#include "JSTransitionEvent.cpp"
+#endif
 #include "JSTreeWalker.cpp"
 #include "JSUint16Array.cpp"
 #include "JSUint32Array.cpp"
index 4663d93..fc24489 100644 (file)
@@ -270,6 +270,7 @@ BINDING_IDLS = \
     $(WebCore)/dom/Touch.idl \
     $(WebCore)/dom/TouchEvent.idl \
     $(WebCore)/dom/TouchList.idl \
+    $(WebCore)/dom/TransitionEvent.idl \
     $(WebCore)/dom/TreeWalker.idl \
     $(WebCore)/dom/UIEvent.idl \
     $(WebCore)/dom/WebKitAnimationEvent.idl \
index d3c0a80..2ead720 100644 (file)
@@ -279,6 +279,7 @@ IDL_BINDINGS += \
     $$PWD/dom/Touch.idl \
     $$PWD/dom/TouchEvent.idl \
     $$PWD/dom/TouchList.idl \
+    $$PWD/dom/TransitionEvent.idl \
     $$PWD/dom/TreeWalker.idl \
     $$PWD/dom/UIEvent.idl \
     $$PWD/dom/WebKitAnimationEvent.idl \
index a4ca1b0..44adced 100644 (file)
@@ -751,6 +751,8 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSTouchList.h \
        DerivedSources/WebCore/JSTrackEvent.cpp \
        DerivedSources/WebCore/JSTrackEvent.h \
+       DerivedSources/WebCore/JSTransitionEvent.cpp \
+       DerivedSources/WebCore/JSTransitionEvent.h \
        DerivedSources/WebCore/JSTreeWalker.cpp \
        DerivedSources/WebCore/JSTreeWalker.h \
        DerivedSources/WebCore/JSUIEvent.cpp \
@@ -1416,6 +1418,7 @@ dom_binding_idls += \
        $(WebCore)/dom/Touch.idl \
        $(WebCore)/dom/TouchEvent.idl \
        $(WebCore)/dom/TouchList.idl \
+       $(WebCore)/dom/TransitionEvent.idl \
        $(WebCore)/dom/TreeWalker.idl \
        $(WebCore)/dom/UIEvent.idl \
        $(WebCore)/dom/WebKitAnimationEvent.idl \
@@ -2994,6 +2997,8 @@ webcore_sources += \
        Source/WebCore/dom/TouchList.h \
        Source/WebCore/dom/TransformSource.h \
        Source/WebCore/dom/TransformSourceLibxslt.cpp \
+       Source/WebCore/dom/TransitionEvent.cpp \
+       Source/WebCore/dom/TransitionEvent.h \
        Source/WebCore/dom/Traversal.cpp \
        Source/WebCore/dom/Traversal.h \
        Source/WebCore/dom/TreeDepthLimit.h \
index 3a9d8f9..bc3a7f7 100644 (file)
@@ -467,6 +467,7 @@ SOURCES += \
     dom/Touch.cpp \
     dom/TouchEvent.cpp \
     dom/TouchList.cpp \
+    dom/TransitionEvent.cpp \
     dom/Traversal.cpp \
     dom/TreeScope.cpp \
     dom/TreeScopeAdopter.cpp \
@@ -1666,6 +1667,7 @@ HEADERS += \
     dom/TouchEvent.h \
     dom/TouchList.h \
     dom/TransformSource.h \
+    dom/TransitionEvent.h \
     dom/Traversal.h \
     dom/TreeDepthLimit.h \
     dom/TreeScope.h \
index 9ae05ae..c7fc032 100644 (file)
             'dom/Touch.idl',
             'dom/TouchEvent.idl',
             'dom/TouchList.idl',
+            'dom/TransitionEvent.idl',
             'dom/TreeWalker.idl',
             'dom/UIEvent.idl',
             'dom/WebKitAnimationEvent.idl',
             'dom/TouchList.h',
             'dom/TransformSource.h',
             'dom/TransformSourceLibxslt.cpp',
+            'dom/TransitionEvent.cpp',
+            'dom/TransitionEvent.h',
             'dom/Traversal.cpp',
             'dom/Traversal.h',
             'dom/TreeDepthLimit.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTouchEvent.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTouchList.cpp',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTouchList.h',
+            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTransitionEvent.cpp',
+            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTransitionEvent.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTreeWalker.cpp',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSTreeWalker.h',
             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSUIEvent.cpp',
index dda9d0c..c7999aa 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTransitionEvent.cpp"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_All|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Production|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTransitionEvent.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSTreeWalker.cpp"
                                >
                                <FileConfiguration
                                </FileConfiguration>
                        </File>
                        <File
+                               RelativePath="..\dom\TransitionEvent.cpp"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_All|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Production|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCCLCompilerTool"
+                                       />
+                               </FileConfiguration>
+                       </File>
+                       <File
+                               RelativePath="..\dom\TransitionEvent.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\dom\Traversal.cpp"
                                >
                                <FileConfiguration
index 371c2fe..6a71e44 100644 (file)
                E1424C90164B460B00F32D40 /* CookieJarMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1424C8F164B460B00F32D40 /* CookieJarMac.mm */; };
                E1424C93164B52C800F32D40 /* CookieJar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1424C91164B52C800F32D40 /* CookieJar.cpp */; };
                E1424C94164B52C800F32D40 /* CookieJar.h in Headers */ = {isa = PBXBuildFile; fileRef = E1424C92164B52C800F32D40 /* CookieJar.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               E145349716A9BB6A000F6FD2 /* DOMTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E145349416A9BB6A000F6FD2 /* DOMTransitionEvent.h */; };
+               E145349816A9BB6A000F6FD2 /* DOMTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = E145349516A9BB6A000F6FD2 /* DOMTransitionEvent.mm */; };
+               E145349916A9BB6A000F6FD2 /* DOMTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = E145349616A9BB6A000F6FD2 /* DOMTransitionEventInternal.h */; };
                E14F1C4414B5DAC600EA9009 /* HTMLFormControlElementWithState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E14F1C4214B5DAC600EA9009 /* HTMLFormControlElementWithState.cpp */; };
                E14F1C4514B5DAC600EA9009 /* HTMLFormControlElementWithState.h in Headers */ = {isa = PBXBuildFile; fileRef = E14F1C4314B5DAC600EA9009 /* HTMLFormControlElementWithState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E1513D4F1677EA8300149FCB /* InitializeLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = E1513D4E1677EA8300149FCB /* InitializeLogging.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E16A84FA14C85CCC002977DF /* CSSBorderImage.h in Headers */ = {isa = PBXBuildFile; fileRef = E16A84F814C85CCC002977DF /* CSSBorderImage.h */; };
                E17A4A1B0D97991D00FC10C6 /* DOMSVGAltGlyphElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 65AA6BAC0D974A00000541AE /* DOMSVGAltGlyphElement.h */; };
                E17A4A1C0D97991D00FC10C6 /* DOMSVGAltGlyphElementInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 65AA6BAE0D974A00000541AE /* DOMSVGAltGlyphElementInternal.h */; };
+               E17B491516A9B094001C8839 /* TransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E17B491316A9B093001C8839 /* TransitionEvent.cpp */; };
+               E17B491616A9B094001C8839 /* TransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E17B491416A9B093001C8839 /* TransitionEvent.h */; };
+               E17B492116A9B8FF001C8839 /* JSTransitionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E17B491F16A9B8FF001C8839 /* JSTransitionEvent.h */; };
+               E17B492216A9B8FF001C8839 /* JSTransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E17B492016A9B8FF001C8839 /* JSTransitionEvent.cpp */; };
                E182568F0EF2B02D00933242 /* JSWorkerContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E182568D0EF2B02D00933242 /* JSWorkerContext.cpp */; };
                E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E182568E0EF2B02D00933242 /* JSWorkerContext.h */; };
                E18258AC0EF3CD7000933242 /* JSWorkerContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18258AB0EF3CD7000933242 /* JSWorkerContextCustom.cpp */; };
                E1424C8F164B460B00F32D40 /* CookieJarMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieJarMac.mm; sourceTree = "<group>"; };
                E1424C91164B52C800F32D40 /* CookieJar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CookieJar.cpp; sourceTree = "<group>"; };
                E1424C92164B52C800F32D40 /* CookieJar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieJar.h; sourceTree = "<group>"; };
+               E145349416A9BB6A000F6FD2 /* DOMTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTransitionEvent.h; sourceTree = "<group>"; };
+               E145349516A9BB6A000F6FD2 /* DOMTransitionEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMTransitionEvent.mm; sourceTree = "<group>"; };
+               E145349616A9BB6A000F6FD2 /* DOMTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTransitionEventInternal.h; sourceTree = "<group>"; };
                E14F1C4214B5DAC600EA9009 /* HTMLFormControlElementWithState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFormControlElementWithState.cpp; sourceTree = "<group>"; };
                E14F1C4314B5DAC600EA9009 /* HTMLFormControlElementWithState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLFormControlElementWithState.h; sourceTree = "<group>"; };
                E1513D4E1677EA8300149FCB /* InitializeLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeLogging.h; sourceTree = "<group>"; };
                E169825F1134636A00894115 /* ObjCRuntimeObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ObjCRuntimeObject.mm; sourceTree = "<group>"; };
                E16A84F714C85CCC002977DF /* CSSBorderImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSBorderImage.cpp; sourceTree = "<group>"; };
                E16A84F814C85CCC002977DF /* CSSBorderImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSBorderImage.h; sourceTree = "<group>"; };
+               E17B490B16A97269001C8839 /* TransitionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TransitionEvent.idl; sourceTree = "<group>"; };
+               E17B491316A9B093001C8839 /* TransitionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransitionEvent.cpp; sourceTree = "<group>"; };
+               E17B491416A9B093001C8839 /* TransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransitionEvent.h; sourceTree = "<group>"; };
+               E17B491F16A9B8FF001C8839 /* JSTransitionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTransitionEvent.h; sourceTree = "<group>"; };
+               E17B492016A9B8FF001C8839 /* JSTransitionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTransitionEvent.cpp; sourceTree = "<group>"; };
                E182568D0EF2B02D00933242 /* JSWorkerContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContext.cpp; sourceTree = "<group>"; };
                E182568E0EF2B02D00933242 /* JSWorkerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerContext.h; sourceTree = "<group>"; };
                E18258AB0EF3CD7000933242 /* JSWorkerContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerContextCustom.cpp; sourceTree = "<group>"; };
                                BCC573340D695BBE006EF517 /* DOMProgressEvent.mm */,
                                933A14750B7D1BAF00A53FFD /* DOMTextEvent.h */,
                                933A14A90B7D1D0900A53FFD /* DOMTextEvent.mm */,
+                               E145349416A9BB6A000F6FD2 /* DOMTransitionEvent.h */,
+                               E145349516A9BB6A000F6FD2 /* DOMTransitionEvent.mm */,
+                               E145349616A9BB6A000F6FD2 /* DOMTransitionEventInternal.h */,
                                85C7F48F0AAF79DC004014DD /* DOMUIEvent.h */,
                                85C7F4900AAF79DC004014DD /* DOMUIEvent.mm */,
                                31C0FF430E4CEFDD007D6FE5 /* DOMWebKitAnimationEvent.h */,
                                5189F01C10B37BD900F3C739 /* JSPopStateEvent.h */,
                                933A14B60B7D1D5200A53FFD /* JSTextEvent.cpp */,
                                933A14B70B7D1D5200A53FFD /* JSTextEvent.h */,
+                               E17B491F16A9B8FF001C8839 /* JSTransitionEvent.h */,
+                               E17B492016A9B8FF001C8839 /* JSTransitionEvent.cpp */,
                                A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */,
                                A86629C909DA2B47009633A5 /* JSUIEvent.h */,
                                31C0FF390E4CEFAC007D6FE5 /* JSWebKitAnimationEvent.cpp */,
                                A77B419F12E675A90054343D /* TextEventInputType.h */,
                                5DB1BC6810715A6400EFAA49 /* TransformSource.h */,
                                5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */,
+                               E17B491316A9B093001C8839 /* TransitionEvent.cpp */,
+                               E17B491416A9B093001C8839 /* TransitionEvent.h */,
+                               E17B490B16A97269001C8839 /* TransitionEvent.idl */,
                                854FE72C0A2297BE0058D7AD /* Traversal.cpp */,
                                854FE72D0A2297BE0058D7AD /* Traversal.h */,
                                37FD4297118368460093C029 /* TreeDepthLimit.h */,
                                188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
                                05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */,
                                76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */,
+                               E145349716A9BB6A000F6FD2 /* DOMTransitionEvent.h in Headers */,
+                               E145349916A9BB6A000F6FD2 /* DOMTransitionEventInternal.h in Headers */,
                                BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */,
                                85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */,
                                850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */,
                                E446141B0CD6826900FADA75 /* JSTimeRanges.h in Headers */,
                                07846385145B1B8E00A58DF1 /* JSTrackCustom.h in Headers */,
                                07846343145B151A00A58DF1 /* JSTrackEvent.h in Headers */,
+                               E17B492116A9B8FF001C8839 /* JSTransitionEvent.h in Headers */,
                                1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
                                A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */,
                                49EECF0D105070C400099FAB /* JSUint16Array.h in Headers */,
                                49E911D00EF86D47009D0CAF /* TransformOperations.h in Headers */,
                                5DB1BC6A10715A6400EFAA49 /* TransformSource.h in Headers */,
                                4945BFD413CF809000CC3B38 /* TransformState.h in Headers */,
+                               E17B491616A9B094001C8839 /* TransitionEvent.h in Headers */,
                                49E911D20EF86D47009D0CAF /* TranslateTransformOperation.h in Headers */,
                                854FE7370A2297BE0058D7AD /* Traversal.h in Headers */,
                                37FD4298118368460093C029 /* TreeDepthLimit.h in Headers */,
                                933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */,
                                188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */,
                                76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */,
+                               E145349816A9BB6A000F6FD2 /* DOMTransitionEvent.mm in Sources */,
                                85526CD30AB0B7DA000302EA /* DOMTreeWalker.mm in Sources */,
                                85C7F4920AAF79DC004014DD /* DOMUIEvent.mm in Sources */,
                                2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */,
                                070334E9145A1F36008D8D45 /* JSTrackCustom.cpp in Sources */,
                                07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */,
                                07BDD6EC1469B4C2009C9F85 /* JSTrackEventCustom.cpp in Sources */,
+                               E17B492216A9B8FF001C8839 /* JSTransitionEvent.cpp in Sources */,
                                1A750D5C0A90DEE1000FF215 /* JSTreeWalker.cpp in Sources */,
                                516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */,
                                A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */,
                                5DB1BC6B10715A6400EFAA49 /* TransformSourceLibxslt.cpp in Sources */,
                                4945BFD313CF809000CC3B38 /* TransformState.cpp in Sources */,
                                49E911D10EF86D47009D0CAF /* TranslateTransformOperation.cpp in Sources */,
+                               E17B491516A9B094001C8839 /* TransitionEvent.cpp in Sources */,
                                854FE7360A2297BE0058D7AD /* Traversal.cpp in Sources */,
                                14D64B5C134A5B6B00E58FDA /* TreeScope.cpp in Sources */,
                                A77E1FEF14AACB6E005B7CB6 /* TreeScopeAdopter.cpp in Sources */,
index 19d89bc..af41d88 100644 (file)
 #include "TouchEvent.cpp"
 #include "TouchList.cpp"
 #include "TransformSourceLibxslt.cpp"
+#include "TransitionEvent.cpp"
 #include "Traversal.cpp"
 #include "TreeScope.cpp"
 #include "TreeScopeAdopter.cpp"
index 74b4582..b329497 100644 (file)
@@ -21,6 +21,7 @@ PageTransitionEvent
 PopStateEvent
 ProgressEvent
 TextEvent
+TransitionEvent conditional=CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
 UIEvent
 UIEvents interfaceName=UIEvent
 WebKitAnimationEvent
diff --git a/Source/WebCore/dom/TransitionEvent.cpp b/Source/WebCore/dom/TransitionEvent.cpp
new file mode 100644 (file)
index 0000000..b3fe20f
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "TransitionEvent.h"
+
+#if ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
+
+#include "EventNames.h"
+
+namespace WebCore {
+
+TransitionEventInit::TransitionEventInit()
+    : propertyName()
+    , elapsedTime(0)
+{
+}
+
+TransitionEvent::TransitionEvent()
+    : m_propertyName()
+    , m_elapsedTime(0)
+{
+}
+
+TransitionEvent::TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime)
+    : Event(type, true, true)
+    , m_propertyName(propertyName)
+    , m_elapsedTime(elapsedTime)
+{
+}
+
+TransitionEvent::TransitionEvent(const AtomicString& type, const TransitionEventInit& initializer)
+    : Event(type, initializer)
+    , m_propertyName(initializer.propertyName)
+    , m_elapsedTime(initializer.elapsedTime)
+{
+}
+
+TransitionEvent::~TransitionEvent()
+{
+}
+
+const String& TransitionEvent::propertyName() const
+{
+    return m_propertyName;
+}
+
+double TransitionEvent::elapsedTime() const
+{
+    return m_elapsedTime;
+}
+
+const AtomicString& TransitionEvent::interfaceName() const
+{
+    return eventNames().interfaceForTransitionEvent;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
diff --git a/Source/WebCore/dom/TransitionEvent.h b/Source/WebCore/dom/TransitionEvent.h
new file mode 100644 (file)
index 0000000..b173860
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#if ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
+
+#ifndef TransitionEvent_h
+#define TransitionEvent_h
+
+#include "Event.h"
+
+namespace WebCore {
+
+struct TransitionEventInit : public EventInit {
+    TransitionEventInit();
+
+    String propertyName;
+    double elapsedTime;
+};
+
+class TransitionEvent : public Event {
+public:
+    static PassRefPtr<TransitionEvent> create()
+    {
+        return adoptRef(new TransitionEvent);
+    }
+    static PassRefPtr<TransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime)
+    {
+        return adoptRef(new TransitionEvent(type, propertyName, elapsedTime));
+    }
+    static PassRefPtr<TransitionEvent> create(const AtomicString& type, const TransitionEventInit& initializer)
+    {
+        return adoptRef(new TransitionEvent(type, initializer));
+    }
+
+    virtual ~TransitionEvent();
+
+    const String& propertyName() const;
+    double elapsedTime() const;
+
+    virtual const AtomicString& interfaceName() const;
+
+private:
+    TransitionEvent();
+    TransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime);
+    TransitionEvent(const AtomicString& type, const TransitionEventInit& initializer);
+
+    String m_propertyName;
+    double m_elapsedTime;
+};
+
+} // namespace WebCore
+
+#endif // TransitionEvent_h
+
+#endif // ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
diff --git a/Source/WebCore/dom/TransitionEvent.idl b/Source/WebCore/dom/TransitionEvent.idl
new file mode 100644 (file)
index 0000000..cc06de6
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+[
+    Conditional=CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED,
+    ConstructorTemplate=Event
+] interface TransitionEvent : Event {
+    [InitializedByEventConstructor] readonly attribute DOMString propertyName;
+    [InitializedByEventConstructor] readonly attribute double elapsedTime;
+};
+
index 0508c8c..8257987 100644 (file)
     attribute PageTransitionEventConstructor PageTransitionEvent;
     attribute ProgressEventConstructor ProgressEvent;
     attribute TextEventConstructor TextEvent;
+    [Conditional=CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED] attribute TransitionEventConstructor TransitionEvent;
     attribute UIEventConstructor UIEvent;
     attribute WebKitAnimationEventConstructor WebKitAnimationEvent;
     attribute WebKitTransitionEventConstructor WebKitTransitionEvent;
index c6d5ee2..7a936b8 100644 (file)
@@ -38,6 +38,7 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "RenderView.h"
+#include "TransitionEvent.h"
 #include "WebKitAnimationEvent.h"
 #include "WebKitTransitionEvent.h"
 #include <wtf/CurrentTime.h>
@@ -180,7 +181,11 @@ void AnimationControllerPrivate::fireEventsAndUpdateStyle()
     Vector<EventToDispatch>::const_iterator eventsToDispatchEnd = eventsToDispatch.end();
     for (Vector<EventToDispatch>::const_iterator it = eventsToDispatch.begin(); it != eventsToDispatchEnd; ++it) {
         if (it->eventType == eventNames().transitionendEvent)
+#if ENABLE(CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED)
+            it->element->dispatchEvent(TransitionEvent::create(it->eventType, it->name, it->elapsedTime));
+#else
             it->element->dispatchEvent(WebKitTransitionEvent::create(it->eventType, it->name, it->elapsedTime));
+#endif
         else
             it->element->dispatchEvent(WebKitAnimationEvent::create(it->eventType, it->name, it->elapsedTime));
     }