Title: [135280] trunk/Source/WebKit2
Revision
135280
Author
allan.jen...@digia.com
Date
2012-11-20 08:02:23 -0800 (Tue, 20 Nov 2012)

Log Message

[Qt] Large areas highlighted on touch
https://bugs.webkit.org/show_bug.cgi?id=97216

Reviewed by Simon Hausmann.

Restrict highlighting of scripted event-handlers to inline elements only.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (135279 => 135280)


--- trunk/Source/WebKit2/ChangeLog	2012-11-20 16:02:19 UTC (rev 135279)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-20 16:02:23 UTC (rev 135280)
@@ -1,5 +1,17 @@
 2012-11-20  Allan Sandfeld Jensen  <allan.jen...@digia.com>
 
+        [Qt] Large areas highlighted on touch
+        https://bugs.webkit.org/show_bug.cgi?id=97216
+
+        Reviewed by Simon Hausmann.
+
+        Restrict highlighting of scripted event-handlers to inline elements only.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::highlightPotentialActivation):
+
+2012-11-20  Allan Sandfeld Jensen  <allan.jen...@digia.com>
+
         [Qt] Zoom logic confused by page and pinch resize
         https://bugs.webkit.org/show_bug.cgi?id=102803
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (135279 => 135280)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-11-20 16:02:19 UTC (rev 135279)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-11-20 16:02:23 UTC (rev 135280)
@@ -1698,17 +1698,21 @@
 #endif
         // 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->isDocumentNode() || node->isFrameOwnerElement())
                 break;
-            if (node->isMouseFocusable() || node->willRespondToMouseClickEvents()) {
+
+            // We always highlight focusable (form-elements), image links or content-editable elements.
+            if (node->isMouseFocusable() || node->isLink() || node->isContentEditable())
                 activationNode = node;
-                break;
+            else if (node->willRespondToMouseClickEvents()) {
+                // Highlight elements with default mouse-click handlers, but highlight only inline elements with
+                // scripted event-handlers.
+                if (!node->Node::willRespondToMouseClickEvents() || (node->renderer() && node->renderer()->isInline()))
+                    activationNode = node;
             }
-            if (node->renderer() && node->renderer()->isInline())
-                activationNode = node;
-            else if (activationNode)
+
+            if (activationNode)
                 break;
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to