bug 306164: The global scope polluter is not reinstalled when document.write is used. r+sr=jst

This commit is contained in:
mrbkap%gmail.com 2005-08-29 22:04:39 +00:00
parent f3ce4771c5
commit 17f1097d7e

View File

@ -947,7 +947,9 @@ nsGlobalWindow::SetNewDocument(nsIDOMDocument* aDocument,
currentInner->mListenerManager = nsnull;
}
nsWindowSH::InvalidateGlobalScopePolluter(cx, currentInner->mJSObject);
if (!reUseInnerWindow || newDoc != oldDoc) {
nsWindowSH::InvalidateGlobalScopePolluter(cx, currentInner->mJSObject);
}
}
nsRefPtr<nsGlobalWindow> newInnerWindow;
@ -1097,7 +1099,7 @@ nsGlobalWindow::SetNewDocument(nsIDOMDocument* aDocument,
mInnerWindow = newInnerWindow;
}
if (newDoc != oldDoc && !aState) {
if ((!reUseInnerWindow || newDoc != oldDoc) && !aState) {
nsCOMPtr<nsIHTMLDocument> html_doc(do_QueryInterface(mDocument));
nsWindowSH::InstallGlobalScopePolluter(cx, newInnerWindow->mJSObject,
html_doc);