Title: [89212] trunk
Revision
89212
Author
[email protected]
Date
2011-06-18 21:13:49 -0700 (Sat, 18 Jun 2011)

Log Message

2011-06-18  Yufeng Shen  <[email protected]>

        Reviewed by Darin Fisher.

        Adding "force" filed to Touch Event
        https://bugs.webkit.org/show_bug.cgi?id=62766

        * fast/events/touch/document-create-touch-expected.txt:
        * fast/events/touch/script-tests/document-create-touch.js:
2011-06-18  Yufeng Shen  <[email protected]>

        Reviewed by Darin Fisher.

        Adding "force" filed to Touch Event
        https://bugs.webkit.org/show_bug.cgi?id=62766

        * dom/Document.cpp:
        (WebCore::Document::createTouch):
        * dom/Document.h:
        * dom/Document.idl:
        * dom/Touch.cpp:
        (WebCore::Touch::Touch):
        * dom/Touch.h:
        (WebCore::Touch::create):
        (WebCore::Touch::webkitForce):
        * dom/Touch.idl:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleTouchEvent):
        * platform/PlatformTouchPoint.h:
        (WebCore::PlatformTouchPoint::force):
2011-06-18  Yufeng Shen  <[email protected]>

        Reviewed by Darin Fisher.

        Adding "force" filed to Touch Event
        https://bugs.webkit.org/show_bug.cgi?id=62766

        * public/WebTouchPoint.h:
        (WebKit::WebTouchPoint::WebTouchPoint):
        * src/WebInputEventConversion.cpp:
        (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89211 => 89212)


--- trunk/LayoutTests/ChangeLog	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/LayoutTests/ChangeLog	2011-06-19 04:13:49 UTC (rev 89212)
@@ -1,3 +1,13 @@
+2011-06-18  Yufeng Shen  <[email protected]>
+
+        Reviewed by Darin Fisher.
+
+        Adding "force" filed to Touch Event
+        https://bugs.webkit.org/show_bug.cgi?id=62766
+
+        * fast/events/touch/document-create-touch-expected.txt:
+        * fast/events/touch/script-tests/document-create-touch.js:
+
 2011-06-18  Alice Boxhall  <[email protected]>
 
         Reviewed by Chris Fleizach.

Modified: trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt (89211 => 89212)


--- trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/LayoutTests/fast/events/touch/document-create-touch-expected.txt	2011-06-19 04:13:49 UTC (rev 89212)
@@ -14,6 +14,7 @@
 PASS touch.webkitRadiusX is 5
 PASS touch.webkitRadiusY is 3
 PASS touch.webkitRotationAngle is 10
+PASS touch.webkitForce is 10
 PASS emptyTouch is non-null.
 PASS emptyTouch.target is null
 PASS emptyTouch.identifier is 0
@@ -24,6 +25,7 @@
 PASS emptyTouch.webkitRadiusX is 0
 PASS emptyTouch.webkitRadiusY is 0
 PASS emptyTouch.webkitRotationAngle is NaN
+PASS emptyTouch.webkitForce is NaN
 PASS badParamsTouch is non-null.
 PASS badParamsTouch.target is null
 PASS badParamsTouch.identifier is 0
@@ -34,6 +36,7 @@
 PASS badParamsTouch.webkitRadiusX is 0
 PASS badParamsTouch.webkitRadiusY is 0
 PASS badParamsTouch.webkitRotationAngle is NaN
+PASS badParamsTouch.webkitForce is NaN
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js (89211 => 89212)


--- trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/LayoutTests/fast/events/touch/script-tests/document-create-touch.js	2011-06-19 04:13:49 UTC (rev 89212)
@@ -9,7 +9,7 @@
 document.body.appendChild(box);
 
 var target = document.getElementById("box");
-var touch = document.createTouch(window, target, 1, 100, 101, 102, 103, 5, 3, 10);
+var touch = document.createTouch(window, target, 1, 100, 101, 102, 103, 5, 3, 10, 10);
 shouldBeNonNull("touch");
 shouldBe("touch.target", "box");
 shouldBe("touch.identifier", "1");
@@ -20,6 +20,7 @@
 shouldBe("touch.webkitRadiusX", "5");
 shouldBe("touch.webkitRadiusY", "3");
 shouldBe("touch.webkitRotationAngle", "10");
+shouldBe("touch.webkitForce", "10");
 
 var emptyTouch = document.createTouch();
 shouldBeNonNull("emptyTouch");
@@ -32,9 +33,10 @@
 shouldBe("emptyTouch.webkitRadiusX", "0");
 shouldBe("emptyTouch.webkitRadiusY", "0");
 shouldBeNaN("emptyTouch.webkitRotationAngle");
+shouldBeNaN("emptyTouch.webkitForce");
 
 // Try invoking with incorrect parameter types.
