Bug 1515073 - Part 1 - Add nsISHEntry::hasUserInteraction. r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D27585
This commit is contained in:
Johann Hofmann
2020-06-09 14:48:38 +00:00
parent 232b22e995
commit 60decee3b0
10 changed files with 157 additions and 7 deletions

View File

@@ -10750,8 +10750,24 @@ nsresult nsDocShell::AddToSessionHistory(
if (loadedEntryIndex.isSome()) {
mLoadedEntryIndex = loadedEntryIndex.value();
}
// aCloneChildren implies that we are retaining the same document, thus we
// need to signal to the top WC that the new SHEntry may receive a fresh
// user interaction flag.
if (aCloneChildren) {
WindowContext* topWc = mBrowsingContext->GetTopWindowContext();
if (topWc) {
topWc->SetSHEntryHasUserInteraction(false);
}
}
} else {
// This is a subframe.
// This is a subframe, make sure that this new SHEntry will be
// marked with user interaction.
WindowContext* topWc = mBrowsingContext->GetTopWindowContext();
if (topWc) {
topWc->SetSHEntryHasUserInteraction(false);
}
if (!mOSHE || !LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY)) {
rv = AddChildSHEntryToParent(entry, mChildOffset, aCloneChildren);
}