Bug 1750973, don't replace the nsILayoutHistoryState object when doing same document history navigations, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D137703
This commit is contained in:
@@ -9005,7 +9005,20 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
|
||||
"%s",
|
||||
this, mLoadingEntry->mInfo.GetURI()->GetSpecOrDefault().get()));
|
||||
bool hadActiveEntry = !!mActiveEntry;
|
||||
|
||||
nsCOMPtr<nsILayoutHistoryState> currentLayoutHistoryState;
|
||||
if (mActiveEntry) {
|
||||
currentLayoutHistoryState = mActiveEntry->GetLayoutHistoryState();
|
||||
}
|
||||
mActiveEntry = MakeUnique<SessionHistoryInfo>(mLoadingEntry->mInfo);
|
||||
if (currentLayoutHistoryState) {
|
||||
// Restore the existing nsILayoutHistoryState object, since it is
|
||||
// possibly being used by the layout. When doing a new load, the
|
||||
// shared state is copied from the existing active entry, so this
|
||||
// special case is needed only with the history loads.
|
||||
mActiveEntry->SetLayoutHistoryState(currentLayoutHistoryState);
|
||||
}
|
||||
|
||||
if (cacheKey != 0) {
|
||||
mActiveEntry->SetCacheKey(cacheKey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user