REGRESSION: Invoking dictionary lookup on text in some search fields searches for
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Nov 2014 00:49:33 +0000 (00:49 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Nov 2014 00:49:33 +0000 (00:49 +0000)
incorrect item
https://bugs.webkit.org/show_bug.cgi?id=138853
-and corresponding-
rdar://problem/18912505

Reviewed by Tim Horton.

Get the visible position based on the frame, not just the renderer.
* editing/mac/DictionaryLookup.mm:
(WebCore::rangeForDictionaryLookupAtHitTestResult):

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

Source/WebCore/ChangeLog
Source/WebCore/editing/mac/DictionaryLookup.mm

index 24fef58..21fe6e9 100644 (file)
@@ -1,3 +1,17 @@
+2014-11-18  Beth Dakin  <bdakin@apple.com>
+
+        REGRESSION: Invoking dictionary lookup on text in some search fields searches for 
+        incorrect item
+        https://bugs.webkit.org/show_bug.cgi?id=138853
+        -and corresponding-
+        rdar://problem/18912505
+
+        Reviewed by Tim Horton.
+
+        Get the visible position based on the frame, not just the renderer.
+        * editing/mac/DictionaryLookup.mm:
+        (WebCore::rangeForDictionaryLookupAtHitTestResult):
+
 2014-11-18  David Hyatt  <hyatt@apple.com>
 
         REGRESSION (r167210): Invalid cast in WebCore::RenderBlock::blockSelectionGaps
index 2fb7c9f..46f9684 100644 (file)
@@ -137,10 +137,11 @@ PassRefPtr<Range> rangeForDictionaryLookupAtHitTestResult(const HitTestResult& h
         return nullptr;
 
     // Don't do anything if there is no character at the point.
-    if (!frame->rangeForPoint(hitTestResult.roundedPointInInnerNodeFrame()))
+    IntPoint framePoint = hitTestResult.roundedPointInInnerNodeFrame();
+    if (!frame->rangeForPoint(framePoint))
         return nullptr;
 
-    VisiblePosition position = renderer->positionForPoint(hitTestResult.localPoint(), nullptr);
+    VisiblePosition position = frame->visiblePositionForPoint(framePoint);
     if (position.isNull())
         position = firstPositionInOrBeforeNode(node);