Summary: | [macOS] Add helper methods to install and uninstall VKCImageAnalysisOverlayView | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||||||
Component: | Platform | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | akeerthi, hi, katherine_cheney, megan_gardner, thorton, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Wenson Hsieh
2022-04-03 10:40:21 PDT
Created attachment 456507 [details]
For EWS
Created attachment 456510 [details]
Fix Big Sur build
Created attachment 456511 [details]
Fix Big Sur build
Comment on attachment 456511 [details] Fix Big Sur build View in context: https://bugs.webkit.org/attachment.cgi?id=456511&action=review > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:1172 > + return CGRectMake(0, 0, 1, 1); Why does this have a non-zero size? > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:5960 > +bool WebViewImpl::shouldAvoidUpdatingCursorAtPoint(NSPoint locationInView) const Not totally sure this mechanism is a good idea, e.g. if you cmd-tab to a window with a web view and then don't update the cursor. Can you instead just force the cursor you want to be set? (In reply to Tim Horton from comment #4) > Comment on attachment 456511 [details] > Fix Big Sur build > > View in context: > https://bugs.webkit.org/attachment.cgi?id=456511&action=review > > > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:1172 > > + return CGRectMake(0, 0, 1, 1); > > Why does this have a non-zero size? So I just decided to fall back to the default value here (i.e., as if the delegate were unimplemented), which is the unit rect (0, 0, 1, 1). The return value of this delegate method is a normalized rect relative to the bounds of the WKWebView. > > > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:5960 > > +bool WebViewImpl::shouldAvoidUpdatingCursorAtPoint(NSPoint locationInView) const > > Not totally sure this mechanism is a good idea, e.g. if you cmd-tab to a > window with a web view and then don't update the cursor. Can you instead > just force the cursor you want to be set? That's a good point! I'll see if I can change this... (In reply to Wenson Hsieh from comment #5) > (In reply to Tim Horton from comment #4) > > Comment on attachment 456511 [details] > > Fix Big Sur build > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=456511&action=review > > > > > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:1172 > > > + return CGRectMake(0, 0, 1, 1); > > > > Why does this have a non-zero size? > > So I just decided to fall back to the default value here (i.e., as if the > delegate were unimplemented), which is the unit rect (0, 0, 1, 1). The > return value of this delegate method is a normalized rect relative to the > bounds of the WKWebView. > > > > > > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:5960 > > > +bool WebViewImpl::shouldAvoidUpdatingCursorAtPoint(NSPoint locationInView) const > > > > Not totally sure this mechanism is a good idea, e.g. if you cmd-tab to a > > window with a web view and then don't update the cursor. Can you instead > > just force the cursor you want to be set? > > That's a good point! I'll see if I can change this... Chatted with Tim on Slack about this; the overall approach seems okay since we're not avoiding cursor updates — just letting the native VisionKit views set the cursor on our behalf. I'll rename this method to something like, `imageAnalysisOverlayViewHasCursorAtPoint()`, to make this interaction clear. Created attachment 456611 [details]
For landing
Committed r292316 (249209@main): <https://commits.webkit.org/249209@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 456611 [details]. |