[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

chang.shu at nokia.com chang.shu at nokia.com
Fri Jan 21 15:11:47 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 9e7d7b2bfda9f6c8752c4fdc7235399c25fa3368
Author: chang.shu at nokia.com <chang.shu at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jan 9 01:08:41 2011 +0000

    2011-01-08  Chang Shu  <chang.shu at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Support createTouchList with Touch list for test automation.
            https://bugs.webkit.org/show_bug.cgi?id=51196
    
            Added test cases that take Touch objects when creating TouchList.
    
            * fast/events/touch/document-create-touch-list-expected.txt:
            * fast/events/touch/script-tests/document-create-touch-list.js:
    2011-01-08  Chang Shu  <chang.shu at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Support createTouchList with Touch list for test automation.
            Implemented JS/V8 custom functions for createTouchList.
            https://bugs.webkit.org/show_bug.cgi?id=51196
    
            * bindings/js/JSDocumentCustom.cpp:
            (WebCore::JSDocument::createTouchList):
            * bindings/v8/custom/V8DocumentCustom.cpp:
            (WebCore::V8Document::createTouchListCallback):
            * dom/Document.idl:
            * dom/TouchEvent.cpp:
            (WebCore::TouchEvent::initTouchEvent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75335 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 15e8e57..6a7743e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,17 @@
 2011-01-08  Chang Shu  <chang.shu at nokia.com>
 
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Support createTouchList with Touch list for test automation.
+        https://bugs.webkit.org/show_bug.cgi?id=51196
+
+        Added test cases that take Touch objects when creating TouchList.
+
+        * fast/events/touch/document-create-touch-list-expected.txt:
+        * fast/events/touch/script-tests/document-create-touch-list.js:
+
+2011-01-08  Chang Shu  <chang.shu at nokia.com>
+
         Reviewed by Ryosuke Niwa.
 
         Added test contents for contentEditable DOM attribute.
diff --git a/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt b/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
index 99d578c..c664b2a 100644
--- a/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
+++ b/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
@@ -8,6 +8,11 @@ PASS touchList is non-null.
 PASS touchList.length is 0
 PASS touchList.item(0) is null
 PASS touchList.item(1) is null
+PASS ts.touches.length is 2
+PASS ts.touches[0].identifier is 12341
+PASS ts.touches[0].clientX is 60
+PASS ts.touches[1].screenY is 120
+PASS ts.ctrlKey is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js b/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
index 9c87c9a..526badc 100644
--- a/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
+++ b/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
@@ -2,11 +2,43 @@ description("This tests support for the document.createTouchList API.");
 
 shouldBeTrue('"createTouchList" in document');
 
+// Test createTouchList with no arguments.
 var touchList = document.createTouchList();
 shouldBeNonNull("touchList");
 shouldBe("touchList.length", "0");
 shouldBeNull("touchList.item(0)");
 shouldBeNull("touchList.item(1)");
 
+// Test createTouchList with Touch objects as arguments.
+try {
+    var t = document.createTouch(window, document.body, 12341, 60, 65, 100, 105);
+    var t2 = document.createTouch(window, document.body, 12342, 50, 55, 115, 120);
+    var tl = document.createTouchList(t, t2);
+
+    var evt = document.createEvent("TouchEvent");
+    evt.initTouchEvent(tl, tl, tl, "touchstart", window, 0, 0, 0, 0, true, false, false, false);
+
+    document.body.addEventListener("touchstart", function handleTouchStart(ev) {
+        ts = ev;
+        shouldBe("ts.touches.length", "2");
+        shouldBe("ts.touches[0].identifier", "12341");
+        shouldBe("ts.touches[0].clientX", "60");
+        shouldBe("ts.touches[1].screenY", "120");
+        shouldBe("ts.ctrlKey", "true");
+    });
+
+    document.body.dispatchEvent(evt);
+} catch(e) {
+    testFailed("An exception was thrown: " + e.message);
+}
+
+// Test createTouchList with invalid arguments which throws exceptions.
+try {
+    var tl = document.createTouchList(1, 2);
+} catch(e) {
+    testFailed("An exception was thrown: " + e.message);
+}
+
 successfullyParsed = true;
 isSuccessfullyParsed();
+
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 04ec2f4..efb9061 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2011-01-08  Chang Shu  <chang.shu at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Support createTouchList with Touch list for test automation.
+        Implemented JS/V8 custom functions for createTouchList.
+        https://bugs.webkit.org/show_bug.cgi?id=51196
+
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::JSDocument::createTouchList):
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        (WebCore::V8Document::createTouchListCallback):
+        * dom/Document.idl:
+        * dom/TouchEvent.cpp:
+        (WebCore::TouchEvent::initTouchEvent):
+
 2011-01-08  Benjamin Poulain  <benjamin.poulain at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/Source/WebCore/bindings/js/JSDocumentCustom.cpp b/Source/WebCore/bindings/js/JSDocumentCustom.cpp
index 5f61e2a..4cc176c 100644
--- a/Source/WebCore/bindings/js/JSDocumentCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDocumentCustom.cpp
@@ -31,8 +31,11 @@
 #include "JSDOMWindowCustom.h"
 #include "JSHTMLDocument.h"
 #include "JSLocation.h"
+#include "JSTouch.h"
+#include "JSTouchList.h"
 #include "Location.h"
 #include "ScriptController.h"
+#include "TouchList.h"
 
 #if ENABLE(SVG)
 #include "JSSVGDocument.h"
@@ -124,4 +127,16 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* documen
     return wrapper;
 }
 
