URL set by document.open() is not communicated to the UIProcess
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 23:07:35 +0000 (23:07 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 23:07:35 +0000 (23:07 +0000)
commit4e459c84c6506a7570b1ea2499c0eac6a1e13513
tree2625d29a4b98333f822aee65114fd74dabdd094f
parentbd094f6aee6eebad8694c8ea1dab086d91cfbffd
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>

Reviewed by Geoff Garen.

Source/WebCore:

Notify the FrameLoaderClient whenever an explicit open was done and provide it with
the latest document URL.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didExplicitOpen):
* loader/FrameLoaderClient.h:

Source/WebKit:

Whenever the UIProcess is notified of an explicit document.open() call, update the
PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
knows it committed a load (i.e. It is no longer showing the initially empty document).

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didExplicitOpen):
* UIProcess/PageLoadState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/open-window-then-write-to-it.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm:
(-[OpenWindowThenDocumentOpenUIDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoaderClient.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/PageLoadState.cpp
Source/WebKit/UIProcess/PageLoadState.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit/open-window-then-write-to-it.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitCocoa/OpenAndCloseWindow.mm