-var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104, 'a', 'b', 'c');
+var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104, 'a', 'b', 'c', 'd');
 shouldBeNonNull("badParamsTouch");
 shouldBeNull("badParamsTouch.target");
 shouldBe("badParamsTouch.identifier", "0");
@@ -45,6 +47,7 @@
 shouldBe("badParamsTouch.webkitRadiusX", "0");
 shouldBe("badParamsTouch.webkitRadiusY", "0");
 shouldBeNaN("badParamsTouch.webkitRotationAngle");
+shouldBeNaN("badParamsTouch.webkitForce");
 
 successfullyParsed = true;
 isSuccessfullyParsed();

Modified: trunk/Source/WebCore/ChangeLog (89211 => 89212)


--- trunk/Source/WebCore/ChangeLog	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/ChangeLog	2011-06-19 04:13:49 UTC (rev 89212)
@@ -1,3 +1,25 @@
+2011-06-18  Yufeng Shen  <[email protected]>
+
+        Reviewed by Darin Fisher.
+
+        Adding "force" filed to Touch Event
+        https://bugs.webkit.org/show_bug.cgi?id=62766
+
+        * dom/Document.cpp:
+        (WebCore::Document::createTouch):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * dom/Touch.cpp:
+        (WebCore::Touch::Touch):
+        * dom/Touch.h:
+        (WebCore::Touch::create):
+        (WebCore::Touch::webkitForce):
+        * dom/Touch.idl:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleTouchEvent):
+        * platform/PlatformTouchPoint.h:
+        (WebCore::PlatformTouchPoint::force):
+
 2011-06-18  Jer Noble  <[email protected]>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/dom/Document.cpp (89211 => 89212)


--- trunk/Source/WebCore/dom/Document.cpp	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-06-19 04:13:49 UTC (rev 89212)
@@ -4986,7 +4986,7 @@
 #endif
 
 #if ENABLE(TOUCH_EVENTS)
-PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, ExceptionCode&) const
+PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const
 {
     // FIXME: It's not clear from the documentation at
     // http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
@@ -4994,7 +4994,7 @@
     // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=47819
     // Ditto for the createTouchList method below.
     Frame* frame = window ? window->frame() : this->frame();
-    return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY, radiusX, radiusY, rotationAngle);
+    return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY, radiusX, radiusY, rotationAngle, force);
 }
 
 PassRefPtr<TouchList> Document::createTouchList(ExceptionCode&) const

Modified: trunk/Source/WebCore/dom/Document.h (89211 => 89212)


--- trunk/Source/WebCore/dom/Document.h	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/dom/Document.h	2011-06-19 04:13:49 UTC (rev 89212)
@@ -1064,7 +1064,7 @@
     bool isDelayingLoadEvent() const { return m_loadEventDelayCount; }
 
 #if ENABLE(TOUCH_EVENTS)
-    PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, ExceptionCode&) const;
+    PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const;
     PassRefPtr<TouchList> createTouchList(ExceptionCode&) const;
 #endif
 

Modified: trunk/Source/WebCore/dom/Document.idl (89211 => 89212)


--- trunk/Source/WebCore/dom/Document.idl	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/dom/Document.idl	2011-06-19 04:13:49 UTC (rev 89212)
@@ -327,7 +327,8 @@
                                                          in long screenY,
                                                          in long webkitRadiusX,
                                                          in long webkitRadiusY,
-                                                         in float webkitRotationAngle)
+                                                         in float webkitRotationAngle,
+                                                         in float webkitForce)
             raises (DOMException);
         [ReturnsNew, EnabledAtRuntime, Custom] TouchList createTouchList()
             raises (DOMException);

Modified: trunk/Source/WebCore/dom/Touch.cpp (89211 => 89212)


--- trunk/Source/WebCore/dom/Touch.cpp	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/dom/Touch.cpp	2011-06-19 04:13:49 UTC (rev 89212)
@@ -54,7 +54,7 @@
     return frameView->scrollY() / frame->pageZoomFactor();
 }
 
-Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY, int radiusX, int radiusY, float rotationAngle)
+Touch::Touch(Frame* frame, EventTarget* target, unsigned identifier, int screenX, int screenY, int pageX, int pageY, int radiusX, int radiusY, float rotationAngle, float force)
     : m_target(target)
     , m_identifier(identifier)
     , m_clientX(pageX - contentsX(frame))
@@ -66,6 +66,7 @@
     , m_radiusX(radiusX)
     , m_radiusY(radiusY)
     , m_rotationAngle(rotationAngle)
+    , m_force(force)
 {
 }
 

Modified: trunk/Source/WebCore/dom/Touch.h (89211 => 89212)


