Bug 1679418 - Fix test_bug1300461.html failure for Fission. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D99711
This commit is contained in:
Peter Van der Beken
2021-01-25 12:59:26 +00:00
parent 8dbcdcafd4
commit df4a302874
2 changed files with 20 additions and 19 deletions

View File

@@ -427,18 +427,21 @@ CanonicalBrowsingContext::ReplaceLoadingSessionHistoryEntryForLoad(
}
newEntry->SetDocshellID(GetHistoryID());
newEntry->SetIsDynamicallyAdded(CreatedDynamically());
newEntry->SetForInitialLoad(true);
// Replacing the old entry.
SessionHistoryEntry::SetByLoadId(aInfo->mLoadId, newEntry);
bool forInitialLoad = true;
for (size_t i = 0; i < mLoadingEntries.Length(); ++i) {
if (mLoadingEntries[i].mLoadId == aInfo->mLoadId) {
forInitialLoad = mLoadingEntries[i].mEntry->ForInitialLoad();
mLoadingEntries[i].mEntry = newEntry;
break;
}
}
newEntry->SetForInitialLoad(forInitialLoad);
return MakeUnique<LoadingSessionHistoryInfo>(newEntry, aInfo->mLoadId);
}
@@ -510,12 +513,9 @@ void CanonicalBrowsingContext::SessionHistoryCommit(uint64_t aLoadId,
bool addEntry = ShouldUpdateSessionHistory(aLoadType);
if (IsTop()) {
mActiveEntry = newActiveEntry;
if (loadFromSessionHistory) {
// XXX Synchronize browsing context tree and session history tree?
shistory->UpdateIndex();
} else {
if (LOAD_TYPE_HAS_FLAGS(
aLoadType, nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY)) {
if (LOAD_TYPE_HAS_FLAGS(aLoadType,
nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY)) {
// Replace the current entry with the new entry.
int32_t index = shistory->GetIndexForReplace();
@@ -527,10 +527,12 @@ void CanonicalBrowsingContext::SessionHistoryCommit(uint64_t aLoadId,
}
}
if (addEntry) {
if (loadFromSessionHistory) {
// XXX Synchronize browsing context tree and session history tree?
shistory->UpdateIndex();
} else if (addEntry) {
shistory->AddEntry(mActiveEntry, aPersist);
}
}
} else {
// FIXME The old implementations adds it to the parent's mLSHE if there
// is one, need to figure out if that makes sense here (peterv

View File

@@ -104,7 +104,6 @@ skip-if = verify && (os == 'mac') && debug && webrender # Hit MOZ_CRASH(Shutdown
skip-if = sessionHistoryInParent # It relies on the bfcache
[test_bug1609475.html]
[test_bug1300461.html]
fail-if = sessionHistoryInParent
[test_bug1326251.html]
skip-if = toolkit == 'android' || sessionHistoryInParent # It relies on the bfcache
[test_bug1379762.html]