Title: [141797] trunk/Source/WebKit/blackberry
Revision
141797
Author
[email protected]
Date
2013-02-04 13:12:35 -0800 (Mon, 04 Feb 2013)

Log Message

[BlackBerry]Adjust fatfinger detection rect size
https://bugs.webkit.org/show_bug.cgi?id=108678

Patch by Tiancheng Jiang <[email protected]> on 2013-02-04
Reviewed by Antonio Gomes.
RIM Bug 246976

We still need to clip the fatfinger detection rect to the viewport to
avoid wrong hitTest result.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::mouseEvent):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getNodesFromRect):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (141796 => 141797)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-02-04 21:11:27 UTC (rev 141796)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-02-04 21:12:35 UTC (rev 141797)
@@ -3934,14 +3934,14 @@
         buttonType = MiddleButton;
 
     // Create our event.
-    PlatformMouseEvent platformMouseEvent(d->mapFromTransformed(mouseEvent.position()), mouseEvent.screenPosition(),
+    PlatformMouseEvent platformMouseEvent(mouseEvent.documentViewportPosition(), mouseEvent.screenPosition(),
         toWebCoreMouseEventType(mouseEvent.type()), clickCount, buttonType,
         mouseEvent.shiftActive(), mouseEvent.ctrlActive(), mouseEvent.altActive(), PointingDevice);
     d->m_lastMouseEvent = platformMouseEvent;
     bool success = d->handleMouseEvent(platformMouseEvent);
 
     if (mouseEvent.wheelTicks()) {
-        PlatformWheelEvent wheelEvent(d->mapFromTransformed(mouseEvent.position()), mouseEvent.screenPosition(),
+        PlatformWheelEvent wheelEvent(mouseEvent.documentViewportPosition(), mouseEvent.screenPosition(),
             0, -mouseEvent.wheelDelta(),
             0, -mouseEvent.wheelTicks(),
             ScrollByPixelWheelEvent,

Modified: trunk/Source/WebKit/blackberry/ChangeLog (141796 => 141797)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-02-04 21:11:27 UTC (rev 141796)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-02-04 21:12:35 UTC (rev 141797)
@@ -1,3 +1,19 @@
+2013-02-04  Tiancheng Jiang  <[email protected]>
+
+        [BlackBerry]Adjust fatfinger detection rect size
+        https://bugs.webkit.org/show_bug.cgi?id=108678
+
+        Reviewed by Antonio Gomes.
+        RIM Bug 246976
+
+        We still need to clip the fatfinger detection rect to the viewport to
+        avoid wrong hitTest result.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPage::mouseEvent):
+        * WebKitSupport/FatFingers.cpp:
+        (BlackBerry::WebKit::FatFingers::getNodesFromRect):
+
 2013-02-04  Abhishek Arya  <[email protected]>
 
         Add ASSERT_WITH_SECURITY_IMPLICATION to detect bad cast in DOM, CSS, etc.

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp (141796 => 141797)


--- trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp	2013-02-04 21:11:27 UTC (rev 141796)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp	2013-02-04 21:12:35 UTC (rev 141797)
@@ -278,7 +278,11 @@
 
     // Create fingerRect.
     IntPoint frameContentPos(document->frame()->view()->windowToContents(m_webPage->m_mainFrame->view()->contentsToWindow(m_contentPos)));
+    IntRect viewportRect = m_webPage->mainFrame()->view()->visibleContentRect();
 
+    // Ensure the frameContentPos is inside the viewport.
+    frameContentPos = Platform::pointClampedToRect(frameContentPos, viewportRect);
+
 #if DEBUG_FAT_FINGERS
     IntRect fingerRect(fingerRectForPoint(frameContentPos));
     Platform::IntRect screenFingerRect = m_webPage->mapToTransformed(fingerRect);
@@ -445,7 +449,7 @@
 
     // The user functions checkForText() and findIntersectingRegions() uses the Node.wholeText() to checkFingerIntersection()
     // not the text in its shadow tree.
-    HitTestRequest::HitTestRequestType requestType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping;
+    HitTestRequest::HitTestRequestType requestType = HitTestRequest::ReadOnly | HitTestRequest::Active;
     if (m_targetType == Text)
         requestType |= HitTestRequest::AllowShadowContent;
     HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to