Bug 228774 - [iOS 15] "Look Up" action is sometimes missing after force pressing images
Summary: [iOS 15] "Look Up" action is sometimes missing after force pressing images
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-04 08:02 PDT by Wenson Hsieh
Modified: 2021-08-04 11:44 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.06 KB, patch)
2021-08-04 08:29 PDT, Wenson Hsieh
drousso: review+
Details | Formatted Diff | Diff
Patch for landing (3.10 KB, patch)
2021-08-04 11:09 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].