Index: Source/core/frame/LocalDOMWindow.cpp |
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp |
index 7ee9063c803257a93a00d294f0d933139efea4ec..ef0b3771b8904be37c2380b0605896c8f7abe083 100644 |
--- a/Source/core/frame/LocalDOMWindow.cpp |
+++ b/Source/core/frame/LocalDOMWindow.cpp |
@@ -83,7 +83,6 @@ |
#include "core/loader/MixedContentChecker.h" |
#include "core/loader/SinkDocument.h" |
#include "core/loader/appcache/ApplicationCache.h" |
-#include "core/page/BackForwardClient.h" |
#include "core/page/Chrome.h" |
#include "core/page/ChromeClient.h" |
#include "core/page/CreateWindow.h" |
@@ -1014,7 +1013,7 @@ void LocalDOMWindow::close(ExecutionContext* context) |
Settings* settings = frame()->settings(); |
bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseWindows(); |
- if (!(page->openedByDOM() || page->backForward().backForwardListCount() <= 1 || allowScriptsToCloseWindows)) { |
+ if (!page->openedByDOM() && frame()->loader().client()->backForwardLength() > 1 && !allowScriptsToCloseWindows) { |
frameConsole()->addMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "Scripts may close only the windows that were opened by it.")); |
return; |
} |