Source/WebCore: Unload events can crash us when they blank out a parent frame.
authorAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Mon, 29 Aug 2011 20:19:47 +0000 (17:19 -0300)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Mon, 5 Sep 2011 14:16:56 +0000 (11:16 -0300)
commit6cf2f5dd90d2f9b44510bce14fd40f965995adfe
tree67dd0c4ac7c0d270e0ceb2eb9fae710455f2e53c
parentf8e55e65185e068c35459a897e7c9e6c7773dcbe
Source/WebCore: Unload events can crash us when they blank out a parent frame.
https://bugs.webkit.org/show_bug.cgi?id=64741

Author: Nate Chapin <japhet@chromium.org>
Reviewed by Adam Barth.

Test: fast/loader/document-destruction-within-unload.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading): Prevent unload events
    from going into infinite recursion.
(WebCore::FrameLoader::setDocumentLoader): Ensure we don't
    let set m_documentLoader to a DocumentLoader with a null Frame*.
(WebCore::FrameLoader::detachChildren): Save off a vector of
    children to detach, rather than doing it inline.

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=64741.

Reviewed by Adam Barth.

* fast/loader/document-destruction-within-unload-expected.txt: Added.
* fast/loader/document-destruction-within-unload.html: Added.
* fast/loader/resources/document-destruction-within-unload-iframe.html: Added.
* fast/loader/resources/document-destruction-within-unload.svg: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93521 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

Source/WebCore/loader/FrameLoader.cpp
LayoutTests/ChangeLog
LayoutTests/fast/loader/document-destruction-within-unload-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/document-destruction-within-unload.html [new file with mode: 0644]
LayoutTests/fast/loader/resources/document-destruction-within-unload-iframe.html [new file with mode: 0644]
LayoutTests/fast/loader/resources/document-destruction-within-unload.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoader.cpp