TextIndicator for <span> inside an <a> only highlights the <span>, should highlight...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 02:05:35 +0000 (02:05 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 02:05:35 +0000 (02:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143287
<rdar://problem/20318342>

Reviewed by Beth Dakin.

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _defaultAnimationController]):
Instead of just highlighting the hit element, highlight the whole
element that the link URL comes from.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Instead of just highlighting the hit element, highlight the whole
element that the link URL comes from.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 757ea49..dd6ef91 100644 (file)
@@ -1,3 +1,16 @@
+2015-03-31  Timothy Horton  <timothy_horton@apple.com>
+
+        TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
+        https://bugs.webkit.org/show_bug.cgi?id=143287
+        <rdar://problem/20318342>
+
+        Reviewed by Beth Dakin.
+
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController _defaultAnimationController]):
+        Instead of just highlighting the hit element, highlight the whole
+        element that the link URL comes from.
+
 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         Clean up Identifier factories to clarify the meaning of StringImpl*
index e37342e..1b3d179 100644 (file)
@@ -213,10 +213,10 @@ using namespace WebCore;
 {
     NSURL *url = _hitTestResult.absoluteLinkURL();
     NSString *absoluteURLString = [url absoluteString];
-    if (url && WebCore::protocolIsInHTTPFamily(absoluteURLString) && _hitTestResult.innerNode()) {
+    if (url && WebCore::protocolIsInHTTPFamily(absoluteURLString) && _hitTestResult.URLElement()) {
         _type = WebImmediateActionLinkPreview;
 
-        RefPtr<Range> linkRange = rangeOfContents(*_hitTestResult.innerNode());
+        RefPtr<Range> linkRange = rangeOfContents(*_hitTestResult.URLElement());
         RefPtr<TextIndicator> linkTextIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);
         [_webView _setTextIndicator:linkTextIndicator.get() fadeOut:NO];
 
index e5cc9cd..c820c82 100644 (file)
@@ -1,5 +1,18 @@
 2015-03-31  Timothy Horton  <timothy_horton@apple.com>
 
+        TextIndicator for <span> inside an <a> only highlights the <span>, should highlight the whole <a>
+        https://bugs.webkit.org/show_bug.cgi?id=143287
+        <rdar://problem/20318342>
+
+        Reviewed by Beth Dakin.
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performActionMenuHitTestAtLocation):
+        Instead of just highlighting the hit element, highlight the whole
+        element that the link URL comes from.
+
+2015-03-31  Timothy Horton  <timothy_horton@apple.com>
+
         WKView should stop using endGestureWithEvent
         https://bugs.webkit.org/show_bug.cgi?id=143285
         <rdar://problem/20357007>
index e7730ea..4f821da 100644 (file)
@@ -1041,9 +1041,9 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
     RefPtr<Range> selectionRange = corePage()->focusController().focusedOrMainFrame().selection().selection().firstRange();
 
     URL absoluteLinkURL = hitTestResult.absoluteLinkURL();
-    Node *innerNode = hitTestResult.innerNode();
-    if (!absoluteLinkURL.isEmpty() && innerNode) {
-        RefPtr<Range> linkRange = rangeOfContents(*innerNode);
+    Element *URLElement = hitTestResult.URLElement();
+    if (!absoluteLinkURL.isEmpty() && URLElement) {
+        RefPtr<Range> linkRange = rangeOfContents(*URLElement);
         actionMenuResult.linkTextIndicator = TextIndicator::createWithRange(*linkRange, textIndicatorTransitionForActionMenu(selectionRange.get(), *linkRange, forImmediateAction, false));
     }