Bug 1742865 - Handle meta refresh correctly with session history in the parent. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D132837
This commit is contained in:
Peter Van der Beken
2021-12-16 15:31:56 +00:00
parent bc497a82ac
commit 0997cc99bd
9 changed files with 268 additions and 13 deletions

View File

@@ -8940,8 +8940,11 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
this, mLoadingEntry->mInfo.GetURI()->GetSpecOrDefault().get()));
bool hadActiveEntry = !!mActiveEntry;
mActiveEntry = MakeUnique<SessionHistoryInfo>(mLoadingEntry->mInfo);
// We're passing in mCurrentURI, which could be null. SessionHistoryCommit
// does require a non-null uri if this is for a refresh load of the same
// URI, but in that case mCurrentURI won't be null here.
mBrowsingContext->SessionHistoryCommit(
*mLoadingEntry, mLoadType, hadActiveEntry, true, true,
*mLoadingEntry, mLoadType, mCurrentURI, hadActiveEntry, true, true,
/* No expiration update on the same document loads*/
false);
// FIXME Need to set postdata.
@@ -13472,8 +13475,13 @@ void nsDocShell::MoveLoadingToActiveEntry(bool aPersist, bool aExpired) {
MOZ_ASSERT(loadingEntry);
uint32_t loadType =
mLoadType == LOAD_ERROR_PAGE ? mFailedLoadType : mLoadType;
mBrowsingContext->SessionHistoryCommit(
*loadingEntry, loadType, hadActiveEntry, aPersist, false, aExpired);
// We're passing in mCurrentURI, which could be null. SessionHistoryCommit
// does require a non-null uri if this is for a refresh load of the same
// URI, but in that case mCurrentURI won't be null here.
mBrowsingContext->SessionHistoryCommit(*loadingEntry, loadType, mCurrentURI,
hadActiveEntry, aPersist, false,
aExpired);
}
}