Summary: | Make WebChromeClient::closeWindowSoon work for all RunLoop modes | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Prasad Tammana <prasadt> | ||||
Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED INVALID | ||||||
Severity: | Normal | CC: | ap, darin, dimich, levin | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 35350 | ||||||
Attachments: |
|
Description
Prasad Tammana
2010-06-01 18:19:25 PDT
Created attachment 57611 [details]
Patch to make closeWindowSoon work in all RunLoop modes.
This is follow up from http://www.mail-archive.com/webkit-dev@lists.webkit.org/msg11394.html as understand it. Comment on attachment 57611 [details]
Patch to make closeWindowSoon work in all RunLoop modes.
I don’t think this change is correct or helpful. For example, I don’t think we want to close a window and run all the code that triggers inside an NSConnectionReply modal event loop.
I don’t understand the benefit side of this patch either.
(In reply to comment #3) > (From update of attachment 57611 [details]) > I don’t think this change is correct or helpful. For example, I don’t think we want to close a window and run all the code that triggers inside an NSConnectionReply modal event loop. > > I don’t understand the benefit side of this patch either. When you write a WebKit application that implements showModalDialog, you don't have a way to close the window from script. The close call ends up in the closeWindowSoon() function and the _closeWindow() doesn't get dispatched because the run loop is in NSModalPanelRunLoopMode mode. I didn't realize that dispatching these calls is inappropriate in certain modes. I could make this fix more targeted and make it to be: [m_webView performSelector:@selector(_closeWindow) withObject:nil afterDelay:0.0 inModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode]]; With that change the only new mode we'll be closing windows would be in NSModalPanelRunLoopMode. Does that seem like a correct change? I ran into this issue when adding showModalDialog to DumpRenderTree as part of the bug fix for - https://bugs.webkit.org/show_bug.cgi?id=35350. You'll notice I have a patch attached to that bug that includes this change. I decided to factor out this particular change into a separate patch as this is the more sensitive part of that big patch. Thanks, Prasad Comment on attachment 57611 [details] Patch to make closeWindowSoon work in all RunLoop modes. Removing r? since the root bug 35350 has landed and it seems a different approach was selected to support showModalDialog testing. Please update if this is not so. We don't need this change anymore. |