Nested calls to setDocument can omit firing 'unload' events
https://bugs.webkit.org/show_bug.cgi?id=166422
<rdar://problem/29763012>
Reviewed by Alex Christensen.
Source/WebCore:
Test: fast/loader/nested-document-handling.html
Only allow a single document change to be taking place during a given runloop cycle.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeIfJavaScriptURL): Block script changing the document
when we are in the middle of changing the document.
* page/Frame.cpp:
(WebCore::Frame::setDocument): Keep track of document change state.
* page/Frame.h:
LayoutTests:
* fast/loader/nested-document-handling-expected.txt: Added.
* fast/loader/nested-document-handling.html: Added.
* fast/loader/resources/subframe-success.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@210122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/loader/resources/subframe-success.html b/LayoutTests/fast/loader/resources/subframe-success.html
new file mode 100644
index 0000000..817e350
--- /dev/null
+++ b/LayoutTests/fast/loader/resources/subframe-success.html
@@ -0,0 +1,5 @@
+<html>
+<body onload="parent.finishTest();">
+I am a simple document that completes the test when loaded
+</body>
+</html>