2008-05-22 Stephanie Lewis <slewis@apple.com>
authorslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 May 2008 09:36:19 +0000 (09:36 +0000)
committerslewis@apple.com <slewis@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 May 2008 09:36:19 +0000 (09:36 +0000)
commit86a4073ae5150725010b4cd2eba8726ea6f68814
treebc366c611c1de45ad6655e1f30275605ffc6c791
parent7307d64d8e1f2d99110b891bb69a30098df59155
2008-05-22  Stephanie Lewis  <slewis@apple.com>

        Reviewed by Dan.

        Fix <rdar://problem/5952405>.  The unbeforeunload count cannot be cleared when it is dispatched because it is possible to be called again.  Clear it after the unload event is dispatched.

        Test: fast/events/onunload-clears-onbeforeunload.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::stopLoading):
        * page/Frame.cpp:
        (WebCore::Frame::shouldClose):

        implement the beforeUnload UI delegate so that DRT will dispatch beforeunload events.

        * DumpRenderTree/mac/UIDelegate.mm:
        (-[UIDelegate webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:]):
        * DumpRenderTree/win/UIDelegate.cpp:
        (SearchableWebViewHost::runBeforeUnloadConfirmPanelWithMessage):

        add test to test for beforeunload event handlers being removed after they have been fired.

        * fast/events/onunload-clears-onbeforeunload-expected.txt: Added.
        * fast/events/onunload-clears-onbeforeunload.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/onunload-clears-onbeforeunload-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/onunload-clears-onbeforeunload.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp
WebCore/page/Frame.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/UIDelegate.mm
WebKitTools/DumpRenderTree/win/UIDelegate.cpp
WebKitTools/DumpRenderTree/win/UIDelegate.h