Bug 1673683 - Copy activeness status in CanonicalBrowsingContext::ReplacedBy, instead of handling it on consumers. r=nika,agi

Differential Revision: https://phabricator.services.mozilla.com/D102220
This commit is contained in:
Emilio Cobos Álvarez 2021-01-20 12:16:20 +00:00
parent 7ffcbf8bb7
commit a3f5fa882e
3 changed files with 2 additions and 13 deletions

View File

@ -5707,12 +5707,6 @@
browser.droppedLinkHandler = oldDroppedLinkHandler;
// Switching a browser's remoteness will create a new frameLoader.
// As frameLoaders start out with an active docShell we have to
// deactivate it if this is not the selected tab's browser or the
// browser window is minimized.
browser.docShellIsActive = this.shouldActivateDocShell(browser);
// Create a new tab progress listener for the new browser we just
// injected, since tab progress listeners have logic for handling the
// initial about:blank load

View File

@ -167,6 +167,8 @@ void CanonicalBrowsingContext::ReplacedBy(
aNewContext->mWebProgress = std::move(mWebProgress);
aNewContext->mFields.SetWithoutSyncing<IDX_BrowserId>(GetBrowserId());
aNewContext->mFields.SetWithoutSyncing<IDX_HistoryID>(GetHistoryID());
aNewContext->mFields.SetWithoutSyncing<IDX_ExplicitActive>(
GetExplicitActive());
if (mSessionHistory) {
mSessionHistory->SetBrowsingContext(aNewContext);

View File

@ -172,18 +172,11 @@ var ModuleManager = {
this.forEach(module => {
module.onDestroyBrowser();
});
// TODO: Bug 1673683: `docShellIsActive` is sometimes not preserved when
// switching process.
this.docShellIsActiveWhileSwitchingProcess = this.browser.docShellIsActive;
},
didChangeBrowserRemoteness() {
debug`DidChangeBrowserRemoteness`;
this.browser.docShellIsActive = this.docShellIsActiveWhileSwitchingProcess;
this.docShellIsActiveWhileSwitchingProcess = undefined;
this.forEach(module => {
if (module.impl) {
module.impl.onInitBrowser();