RESOLVED FIXED 236627
Implement additional Reveal methods.
https://bugs.webkit.org/show_bug.cgi?id=236627
Summary Implement additional Reveal methods.
Megan Gardner
Reported 2022-02-14 18:26:59 PST
Implement additional Reveeal methods.
Attachments
Patch (22.88 KB, patch)
2022-02-14 18:46 PST, Megan Gardner
ews-feeder: commit-queue-
Patch (22.87 KB, patch)
2022-02-14 18:50 PST, Megan Gardner
no flags
Patch (23.92 KB, patch)
2022-02-14 19:51 PST, Megan Gardner
ews-feeder: commit-queue-
Patch (24.07 KB, patch)
2022-02-14 20:20 PST, Megan Gardner
no flags
Patch for landing (24.05 KB, patch)
2022-02-15 09:18 PST, Megan Gardner
no flags
Megan Gardner
Comment 1 2022-02-14 18:46:50 PST
Megan Gardner
Comment 2 2022-02-14 18:50:40 PST
Megan Gardner
Comment 3 2022-02-14 19:51:52 PST
Megan Gardner
Comment 4 2022-02-14 20:20:35 PST
Tim Horton
Comment 5 2022-02-14 23:17:29 PST
Comment on attachment 451988 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451988&action=review > Source/WebCore/editing/cocoa/DictionaryLookup.mm:430 > - if (!canCreateRevealItems() || !PAL::getRVPresenterClass()) > + if (!canCreateRevealItems() || !PAL::getRVPresenterClass() || !PAL::isRevealFrameworkAvailable()) I think you want to put the Reveal framework short circuit /before/ you go looking up RVPresenter, because RVPresenter's softlink macro has a RELEASE_ASSERT in it. > Source/WebCore/page/cocoa/EventHandlerCocoa.mm:54 > + return VisibleSelection(); Perhaps `{ }` like above? > Source/WebCore/page/cocoa/EventHandlerCocoa.mm:61 > +#endif // PLATFORM(IOS_FAMILY) Comment seems to disagree with the condition. > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:7560 > + _page->prepareSelectionForContextMenuWithLocationInView(WebCore::roundedIntPoint(locationInView), [prepareSelectionForContextMenuHandler = makeBlockPtr(completionHandler)](bool shouldPresentMenu, const WebKit::RevealItem& item) { `prepareSelectionForContextMenuHandler` seems like a slightly confusing name for the captured completion handler, since it's not "handling" `prepareSelectionForContextMenu`, but rather the completion callback. If you search for `makeBlockPtr(completionHandler)` you'll see much prior art, ranging from folks who literally use `completionHandler = makeBlockPtr(completionHandler)`, shadowing the name, to folks who use slightly adjusted names like `completionBlock` or `protectedCompletionHandler` or etc. etc. > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2347 > +RetainPtr<RVItem> WebPage::rvItemForCurrentSelection() I know it's not new in this patch, but since you're renaming it, can we expand "rv" to "reveal"? (Also I kind of wonder if it should just return a RevealItem, but this is fine). > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2386 > + eventHander.selectClosestContextualWordOrLinkFromHitTestResult(result, WebCore::DontAppendTrailingWhitespace); > > - completionHandler(RevealItem(WTFMove(item))); > + completionHandler(true, RevealItem(rvItemForCurrentSelection())); This all worked out handily!
Tim Horton
Comment 6 2022-02-15 00:23:52 PST
Comment on attachment 451988 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451988&action=review > Source/WebCore/ChangeLog:3 > + Implement additional Reveeal methods. "Reveeal"
Megan Gardner
Comment 7 2022-02-15 09:18:42 PST
Created attachment 452033 [details] Patch for landing
EWS
Comment 8 2022-02-15 10:07:03 PST
Committed r289818 (247279@main): <https://commits.webkit.org/247279@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452033 [details].
Radar WebKit Bug Importer
Comment 9 2022-02-15 10:08:19 PST
Note You need to log in before you can comment on or make changes to this bug.