Bug 209258 - Correctly set up context for Data Detectors
Summary: Correctly set up context for Data Detectors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-18 17:01 PDT by Megan Gardner
Modified: 2020-03-20 10:02 PDT (History)
2 users (show)

See Also:


Attachments
Patch (5.07 KB, patch)
2020-03-18 17:15 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (5.75 KB, patch)
2020-03-18 18:06 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (5.82 KB, patch)
2020-03-18 18:31 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2020-03-18 17:01:48 PDT
Correctly set up context for Data Detectors
Comment 1 Megan Gardner 2020-03-18 17:15:51 PDT
Created attachment 393922 [details]
Patch
Comment 2 Tim Horton 2020-03-18 17:17:40 PDT
Comment on attachment 393922 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:744
> +    [ddContextMenuActionClass updateContext:context withSourceRect:sourceRect];

You need to use the return value of this method, it doesn't/can't mutate the one passed in

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6754
> +    [ddContextMenuActionClass updateContext:context.get() withSourceRect:frameInContainerViewCoordinates];

You need to use the return value of this method, it doesn't/can't mutate the one passed in
Comment 3 Megan Gardner 2020-03-18 18:06:06 PDT
Created attachment 393926 [details]
Patch
Comment 4 Tim Horton 2020-03-18 18:15:35 PDT
Comment on attachment 393926 [details]
Patch

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

> Source/WebKit/ChangeLog:5
> +

where's the rdar

> Source/WebKit/ChangeLog:8
> +        Not passing in a nil context, and running the formatter as requested by Data Detectors team.

This is an odd sentence fragment.

I would write something more like:

"Stop passing in a nil context. This is OK now, but won't be in the near future.
Also, call -updateContext:withSourceRect: so that DataDetectors can populate the context appropriately."

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6752
>      CGRect frameInContainerViewCoordinates = [self convertRect:sourceRect toView:self.containerForContextMenuHintPreviews];

Here, we're converting into the coordinate space of containerForContextMenuHintPreviews. But I think that sometimes this method is used to provide context for different views? Maybe we need to pass in the view whose coordinate space we should use as an argument to this method?

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6753
> +    auto ddContextMenuActionClass = getDDContextMenuActionClass();

No need for this local, in this case.
Comment 5 Megan Gardner 2020-03-18 18:31:35 PDT
Created attachment 393932 [details]
Patch
Comment 6 EWS 2020-03-19 01:14:16 PDT
Committed r258684: <https://trac.webkit.org/changeset/258684>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 393932 [details].
Comment 7 Radar WebKit Bug Importer 2020-03-19 01:15:15 PDT
<rdar://problem/60623947>
Comment 8 Megan Gardner 2020-03-20 10:02:03 PDT
<rdar://problem/60612327>