Bug 1375833 - Part 1: Do not clear subframe history on normal reload. r=smaug

In bug 1326251 we made gecko aggressively clear frame history. It turns out to
be too aggressive comparing to all other major browsers. This patch reverses
the behavior, so that only force reload and fresh would clear frame history,
but not normal reload.

MozReview-Commit-ID: EYVaA13cp6b
This commit is contained in:
Samael Wang
2017-08-11 14:47:20 +08:00
parent b061c0be7f
commit b565faea77

View File

@@ -11973,12 +11973,16 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
} else if (mOSHE) {
mOSHE->SetCacheKey(cacheKey);
}
// Since we're force-reloading, clear all the sub frame history.
ClearFrameHistory(mLSHE);
ClearFrameHistory(mOSHE);
}
// Clear subframe history on refresh or reload.
// Clear subframe history on refresh.
// XXX: history.go(0) won't go this path as aLoadType is LOAD_HISTORY in this
// case. One should re-validate after bug 1331865 fixed.
if (aLoadType == LOAD_REFRESH || (aLoadType & LOAD_CMD_RELOAD)) {
if (aLoadType == LOAD_REFRESH) {
ClearFrameHistory(mLSHE);
ClearFrameHistory(mOSHE);
}