Bug 137008

Summary: [Cocoa] Add UI delegate callback when window.close() is called
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit2Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, front.end.developing, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch and unit test andersca: review+

Description Daniel Bates 2014-09-22 11:08:53 PDT
Towards supporting window.close() to close a window in an app that uses WebKit2 we should expose a UI delegate callback to notify the UI client that it should close the window associated with the WKWebView whose document called window.close().
Comment 1 Daniel Bates 2014-09-22 12:58:05 PDT
<rdar://problem/17801001>
Comment 2 Daniel Bates 2014-09-22 13:17:44 PDT
Created attachment 238492 [details]
Patch and unit test
Comment 3 WebKit Commit Bot 2014-09-22 13:20:42 PDT
Attachment 238492 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/Cocoa/UIDelegate.h:88:  Please declare enum bitfields as unsigned integral types.  [runtime/enum_bitfields] [5]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Anders Carlsson 2014-09-22 13:41:36 PDT
Comment on attachment 238492 [details]
Patch and unit test

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

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm:70
> +    webView.get().configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;

Please use [webView configuration].preferences here instead
Comment 5 Daniel Bates 2014-09-22 13:44:26 PDT
(In reply to comment #4)
> (From update of attachment 238492 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=238492&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm:70
> > +    webView.get().configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
> 
> Please use [webView configuration].preferences here instead

Will fix before landing.
Comment 6 Daniel Bates 2014-09-22 15:01:03 PDT
Committed r173851: <http://trac.webkit.org/changeset/173851>
Comment 7 Daniel Bates 2014-10-06 10:28:23 PDT
*** Bug 137423 has been marked as a duplicate of this bug. ***