WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out while waiting for an answer from the WebProcess but the WebProcess eventually responds.
<rdar://problem/58880177>
Created attachment 389521 [details] Patch
Comment on attachment 389521 [details] Patch Clearing flags on attachment: 389521 Committed r255595: <https://trac.webkit.org/changeset/255595>
All reviewed patches have been landed. Closing bug.
> Committed r255595: <https://trac.webkit.org/changeset/255595> This seems to have broken api-gtk test: /WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/javascript-dialogs Can you please check?
Comment on attachment 389521 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=389521&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:1134 > + // If we timed out, don't ask the client to close again. > + if (!m_tryCloseTimeoutTimer.isActive()) > + return; This is assuming that the timer being not active means we timed out, but WebPageProxy::runBeforeUnloadConfirmPanel() stops the timer.