Bug 137008 - [Cocoa] Add UI delegate callback when window.close() is called
Summary: [Cocoa] Add UI delegate callback when window.close() is called
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
: 137423 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-22 11:08 PDT by Daniel Bates
Modified: 2014-10-06 10:28 PDT (History)
4 users (show)

See Also:


Attachments
Patch and unit test (15.99 KB, patch)
2014-09-22 13:17 PDT, Daniel Bates
andersca: review+
Details | Formatted Diff | Diff

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