summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-10-21 22:29:42 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-10-23 13:24:20 +0200
commit1e38568816ff685310625a92a225fbcb381bf61b (patch)
treea0ae8631ce116dff7ed08cf6455d34f3a121f637
parentadbbcab423fba28939d73f9a8cadf3b26c5845fc (diff)
downloadUXP-1e38568816ff685310625a92a225fbcb381bf61b.tar
UXP-1e38568816ff685310625a92a225fbcb381bf61b.tar.gz
UXP-1e38568816ff685310625a92a225fbcb381bf61b.tar.lz
UXP-1e38568816ff685310625a92a225fbcb381bf61b.tar.xz
UXP-1e38568816ff685310625a92a225fbcb381bf61b.zip
Issue #1253 - Reset performance object on navigation
This also addresses clearing of document dependent JS slots which might get out of sync with innerWindow navigation; relevant comments added. This resolves #1253
-rw-r--r--dom/base/nsGlobalWindow.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index afaa24f09..ec546f068 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3224,6 +3224,12 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
newInnerWindow->mLocalStorage = nullptr;
newInnerWindow->mSessionStorage = nullptr;
+ newInnerWindow->mPerformance = nullptr;
+
+ // This must be called after nulling the internal objects because
+ // we might recreate them here by calling the getter methods, and
+ // store them into the JS slots. If we null them after, the slot
+ // values and the objects will be out of sync.
newInnerWindow->ClearDocumentDependentSlots(cx);
}
} else {
@@ -3364,10 +3370,16 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
}
mDoc = aDocument;
- ClearDocumentDependentSlots(aCx);
mFocusedNode = nullptr;
mLocalStorage = nullptr;
mSessionStorage = nullptr;
+ mPerformance = nullptr;
+
+ // This must be called after nulling the internal objects because we might
+ // recreate them here by calling the getter methods, and store them into the JS
+ // slots. If we null them after, the slot values and the objects will be
+ // out of sync.
+ ClearDocumentDependentSlots(aCx);
#ifdef DEBUG
mLastOpenedURI = aDocument->GetDocumentURI();