Title: [113195] trunk/Source/WebKit2
Revision
113195
Author
[email protected]
Date
2012-04-04 08:52:11 -0700 (Wed, 04 Apr 2012)

Log Message

[Qt] Entire page highlighted on panning.
https://bugs.webkit.org/show_bug.cgi?id=83158

Patch by Allan Sandfeld Jensen <[email protected]> on 2012-04-04
Reviewed by Kenneth Rohde Christiansen.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::highlightPotentialActivation):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (113194 => 113195)


--- trunk/Source/WebKit2/ChangeLog	2012-04-04 15:49:59 UTC (rev 113194)
+++ trunk/Source/WebKit2/ChangeLog	2012-04-04 15:52:11 UTC (rev 113195)
@@ -1,3 +1,13 @@
+2012-04-04  Allan Sandfeld Jensen  <[email protected]>
+
+        [Qt] Entire page highlighted on panning.
+        https://bugs.webkit.org/show_bug.cgi?id=83158
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::highlightPotentialActivation):
+
 2012-04-04  Jesus Sanchez-Palencia  <[email protected]>
 
         [Qt][WK2] QtWebKit2 should support Page Visibility API

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (113194 => 113195)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-04-04 15:49:59 UTC (rev 113194)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-04-04 15:52:11 UTC (rev 113195)
@@ -1455,19 +1455,25 @@
     IntPoint adjustedPoint;
 
     if (point != IntPoint::zero()) {
+        Node* adjustedNode = 0;
 #if ENABLE(TOUCH_ADJUSTMENT)
-        mainframe->eventHandler()->bestClickableNodeForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), adjustedPoint, activationNode);
+        mainframe->eventHandler()->bestClickableNodeForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), adjustedPoint, adjustedNode);
 #else
         HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
-        activationNode = result.innerNode();
+        adjustedNode = result.innerNode();
 #endif
-        if (activationNode && !activationNode->isFocusable()) {
-            for (Node* node = activationNode; node; node = node->parentOrHostNode()) {
-                if (node->isFocusable()) {
-                    activationNode = node;
-                    break;
-                }
+        // Find the node to highlight. This is not the same as the node responding the tap gesture, because many
+        // pages has a global click handler and we do not want to highlight the body.
+        // Instead find the enclosing link or focusable element, or the last enclosing inline element.
+        for (Node* node = adjustedNode; node; node = node->parentOrHostNode()) {
+            if (node->isMouseFocusable() || node->isLink()) {
+                activationNode = node;
+                break;
             }
+            if (node->renderer() && node->renderer()->isInline())
+                activationNode = node;
+            else if (activationNode)
+                break;
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to