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