+#if ENABLE(TOUCH_EVENTS)
+JSValue JSDocument::createTouchList(ExecState* exec)
+{
+    RefPtr<TouchList> touchList = TouchList::create();
+
+    for (int i = 0; i < exec->argumentCount(); i++)
+        touchList->append(toTouch(exec->argument(i)));
+
+    return toJS(exec, touchList.release());
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
index 9fa9f80..cda0737 100644
--- a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
@@ -35,6 +35,7 @@
 #include "Document.h"
 #include "ExceptionCode.h"
 #include "Node.h"
+#include "TouchList.h"
 #include "XPathNSResolver.h"
 #include "XPathResult.h"
 
@@ -46,6 +47,8 @@
 #include "V8IsolatedContext.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
+#include "V8Touch.h"
+#include "V8TouchList.h"
 #if ENABLE(3D_CANVAS)
 #include "V8WebGLRenderingContext.h"
 #endif
@@ -163,4 +166,19 @@ v8::Handle<v8::Value> toV8(Document* impl, bool forceNewObject)
     return wrapper;
 }
 
+#if ENABLE(TOUCH_EVENTS)
+v8::Handle<v8::Value> V8Document::createTouchListCallback(const v8::Arguments& args)
+{
+    RefPtr<TouchList> touchList = TouchList::create();
+
+    for (int i = 0; i < args.Length(); i++) {
+        if (!args[i]->IsObject())
+            return v8::Undefined();
+        touchList->append(V8Touch::toNative(args[i]->ToObject()));
+    }
+
+    return toV8(touchList.release());
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/WebCore/dom/Document.idl b/Source/WebCore/dom/Document.idl
index 89f53ec..8d7a71b 100644
--- a/Source/WebCore/dom/Document.idl
+++ b/Source/WebCore/dom/Document.idl
@@ -333,7 +333,7 @@ module core {
                                                          in long ScreenX,
                                                          in long screenY)
             raises (DOMException);
-        [ReturnsNew, EnabledAtRuntime] TouchList createTouchList()
+        [ReturnsNew, EnabledAtRuntime, Custom] TouchList createTouchList()
             raises (DOMException);
 #endif
 
diff --git a/Source/WebCore/dom/TouchEvent.cpp b/Source/WebCore/dom/TouchEvent.cpp
index 88d3e6f..225e3ae 100644
--- a/Source/WebCore/dom/TouchEvent.cpp
+++ b/Source/WebCore/dom/TouchEvent.cpp
@@ -61,6 +61,9 @@ void TouchEvent::initTouchEvent(TouchList* touches, TouchList* targetTouches,
 
     initUIEvent(type, true, true, view, 0);
 
+    m_touches = touches;
+    m_targetTouches = targetTouches;
+    m_changedTouches = changedTouches;
     m_screenX = screenX;
     m_screenY = screenY;
     m_ctrlKey = ctrlKey;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list