[Qt] Taps are sometimes not highlighted.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 13:23:22 +0000 (13:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 13:23:22 +0000 (13:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82188

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-03-26
Reviewed by Kenneth Rohde Christiansen.

Highlight any focusable parent element, or if none is found at least
the element returned by bestClickableNodeForTouchPoint.

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

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 9685fcc..d90989c 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-26  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        [Qt] Taps are sometimes not highlighted.
+        https://bugs.webkit.org/show_bug.cgi?id=82188
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Highlight any focusable parent element, or if none is found at least
+        the element returned by bestClickableNodeForTouchPoint.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::highlightPotentialActivation):
+
 2012-03-26  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r111993.
index 6b82463..9992f5b 100644 (file)
@@ -1461,8 +1461,14 @@ void WebPage::highlightPotentialActivation(const IntPoint& point, const IntSize&
         HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
         activationNode = result.innerNode();
 #endif
-        if (activationNode && !activationNode->isFocusable())
-            activationNode = activationNode->enclosingLinkEventParentOrSelf();
+        if (activationNode && !activationNode->isFocusable()) {
+            for (Node* node = activationNode; node; node = node->parentOrHostNode()) {
+                if (node->isFocusable()) {
+                    activationNode = node;
+                    break;
+                }
+            }
+        }
     }
 
     if (activationNode)