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 02:01:32 +0000 (02:01 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 02:01:32 +0000 (02:01 +0000)
commitb2857282494c56af367f9eb6b145469767ed848a
tree169b97c34885b8d1ca7ad4ec12bf5597021896e0
parent391584802b70ff980c43437e4c9c07d82b176996
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 Geoffrey 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@244321 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