Bug 1043106 - part 2 - StorageEvent should have the storageArea of the correct window, r=smaug

This commit is contained in:
Andrea Marchesini 2014-08-13 15:55:44 +02:00
parent c9a4a4a116
commit f77e8cafae

View File

@ -2677,14 +2677,14 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
if (!aState) {
if (reUseInnerWindow) {
// The storage objects contain the URL of the window. We have to recreate
// them when the innerWindow is reused.
newInnerWindow->mLocalStorage = nullptr;
newInnerWindow->mSessionStorage = nullptr;
if (newInnerWindow->mDoc != aDocument) {
newInnerWindow->mDoc = aDocument;
// The storage objects contain the URL of the window. We have to
// recreate them when the innerWindow is reused.
newInnerWindow->mLocalStorage = nullptr;
newInnerWindow->mSessionStorage = nullptr;
if (newInnerWindow->IsDOMBinding()) {
WindowBinding::ClearCachedDocumentValue(cx, newInnerWindow);
} else {