Title: [138843] trunk
Revision
138843
Author
commit-qu...@webkit.org
Date
2013-01-04 13:12:58 -0800 (Fri, 04 Jan 2013)

Log Message

window.Touch and TouchList should exist when touch events are enabled
https://bugs.webkit.org/show_bug.cgi?id=96295

Patch by Rick Byers <rby...@chromium.org> on 2013-01-04
Reviewed by Kentaro Hara.

Source/WebCore:

Add missing window.Touch and window.TouchList constructors under
ENABLE(TOUCH_EVENTS).

Make window.Touch, window.TouchList and window.TouchEvent enabled at runtime
under V8, to be consistent with all the other touch-related APIs.

Tests: fast/events/touch/document-create-touch-list.html
   fast/js/global-constructors.html

* bindings/generic/RuntimeEnabledFeatures.h:
* dom/Document.idl:
* dom/Element.idl:
* page/DOMWindow.idl:

LayoutTests:

Add new expected constructors and instanceof checks.

* fast/events/touch/document-create-touch-list-expected.txt:
* fast/events/touch/script-tests/document-create-touch-list.js:
* platform/efl/fast/js/global-constructors-expected.txt:
* platform/qt-5.0/fast/js/global-constructors-expected.txt:
* platform/qt/fast/js/global-constructors-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (138842 => 138843)


--- trunk/LayoutTests/ChangeLog	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/LayoutTests/ChangeLog	2013-01-04 21:12:58 UTC (rev 138843)
@@ -1,3 +1,18 @@
+2013-01-04  Rick Byers  <rby...@chromium.org>
+
+        window.Touch and TouchList should exist when touch events are enabled
+        https://bugs.webkit.org/show_bug.cgi?id=96295
+
+        Reviewed by Kentaro Hara.
+
+        Add new expected constructors and instanceof checks.
+
+        * fast/events/touch/document-create-touch-list-expected.txt:
+        * fast/events/touch/script-tests/document-create-touch-list.js:
+        * platform/efl/fast/js/global-constructors-expected.txt:
+        * platform/qt-5.0/fast/js/global-constructors-expected.txt:
+        * platform/qt/fast/js/global-constructors-expected.txt:
+
 2013-01-04  Xianzhu Wang  <wangxian...@chromium.org>
 
         Test compositing and slow scrolling behavior of fixed position elements under transformed elements

Modified: trunk/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt (138842 => 138843)


--- trunk/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt	2013-01-04 21:12:58 UTC (rev 138843)
@@ -9,7 +9,10 @@
 PASS touchList.item(0) is null
 PASS touchList.item(1) is null
 PASS touchList.item() threw exception TypeError: Not enough arguments.
+PASS ts instanceof TouchEvent is true
+PASS ts.touches instanceof TouchList is true
 PASS ts.touches.length is 2
+PASS ts.touches[0] instanceof Touch is true
 PASS ts.touches[0].identifier is 12341
 PASS ts.touches[0].clientX is 60
 PASS ts.touches[1].screenY is 120

Modified: trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js (138842 => 138843)


--- trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js	2013-01-04 21:12:58 UTC (rev 138843)
@@ -21,7 +21,10 @@
 
     document.body.addEventListener("touchstart", function handleTouchStart(ev) {
         ts = ev;
+        shouldBeTrue("ts instanceof TouchEvent");
+        shouldBeTrue("ts.touches instanceof TouchList");
         shouldBe("ts.touches.length", "2");
+        shouldBeTrue("ts.touches[0] instanceof Touch");
         shouldBe("ts.touches[0].identifier", "12341");
         shouldBe("ts.touches[0].clientX", "60");
         shouldBe("ts.touches[1].screenY", "120");

Modified: trunk/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt (138842 => 138843)


--- trunk/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt	2013-01-04 21:12:58 UTC (rev 138843)
@@ -322,7 +322,9 @@
 PASS TextTrackCueList.toString() is '[object TextTrackCueListConstructor]'
 PASS TextTrackList.toString() is '[object TextTrackListConstructor]'
 PASS TimeRanges.toString() is '[object TimeRangesConstructor]'
+PASS Touch.toString() is '[object TouchConstructor]'
 PASS TouchEvent.toString() is '[object TouchEventConstructor]'
+PASS TouchList.toString() is '[object TouchListConstructor]'
 PASS TrackEvent.toString() is '[object TrackEventConstructor]'
 PASS UIEvent.toString() is '[object UIEventConstructor]'
 PASS URL.toString() is '[object URLConstructor]'

Modified: trunk/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt (138842 => 138843)


--- trunk/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt	2013-01-04 21:12:58 UTC (rev 138843)
@@ -295,7 +295,9 @@
 PASS TextEvent.toString() is '[object TextEventConstructor]'
 PASS TextMetrics.toString() is '[object TextMetricsConstructor]'
 PASS TimeRanges.toString() is '[object TimeRangesConstructor]'
+PASS Touch.toString() is '[object TouchConstructor]'
 PASS TouchEvent.toString() is '[object TouchEventConstructor]'
+PASS TouchList.toString() is '[object TouchListConstructor]'
 PASS UIEvent.toString() is '[object UIEventConstructor]'
 PASS WebGLContextEvent.toString() is '[object WebGLContextEventConstructor]'
 PASS WebKitAnimationEvent.toString() is '[object WebKitAnimationEventConstructor]'

Modified: trunk/LayoutTests/platform/qt-5.0/fast/js/global-constructors-expected.txt (138842 => 138843)


--- trunk/LayoutTests/platform/qt-5.0/fast/js/global-constructors-expected.txt	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/LayoutTests/platform/qt-5.0/fast/js/global-constructors-expected.txt	2013-01-04 21:12:58 UTC (rev 138843)
@@ -312,7 +312,9 @@
 PASS TextEvent.toString() is '[object TextEventConstructor]'
 PASS TextMetrics.toString() is '[object TextMetricsConstructor]'
 PASS TimeRanges.toString() is '[object TimeRangesConstructor]'
+PASS Touch.toString() is '[object TouchConstructor]'
 PASS TouchEvent.toString() is '[object TouchEventConstructor]'
+PASS TouchList.toString() is '[object TouchListConstructor]'
 PASS UIEvent.toString() is '[object UIEventConstructor]'
 PASS URL.toString() is '[object URLConstructor]'
 PASS WebGLContextEvent.toString() is '[object WebGLContextEventConstructor]'

Modified: trunk/Source/WebCore/ChangeLog (138842 => 138843)


--- trunk/Source/WebCore/ChangeLog	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/Source/WebCore/ChangeLog	2013-01-04 21:12:58 UTC (rev 138843)
@@ -1,3 +1,24 @@
+2013-01-04  Rick Byers  <rby...@chromium.org>
+
+        window.Touch and TouchList should exist when touch events are enabled
+        https://bugs.webkit.org/show_bug.cgi?id=96295
+
+        Reviewed by Kentaro Hara.
+
+        Add missing window.Touch and window.TouchList constructors under
+        ENABLE(TOUCH_EVENTS).
+
+        Make window.Touch, window.TouchList and window.TouchEvent enabled at runtime
+        under V8, to be consistent with all the other touch-related APIs.
+
+        Tests: fast/events/touch/document-create-touch-list.html
+           fast/js/global-constructors.html
+
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        * dom/Document.idl:
+        * dom/Element.idl:
+        * page/DOMWindow.idl:
+
 2013-01-04  Adam Klein  <ad...@chromium.org>
 
         [v8] Stop using an IDL to generate V8MutationCallback

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (138842 => 138843)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2013-01-04 21:12:58 UTC (rev 138843)
@@ -129,12 +129,6 @@
 #if ENABLE(TOUCH_EVENTS)
     static bool touchEnabled() { return isTouchEnabled; }
     static void setTouchEnabled(bool isEnabled) { isTouchEnabled = isEnabled; }
-    static bool ontouchstartEnabled() { return isTouchEnabled; }
-    static bool ontouchmoveEnabled() { return isTouchEnabled; }
-    static bool ontouchendEnabled() { return isTouchEnabled; }
-    static bool ontouchcancelEnabled() { return isTouchEnabled; }
-    static bool createTouchEnabled() { return isTouchEnabled; }
-    static bool createTouchListEnabled() { return isTouchEnabled; }
 #endif
 
     static void setDeviceMotionEnabled(bool isEnabled) { isDeviceMotionEnabled = isEnabled; }

Modified: trunk/Source/WebCore/dom/Document.idl (138842 => 138843)


--- trunk/Source/WebCore/dom/Document.idl	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/Source/WebCore/dom/Document.idl	2013-01-04 21:12:58 UTC (rev 138843)
@@ -329,10 +329,10 @@
     [NotEnumerable] attribute EventListener onsearch;
     [NotEnumerable] attribute EventListener onselectstart;
     [NotEnumerable] attribute EventListener onselectionchange;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchstart;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchmove;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchend;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchcancel;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchstart;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchmove;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchend;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchcancel;
     [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenchange;
     [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror;
     [NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockchange;
@@ -340,7 +340,7 @@
 #endif
 
 #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-    [ReturnNewObject, V8EnabledAtRuntime] Touch createTouch(in [Optional=DefaultIsUndefined] DOMWindow window,
+    [ReturnNewObject, V8EnabledAtRuntime=touch] Touch createTouch(in [Optional=DefaultIsUndefined] DOMWindow window,
                                                      in [Optional=DefaultIsUndefined] EventTarget target,
                                                      in [Optional=DefaultIsUndefined] long identifier,
                                                      in [Optional=DefaultIsUndefined] long pageX,
@@ -352,7 +352,7 @@
                                                      in [Optional=DefaultIsUndefined] float webkitRotationAngle,
                                                      in [Optional=DefaultIsUndefined] float webkitForce)
         raises (DOMException);
-    [ReturnNewObject, V8EnabledAtRuntime, Custom] TouchList createTouchList()
+    [ReturnNewObject, V8EnabledAtRuntime=touch, Custom] TouchList createTouchList()
         raises (DOMException);
 #endif
 

Modified: trunk/Source/WebCore/dom/Element.idl (138842 => 138843)


--- trunk/Source/WebCore/dom/Element.idl	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/Source/WebCore/dom/Element.idl	2013-01-04 21:12:58 UTC (rev 138843)
@@ -218,10 +218,10 @@
     [NotEnumerable] attribute EventListener onreset;
     [NotEnumerable] attribute EventListener onsearch;
     [NotEnumerable] attribute EventListener onselectstart;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchstart;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchmove;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchend;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchcancel;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchstart;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchmove;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchend;
+    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] attribute EventListener ontouchcancel;
     [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenchange;
     [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror;
 #endif

Modified: trunk/Source/WebCore/page/DOMWindow.idl (138842 => 138843)


--- trunk/Source/WebCore/page/DOMWindow.idl	2013-01-04 21:04:52 UTC (rev 138842)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2013-01-04 21:12:58 UTC (rev 138843)
@@ -300,10 +300,10 @@
 #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
     attribute EventListener onorientationchange;
 #endif
-    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchstart;
-    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchmove;
-    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchend;
-    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchcancel;
+    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] EventListener ontouchstart;
+    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] EventListener ontouchmove;
+    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] EventListener ontouchend;
+    attribute [Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch] EventListener ontouchcancel;
 
     attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondevicemotion;
     attribute [Conditional=DEVICE_ORIENTATION,V8EnabledAtRuntime] EventListener ondeviceorientation;
@@ -556,7 +556,9 @@
     attribute XMLHttpRequestProgressEventConstructor XMLHttpRequestProgressEvent;
     [Conditional=DEVICE_ORIENTATION, V8EnabledAtRuntime] attribute DeviceMotionEventConstructor DeviceMotionEvent;
     [Conditional=DEVICE_ORIENTATION, V8EnabledAtRuntime] attribute DeviceOrientationEventConstructor DeviceOrientationEvent;
-    [Conditional=TOUCH_EVENTS] attribute TouchEventConstructor TouchEvent;
+    [Conditional=TOUCH_EVENTS, V8EnabledAtRuntime=touch] attribute TouchConstructor Touch;
+    [Conditional=TOUCH_EVENTS, V8EnabledAtRuntime=touch] attribute TouchEventConstructor TouchEvent;
+    [Conditional=TOUCH_EVENTS, V8EnabledAtRuntime=touch] attribute TouchListConstructor TouchList;
     attribute StorageEventConstructor StorageEvent;
     [Conditional=INPUT_SPEECH] attribute SpeechInputEventConstructor SpeechInputEvent;
     [Conditional=WEBGL] attribute WebGLContextEventConstructor WebGLContextEvent;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to