[BlackBerry] FatFinger pairs the wrong element with fatfinger rect part.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 17:54:31 +0000 (17:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 17:54:31 +0000 (17:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111444

Patch by Tiancheng Jiang <tijiang@rim.com> on 2013-03-05
Reviewed by Rob Buis.

Internal PR 266214
Internally reviewed by Genevieve Mak.

Instead of subtracting with the element region, we should get the remaining
rect by find the intersect region of element region and fatfinger detection
region.

* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::checkForClickableElement):

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

Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp

index 77274c5..eae1642 100644 (file)
@@ -1,3 +1,21 @@
+2013-03-05  Tiancheng Jiang  <tijiang@rim.com>
+
+        [BlackBerry] FatFinger pairs the wrong element with fatfinger rect part.
+        https://bugs.webkit.org/show_bug.cgi?id=111444
+
+        Reviewed by Rob Buis.
+
+        Internal PR 266214
+        Internally reviewed by Genevieve Mak.
+
+        Instead of subtracting with the element region, we should get the remaining
+        rect by find the intersect region of element region and fatfinger detection
+        region.
+
+
+        * WebKitSupport/FatFingers.cpp:
+        (BlackBerry::WebKit::FatFingers::checkForClickableElement):
+
 2013-03-05  Andrew Lo  <anlo@rim.com>
 
         [BlackBerry] Clean up animated scroll/zoom code in WebPagePrivate
index 03d515e..9ac978e 100644 (file)
@@ -374,12 +374,12 @@ bool FatFingers::checkForClickableElement(Element* curElement,
         if (curElementRenderLayer != lowestPositionedEnclosingLayerSoFar) {
 
             // elementRegion will always be in contents coordinates of its container frame. It needs to be
-            // mapped to main frame contents coordinates in order to subtract the fingerRegion, then.
+            // mapped to main frame contents coordinates in order to intersect the fingerRegion, then.
             WebCore::IntPoint framePos(m_webPage->frameOffset(curElement->document()->frame()));
             IntRectRegion layerRegion(Platform::IntRect(lowestPositionedEnclosingLayerSoFar->renderer()->absoluteBoundingBoxRect(true/*use transforms*/)));
             layerRegion.move(framePos.x(), framePos.y());
 
-            remainingFingerRegion = subtractRegions(remainingFingerRegion, layerRegion);
+            remainingFingerRegion = intersectRegions(remainingFingerRegion, layerRegion);
 
             lowestPositionedEnclosingLayerSoFar = curElementRenderLayer;
         }