Index: Source/core/frame/LocalDOMWindow.cpp |
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp |
index 54881b1d527f87c67ca1461935e292a2decccbb5..5d40b65ab0da70d0e504d8517493cfba77f62851 100644 |
--- a/Source/core/frame/LocalDOMWindow.cpp |
+++ b/Source/core/frame/LocalDOMWindow.cpp |
@@ -817,6 +817,11 @@ void LocalDOMWindow::close(ExecutionContext* context) |
InspectorInstrumentation::willCloseWindow(context); |
page->chrome().closeWindowSoon(); |
+ // So as to make window.closed return the expected result |
+ // after window.close(), separately record the to-be-closed |
+ // state of this window. Scripts may access window.closed |
+ // before the deferred close operation has gone ahead. |
+ m_windowIsClosing = true; |
} |
void LocalDOMWindow::print() |