WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
227265
[Live Text] [macOS] Add an internal option to disable inline text selection in images
https://bugs.webkit.org/show_bug.cgi?id=227265
Summary
[Live Text] [macOS] Add an internal option to disable inline text selection i...
Wenson Hsieh
Reported
2021-06-22 12:29:52 PDT
Add an (off-by-default) internal feature flag to control whether or not we should allow inline text selection inside images. When disallowing inline text selection in images, we will instead have a context menu action to "Quick Look", which will automatically be retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" depending on the presence of recognized text or visual search results for the image.
Attachments
For EWS
(45.91 KB, patch)
2021-06-22 13:38 PDT
,
Wenson Hsieh
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
For EWS
(45.95 KB, patch)
2021-06-22 13:58 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Fix GTK/WPE/Win builds
(48.01 KB, patch)
2021-06-22 16:02 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Fix GTK/WPE/Win builds (2)
(48.00 KB, patch)
2021-06-22 16:15 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2021-06-22 12:34:58 PDT
rdar://79460142
Wenson Hsieh
Comment 2
2021-06-22 13:38:58 PDT
Comment hidden (obsolete)
Created
attachment 431990
[details]
For EWS
Wenson Hsieh
Comment 3
2021-06-22 13:58:25 PDT
Created
attachment 431991
[details]
For EWS
Tim Horton
Comment 4
2021-06-22 14:18:20 PDT
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?
Wenson Hsieh
Comment 5
2021-06-22 15:32:18 PDT
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.
Wenson Hsieh
Comment 6
2021-06-22 16:02:27 PDT
Comment hidden (obsolete)
Created
attachment 432004
[details]
Fix GTK/WPE/Win builds
Wenson Hsieh
Comment 7
2021-06-22 16:15:34 PDT
Created
attachment 432005
[details]
Fix GTK/WPE/Win builds (2)
EWS
Comment 8
2021-06-22 18:33:02 PDT
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]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug