Bug 147040

Summary: The external URL policy is not reported correctly in navigation actions that create new windows
Product: WebKit Reporter: mitz
Component: WebKit APIAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, commit-queue, japhet
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Report the correct policy dino: review+

Description mitz 2015-07-17 09:29:40 PDT
<rdar://problem/21803781>

When a navigation targets a new window, the WKNavigationAction passed to -webView:decidePolicyForNavigationAction:decisionHandler: doesn’t have the correct values for -_shouldOpenExternalSchemes and -_shouldOpenAppLinks.

When window.open is called, the WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures: doesn’t have the correct values for  -_shouldOpenExternalSchemes and -_shouldOpenAppLinks, and so does the WKNavigationAction passed to the new view’s -webView:decidePolicyForNavigationAction:decisionHandler:.
Comment 1 mitz 2015-07-17 12:55:42 PDT
Created attachment 256980 [details]
Report the correct policy
Comment 2 mitz 2015-07-17 12:58:47 PDT
Comment on attachment 256980 [details]
Report the correct policy

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

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm:2
> + * Copyright (C) 2014 Apple Inc. All rights reserved.

2014?

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm:69
> +TEST(WebKit2, ShouldOpenExternalURLsInWindowOpen)

I should split this up to multiple tests, at least a separate one for targeted links.
Comment 3 mitz 2015-07-17 14:17:35 PDT
Fixed in <http://trac.webkit.org/r186964>.