--- trunk/Source/WebCore/dom/Touch.h	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/dom/Touch.h	2011-06-19 04:13:49 UTC (rev 89212)
@@ -41,10 +41,10 @@
 public:
     static PassRefPtr<Touch> create(Frame* frame, EventTarget* target,
             unsigned identifier, int screenX, int screenY, int pageX, int pageY,
-            int radiusX, int radiusY, float rotationAngle)
+            int radiusX, int radiusY, float rotationAngle, float force)
     {
         return adoptRef(new Touch(frame, target, identifier, screenX, 
-                screenY, pageX, pageY, radiusX, radiusY, rotationAngle));
+                screenY, pageX, pageY, radiusX, radiusY, rotationAngle, force));
     }
 
     EventTarget* target() const { return m_target.get(); }
@@ -58,11 +58,12 @@
     int webkitRadiusX() const { return m_radiusX; }
     int webkitRadiusY() const { return m_radiusY; }
     float webkitRotationAngle() const { return m_rotationAngle; }
+    float webkitForce() const { return m_force; }
 
 private:
     Touch(Frame* frame, EventTarget* target, unsigned identifier,
             int screenX, int screenY, int pageX, int pageY,
-            int radiusX, int radiusY, float rotationAngle);
+            int radiusX, int radiusY, float rotationAngle, float force);
 
     RefPtr<EventTarget> m_target;
     unsigned m_identifier;
@@ -75,6 +76,7 @@
     int m_radiusX;
     int m_radiusY;
     float m_rotationAngle;
+    float m_force;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/Touch.idl (89211 => 89212)


--- trunk/Source/WebCore/dom/Touch.idl	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/dom/Touch.idl	2011-06-19 04:13:49 UTC (rev 89212)
@@ -40,5 +40,6 @@
         readonly attribute int              webkitRadiusX;
         readonly attribute int              webkitRadiusY;
         readonly attribute float            webkitRotationAngle;
+        readonly attribute float            webkitForce;
     };
 }

Modified: trunk/Source/WebCore/page/EventHandler.cpp (89211 => 89212)


--- trunk/Source/WebCore/page/EventHandler.cpp	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2011-06-19 04:13:49 UTC (rev 89212)
@@ -3227,7 +3227,7 @@
         RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
                                             point.screenPos().x(), point.screenPos().y(),
                                             adjustedPageX, adjustedPageY,
-                                            point.radiusX(), point.radiusY(), point.rotationAngle());
+                                            point.radiusX(), point.radiusY(), point.rotationAngle(), point.force());
 
         // Ensure this target's touch list exists, even if it ends up empty, so it can always be passed to TouchEvent::Create below.
         TargetTouchesMap::iterator targetTouchesIterator = touchesByTarget.find(touchTarget.get());

Modified: trunk/Source/WebCore/platform/PlatformTouchPoint.h (89211 => 89212)


--- trunk/Source/WebCore/platform/PlatformTouchPoint.h	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebCore/platform/PlatformTouchPoint.h	2011-06-19 04:13:49 UTC (rev 89212)
@@ -62,6 +62,7 @@
     int radiusX() const { return m_radiusX; }
     int radiusY() const { return m_radiusY; }
     float rotationAngle() const { return m_rotationAngle; }
+    float force() const { return m_force; }
 
 protected:
     unsigned m_id;
@@ -71,6 +72,7 @@
     int m_radiusY;
     int m_radiusX;
     float m_rotationAngle;
+    float m_force;
 };
 
 }

Modified: trunk/Source/WebKit/chromium/ChangeLog (89211 => 89212)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-06-19 04:13:49 UTC (rev 89212)
@@ -1,3 +1,15 @@
+2011-06-18  Yufeng Shen  <[email protected]>
+
+        Reviewed by Darin Fisher.
+
+        Adding "force" filed to Touch Event
+        https://bugs.webkit.org/show_bug.cgi?id=62766
+
+        * public/WebTouchPoint.h:
+        (WebKit::WebTouchPoint::WebTouchPoint):
+        * src/WebInputEventConversion.cpp:
+        (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder):
+
 2011-06-17  Chris Rogers  <[email protected]>
 
         Unreviewed build fix.

Modified: trunk/Source/WebKit/chromium/public/WebTouchPoint.h (89211 => 89212)


--- trunk/Source/WebKit/chromium/public/WebTouchPoint.h	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebKit/chromium/public/WebTouchPoint.h	2011-06-19 04:13:49 UTC (rev 89212)
@@ -50,6 +50,7 @@
         , radiusX(0)
         , radiusY(0)
         , rotationAngle(0)
+        , force(0)
     {
     }
 
@@ -70,6 +71,7 @@
     int radiusX;
     int radiusY;
     float rotationAngle;
+    float force;
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp (89211 => 89212)


--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp	2011-06-19 03:44:03 UTC (rev 89211)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp	2011-06-19 04:13:49 UTC (rev 89212)
@@ -215,6 +215,7 @@
     m_radiusY = point.radiusY;
     m_radiusX = point.radiusX;
     m_rotationAngle = point.rotationAngle;
+    m_force = point.force;
 }
 
 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTouchEvent& event)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to