Add a parameter to handletTouchPoint to bypass FatFingers
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2012 20:13:57 +0000 (20:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2012 20:13:57 +0000 (20:13 +0000)
on touch up. There are some cases where the user may drag
their finger off the element and we want to use the actual
touch point instead of the FatFingers adjusted point.
https://bugs.webkit.org/show_bug.cgi?id=89677

Patch by Genevieve Mak <gmak@rim.com> on 2012-06-21
Reviewed by Antonio Gomes.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::touchPointAsMouseEvent):
* Api/WebPage.h:
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
* WebKitSupport/TouchEventHandler.h:
(TouchEventHandler):

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

Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/Api/WebPage.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h

index 516b2c7..c6c3d64 100644 (file)
@@ -4165,7 +4165,7 @@ bool WebPagePrivate::dispatchTouchEventToFullScreenPlugin(PluginView* plugin, co
     return handled;
 }
 
-bool WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point)
+bool WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point, bool useFatFingers)
 {
     if (d->m_page->defersLoading())
         return false;
@@ -4180,7 +4180,7 @@ bool WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point)
     tPoint.m_pos = d->mapFromTransformed(tPoint.m_pos);
     tPoint.m_screenPos = d->mapFromTransformed(tPoint.m_screenPos);
 
-    return d->m_touchEventHandler->handleTouchPoint(tPoint);
+    return d->m_touchEventHandler->handleTouchPoint(tPoint, useFatFingers);
 }
 
 bool WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin(PluginView* pluginView, const Platform::TouchPoint& point)
index ca8f84e..eb38583 100644 (file)
@@ -139,7 +139,7 @@ public:
 
     // For conversion to mouse events.
     void touchEventCancel();
-    bool touchPointAsMouseEvent(const Platform::TouchPoint&);
+    bool touchPointAsMouseEvent(const Platform::TouchPoint&, bool useFatFingers = true);
 
     // Returns true if the key stroke was handled by WebKit.
     bool keyEvent(const Platform::KeyboardEvent&);
index a17285f..f74b42f 100644 (file)
@@ -1,3 +1,21 @@
+2012-06-21  Genevieve Mak  <gmak@rim.com>
+
+        Add a parameter to handletTouchPoint to bypass FatFingers
+        on touch up. There are some cases where the user may drag
+        their finger off the element and we want to use the actual
+        touch point instead of the FatFingers adjusted point.
+        https://bugs.webkit.org/show_bug.cgi?id=89677
+
+        Reviewed by Antonio Gomes.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPage::touchPointAsMouseEvent):
+        * Api/WebPage.h:
+        * WebKitSupport/TouchEventHandler.cpp:
+        (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+        * WebKitSupport/TouchEventHandler.h:
+        (TouchEventHandler):
+
 2012-06-21  Mike Fenton  <mifenton@rim.com>
 
         [BlackBerry] Input mode should adapt automatically to settings changes
index f7c731d..c8668be 100644 (file)
@@ -168,7 +168,7 @@ void TouchEventHandler::touchHoldEvent()
         m_webPage->clearFocusNode();
 }
 
-bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point)
+bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFatFingers)
 {
     // Enable input mode on any touch event.
     m_webPage->m_inputHandler->setInputModeEnabled();
@@ -177,6 +177,7 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point)
     switch (point.m_state) {
     case Platform::TouchPoint::TouchPressed:
         {
+            // FIXME: bypass FatFingers if useFatFingers is false
             m_lastFatFingersResult.reset(); // Theoretically this shouldn't be required. Keep it just in case states get mangled.
             m_didCancelTouch = false;
             m_lastScreenPoint = point.m_screenPos;
@@ -229,7 +230,7 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point)
                 m_webPage->m_inputHandler->notifyClientOfKeyboardVisibilityChange(true);
 
             IntPoint adjustedPoint;
-            if (m_convertTouchToMouse) {
+            if (m_convertTouchToMouse || !useFatFingers) {
                 adjustedPoint = point.m_pos;
                 m_convertTouchToMouse = pureWithMouseConversion;
             } else // Fat finger point in viewport coordinates.
index 3bcdd87..91c7f16 100644 (file)
@@ -35,7 +35,7 @@ public:
     TouchEventHandler(WebPagePrivate* webpage);
     ~TouchEventHandler();
 
-    bool handleTouchPoint(Platform::TouchPoint&);
+    bool handleTouchPoint(Platform::TouchPoint&, bool useFatFingers);
     void touchEventCancel();
     void touchHoldEvent();