Bug 1322896, synchronize SHistory entry with mLSHE, r=bz
This commit is contained in:
@@ -11847,6 +11847,21 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
|
||||
aPrincipalToInherit, aCloneSHChildren,
|
||||
getter_AddRefs(mLSHE));
|
||||
}
|
||||
} else if (mSessionHistory && mLSHE && mURIResultedInDocument) {
|
||||
// Even if we don't add anything to SHistory, ensure the current index
|
||||
// points to the same SHEntry as our mLSHE.
|
||||
int32_t index = 0;
|
||||
mSessionHistory->GetRequestedIndex(&index);
|
||||
if (index == -1) {
|
||||
mSessionHistory->GetIndex(&index);
|
||||
}
|
||||
nsCOMPtr<nsISHEntry> currentSH;
|
||||
mSessionHistory->GetEntryAtIndex(index, false, getter_AddRefs(currentSH));
|
||||
if (currentSH != mLSHE) {
|
||||
nsCOMPtr<nsISHistoryInternal> shPrivate =
|
||||
do_QueryInterface(mSessionHistory);
|
||||
shPrivate->ReplaceEntry(index, mLSHE);
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a POST request, we do not want to include this in global
|
||||
|
||||
Reference in New Issue
Block a user