Bug 200909 - REGRESSION: Open in New Tab is missing from context menu
Summary: REGRESSION: Open in New Tab is missing from context menu
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: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-19 20:04 PDT by Dean Jackson
Modified: 2019-08-20 09:10 PDT (History)
2 users (show)

See Also:


Attachments
Patch (11.39 KB, patch)
2019-08-19 20:08 PDT, Dean Jackson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2019-08-19 20:04:44 PDT
REGRESSION: Open in New Tab is missing from context menu
Comment 1 Dean Jackson 2019-08-19 20:08:30 PDT
Created attachment 376736 [details]
Patch
Comment 2 Dean Jackson 2019-08-19 20:09:34 PDT
<rdar://problem/54476169>
Comment 3 Simon Fraser (smfr) 2019-08-19 20:23:04 PDT
Comment on attachment 376736 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:7724
> +    // even though they haven't moved to the new API.

The 'they' is ambiguous. Does it refer to MobileSafari, or to the methods?

> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:50
> +    static auto window = adoptNS([[UIWindow alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
> +    static auto driver = adoptNS([TestContextMenuDriver new]);
> +    static auto uiDelegate = adoptNS((NSObject<WKUIDelegate> *)[delegateClass new]);
> +    static auto configuration = adoptNS([WKWebViewConfiguration new]);

These statics are weird. Is this just to extend lifetime? Can we just retain something and release it when the test is complete?

> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:143
> +    return previewActions;

Could this be written as:
return @[
  [UIPreviewAction actionWithTitle:@"Action" style:UIPreviewActionStyleDefault handler:^(UIPreviewAction *, UIViewController *) { }];
];
Comment 4 Dean Jackson 2019-08-20 09:10:00 PDT
Comment on attachment 376736 [details]
Patch

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

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:7724
>> +    // even though they haven't moved to the new API.
> 
> The 'they' is ambiguous. Does it refer to MobileSafari, or to the methods?

Clarified.

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:50
>> +    static auto configuration = adoptNS([WKWebViewConfiguration new]);
> 
> These statics are weird. Is this just to extend lifetime? Can we just retain something and release it when the test is complete?

The issue is this is a helper function that is creating the state for the actual tests. So the variables have to exist somewhere, and it would be annoying to pass them in and out. The statics could live globally, but that isn't much different.

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/ContextMenus.mm:143
>> +    return previewActions;
> 
> Could this be written as:
> return @[
>   [UIPreviewAction actionWithTitle:@"Action" style:UIPreviewActionStyleDefault handler:^(UIPreviewAction *, UIViewController *) { }];
> ];

Yes.
Comment 5 Dean Jackson 2019-08-20 09:10:53 PDT
Committed r248900: <https://trac.webkit.org/changeset/248900>