Title: [244718] trunk/Source/WebCore
Revision
244718
Author
[email protected]
Date
2019-04-27 07:41:24 -0700 (Sat, 27 Apr 2019)

Log Message

Lookup only looking up the first word in selection
https://bugs.webkit.org/show_bug.cgi?id=197341
<rdar://problem/48221414>

Reviewed by Wenson Hsieh.

Lookup is not testable.

Reveal needs the full range in order to correctly create the item for the popover.

* editing/cocoa/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (244717 => 244718)


--- trunk/Source/WebCore/ChangeLog	2019-04-27 06:50:01 UTC (rev 244717)
+++ trunk/Source/WebCore/ChangeLog	2019-04-27 14:41:24 UTC (rev 244718)
@@ -1,3 +1,18 @@
+2019-04-27  Megan Gardner  <[email protected]>
+
+        Lookup only looking up the first word in selection
+        https://bugs.webkit.org/show_bug.cgi?id=197341
+        <rdar://problem/48221414>
+
+        Reviewed by Wenson Hsieh.
+
+        Lookup is not testable.
+
+        Reveal needs the full range in order to correctly create the item for the popover.
+
+        * editing/cocoa/DictionaryLookup.mm:
+        (WebCore::showPopupOrCreateAnimationController):
+
 2019-04-26  Jer Noble  <[email protected]>
 
         Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer

Modified: trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm (244717 => 244718)


--- trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm	2019-04-27 06:50:01 UTC (rev 244717)
+++ trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm	2019-04-27 14:41:24 UTC (rev 244718)
@@ -482,7 +482,7 @@
     RetainPtr<WebRevealHighlight> webHighlight =  adoptNS([[WebRevealHighlight alloc] initWithHighlightRect: highlightRect useDefaultHighlight:!textIndicator.get().contentImage() attributedString:dictionaryPopupInfo.attributedString.get()]);
     RetainPtr<RVPresentingContext> context = adoptNS([allocRVPresentingContextInstance() initWithPointerLocationInView:pointerLocation inView:view highlightDelegate:(id<RVPresenterHighlightDelegate>) webHighlight.get()]);
     
-    RetainPtr<RVItem> item = adoptNS([allocRVItemInstance() initWithText:dictionaryPopupInfo.attributedString.get().string selectedRange:NSMakeRange(0, 0)]);
+    RetainPtr<RVItem> item = adoptNS([allocRVItemInstance() initWithText:dictionaryPopupInfo.attributedString.get().string selectedRange:NSMakeRange(0, dictionaryPopupInfo.attributedString.get().string.length)]);
     
     [webHighlight setClearTextIndicator:[webHighlight = WTFMove(webHighlight), clearTextIndicator = WTFMove(clearTextIndicator)] {
         if (clearTextIndicator)
@@ -504,9 +504,9 @@
     auto textIndicator = TextIndicator::create(dictionaryPopupInfo.textIndicator);
     
     RetainPtr<WebRevealHighlight> webHighlight = adoptNS([[WebRevealHighlight alloc] initWithHighlightRect:[view convertRect:textIndicator->selectionRectInRootViewCoordinates() toView:nil] view:view image:textIndicator->contentImage()]);
+
+    RetainPtr<RVItem> item = adoptNS([allocRVItemInstance() initWithText:dictionaryPopupInfo.attributedString.get().string selectedRange:NSMakeRange(0, dictionaryPopupInfo.attributedString.get().string.length)]);
     
-    RetainPtr<RVItem> item = adoptNS([allocRVItemInstance() initWithText:dictionaryPopupInfo.attributedString.get().string selectedRange:NSMakeRange(0, 0)]);
-    
     [UINSSharedRevealController() revealItem:item.get() locationInWindow:dictionaryPopupInfo.origin window:view.window highlighter:(id<UIRVPresenterHighlightDelegate>) webHighlight.get()];
     return nil;
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to