Bug 228774

Summary: [iOS 15] "Look Up" action is sometimes missing after force pressing images
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: PlatformAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: hi, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
hi: review+
Patch for landing none

Description Wenson Hsieh 2021-08-04 08:02:34 PDT
rdar://78040734
Comment 1 Wenson Hsieh 2021-08-04 08:29:52 PDT
Created attachment 434905 [details]
Patch
Comment 2 Devin Rousso 2021-08-04 10:54:21 PDT
Comment on attachment 434905 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434905&action=review

r=me

> Source/WebKit/UIProcess/ios/WKImageAnalysisGestureRecognizer.mm:68
> +    if (touches.anyObject.force < forceThreshold)

Is every `UITouch` guaranteed to have the same `force`?  Or do we need to iterate this?
Comment 3 Wenson Hsieh 2021-08-04 10:58:01 PDT
Comment on attachment 434905 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434905&action=review

Thanks for the review!

>> Source/WebKit/UIProcess/ios/WKImageAnalysisGestureRecognizer.mm:68
>> +    if (touches.anyObject.force < forceThreshold)
> 
> Is every `UITouch` guaranteed to have the same `force`?  Or do we need to iterate this?

Each UITouch will have the force corresponding to that touch — I don't think it will be an issue here though, since the context menu is only triggered if there's one active touch.

That said, I suppose I could add an early return if `touches.count > 1`.
Comment 4 Wenson Hsieh 2021-08-04 11:09:44 PDT
Created attachment 434914 [details]
Patch for landing
Comment 5 EWS 2021-08-04 11:44:27 PDT
Committed r280647 (240258@main): <https://commits.webkit.org/240258@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434914 [details].