Title: [163400] trunk/Source/WebKit2
Revision
163400
Author
[email protected]
Date
2014-02-04 13:40:21 -0800 (Tue, 04 Feb 2014)

Log Message

WK: Cannot select text inside clickable containers.
https://bugs.webkit.org/show_bug.cgi?id=128197
<rdar://problem/15970890>

Reviewed by Simon Fraser.

When retrieving position information, we first try to
find the node responding to click events because we want
to know whether we are on a link or an image to show
the appropriate action sheet.
We could still have a node responding to click events if
for example we have a DIV with a click handler but that
doesn't require any special handling and we still need to
perform regular hit testing.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163399 => 163400)


--- trunk/Source/WebKit2/ChangeLog	2014-02-04 21:39:04 UTC (rev 163399)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-04 21:40:21 UTC (rev 163400)
@@ -1,5 +1,25 @@
 2014-02-04  Enrica Casucci  <[email protected]>
 
+        WK: Cannot select text inside clickable containers.
+        https://bugs.webkit.org/show_bug.cgi?id=128197
+        <rdar://problem/15970890>
+
+        Reviewed by Simon Fraser.
+
+        When retrieving position information, we first try to
+        find the node responding to click events because we want
+        to know whether we are on a link or an image to show
+        the appropriate action sheet.
+        We could still have a node responding to click events if
+        for example we have a DIV with a click handler but that
+        doesn't require any special handling and we still need to
+        perform regular hit testing.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getPositionInformation):
+
+2014-02-04  Enrica Casucci  <[email protected]>
+
         WK2: Selection callout bar does not scroll with the selection.
         https://bugs.webkit.org/show_bug.cgi?id=128142
         <rdar://problem/15970812>

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (163399 => 163400)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-02-04 21:39:04 UTC (rev 163399)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-02-04 21:40:21 UTC (rev 163400)
@@ -827,6 +827,7 @@
 
     info.point = point;
     info.nodeAtPositionIsAssistedNode = (hitNode == m_assistedNode);
+    bool elementIsLinkOrImage = false;
     if (hitNode) {
         info.clickableElementName = hitNode->nodeName();
 
@@ -834,17 +835,23 @@
         if (!element)
             return;
 
+        Element* linkElement = nullptr;
         if (element->renderer() && element->renderer()->isRenderImage()) {
-            Element* linkElement = containingLinkElement(element);
+            elementIsLinkOrImage = true;
+            linkElement = containingLinkElement(element);
 
-            if (linkElement)
-                info.url = ""
-        } else if (element->isLink())
-            info.url = ""
+        } else if (element->isLink()) {
+            linkElement = element;
+            elementIsLinkOrImage = true;
+        }
+        if (linkElement)
+            info.url = ""
         info.title = element->getAttribute(HTMLNames::titleAttr).string();
         if (element->renderer())
             info.bounds = element->renderer()->absoluteBoundingBoxRect(true);
-    } else {
+    }
+
+    if (!elementIsLinkOrImage) {
         Frame& frame = m_page->mainFrame();
         hitNode = frame.eventHandler().hitTestResultAtPoint((point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent).innerNode();
         if (hitNode->isTextNode()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to