summaryrefslogtreecommitdiffstats
path: root/dom/base/nsGlobalWindow.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-11-03 09:06:25 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-11-03 09:06:25 +0100
commit1626b5d7041ea9c3db92200f91542da46e49dde6 (patch)
treee99c393052ef818645027da57774672990e29514 /dom/base/nsGlobalWindow.cpp
parent314fb761d144b160d3aeb72840c89e31c4f21a4a (diff)
parent1d55939c7ca0e80555a24b240ff68d5bdbb48b4a (diff)
downloadUXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar.gz
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar.lz
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.tar.xz
UXP-1626b5d7041ea9c3db92200f91542da46e49dde6.zip
Merge branch 'master' into Basilisk-releasev2018.11.04
Diffstat (limited to 'dom/base/nsGlobalWindow.cpp')
-rw-r--r--dom/base/nsGlobalWindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index 88cebe42b..86160c77c 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -2023,7 +2023,7 @@ nsGlobalWindow::ClearControllers()
}
void
-nsGlobalWindow::FreeInnerObjects()
+nsGlobalWindow::FreeInnerObjects(bool aForDocumentOpen)
{
NS_ASSERTION(IsInnerWindow(), "Don't free inner objects on an outer window");
@@ -2082,8 +2082,10 @@ nsGlobalWindow::FreeInnerObjects()
mDocumentURI = mDoc->GetDocumentURI();
mDocBaseURI = mDoc->GetDocBaseURI();
- while (mDoc->EventHandlingSuppressed()) {
- mDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents, false);
+ if (!aForDocumentOpen) {
+ while (mDoc->EventHandlingSuppressed()) {
+ mDoc->UnsuppressEventHandlingAndFireEvents(nsIDocument::eEvents, false);
+ }
}
// Note: we don't have to worry about eAnimationsOnly suppressions because
@@ -3000,6 +3002,8 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
nsCOMPtr<WindowStateHolder> wsh = do_QueryInterface(aState);
NS_ASSERTION(!aState || wsh, "What kind of weird state are you giving me here?");
+ bool handleDocumentOpen = false;
+
JS::Rooted<JSObject*> newInnerGlobal(cx);
if (reUseInnerWindow) {
// We're reusing the current inner window.
@@ -3091,6 +3095,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
if (currentInner && currentInner->GetWrapperPreserveColor()) {
if (oldDoc == aDocument) {
+ handleDocumentOpen = true;
// Move the navigator from the old inner window to the new one since
// this is a document.write. This is safe from a same-origin point of
// view because document.write can only be used by the same origin.
@@ -3115,7 +3120,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
// Don't free objects on our current inner window if it's going to be
// held in the bfcache.
if (!currentInner->IsFrozen()) {
- currentInner->FreeInnerObjects();
+ currentInner->FreeInnerObjects(handleDocumentOpen);
}
}