| Summary: | [Live Text] [macOS] Add an internal option to disable inline text selection in images | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||||||
| Component: | Platform | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | bdakin, hi, megan_gardner, thorton, webkit-bug-importer | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Wenson Hsieh
2021-06-22 12:29:52 PDT
Created attachment 431990 [details]
For EWS
Created attachment 431991 [details]
For EWS
Comment on attachment 431991 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=431991&action=review > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:238 > void WebViewImpl::computeHasVisualSearchResults(const URL& imageURL, ShareableBitmap& imageBitmap, CompletionHandler<void(bool)>&& completion) These seem ... slightly silly, instead of just passing the nice pretty enum. But also fine. > Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:553 > + page->computeHasVisualSearchResults(imageURL, *imageBitmap, [weakThis = makeWeakPtr(protectedThis.get()), quickLookItemToInsertIfNeeded = WTFMove(*quickLookItemToInsertIfNeeded)] (bool hasVisualSearchResults) mutable { This function is getting a bit out of hand, maybe the visual search stuff can be in its own? (also then you could drop a lot of the `protectedThis`) > Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:607 > + auto item = retainPtr([m_menu itemAtIndex:itemIndex]); Not sure what the retainPtr() is for! Where's the item going to go? Comment on attachment 431991 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=431991&action=review >> Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:238 >> void WebViewImpl::computeHasVisualSearchResults(const URL& imageURL, ShareableBitmap& imageBitmap, CompletionHandler<void(bool)>&& completion) > > These seem ... slightly silly, instead of just passing the nice pretty enum. But also fine. Good point — I'll change this so that we just have `computeHasImageAnalysisResults` instead of both `computeHasTextRecognitionResults` and `computeHasVisualSearchResults`. >> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:553 >> + page->computeHasVisualSearchResults(imageURL, *imageBitmap, [weakThis = makeWeakPtr(protectedThis.get()), quickLookItemToInsertIfNeeded = WTFMove(*quickLookItemToInsertIfNeeded)] (bool hasVisualSearchResults) mutable { > > This function is getting a bit out of hand, maybe the visual search stuff can be in its own? (also then you could drop a lot of the `protectedThis`) Sounds good — I pulled the logic in this ENABLE(IMAGE_ANALYSIS) block out into a separate helper method named `insertOrUpdateQuickLookImageItem`. >> Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:607 >> + auto item = retainPtr([m_menu itemAtIndex:itemIndex]); > > Not sure what the retainPtr() is for! Where's the item going to go? I suppose the item's not going anywhere :P removed the RetainPtr. Created attachment 432004 [details]
Fix GTK/WPE/Win builds
Created attachment 432005 [details]
Fix GTK/WPE/Win builds (2)
Committed r279164 (239061@main): <https://commits.webkit.org/239061@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 432005 [details]. |