REGRESSION (r219013): Compute source frame info for frameless document
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 22:27:52 +0000 (22:27 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 22:27:52 +0000 (22:27 +0000)
commit3416852637727bdc44b921281a9fa3363e203225
treeb39e14adc046992a816b446f8bfea2a2beb573c8
parent408cf61428ca0035c1c390d5f9b23beef067b548
REGRESSION (r219013): Compute source frame info for frameless document
https://bugs.webkit.org/show_bug.cgi?id=174385
<rdar://problem/33217736>

Reviewed by Brady Eidson.

Source/WebKit:

Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
when computing the frame info for a now-frameless document. One way this can happen is when the frame
that contains the document that initiated the navigation is removed from the page.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before
looking up the WebPage object corresponding to it.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData
object from the source document directly as opposed to using WebFrame::info() as the latter requires
that we have a valid WebCore frame and the source document may not have a frame.

LayoutTests:

* http/tests/navigation/resources/window-open-redirect-and-remove-opener.html: Added.
* http/tests/navigation/window-open-redirect-and-remove-opener-expected.txt: Added.
* http/tests/navigation/window-open-redirect-and-remove-opener.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/navigation/resources/window-open-redirect-and-remove-opener.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/window-open-redirect-and-remove-opener-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/window-open-redirect-and-remove-opener.html [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp