diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index e0e19b8da30d..de66e66d8a96 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -1876,10 +1876,11 @@ aBrowser.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. + // This shouldn't really be necessary (it should always set the same + // value as activeness is correctly preserved across remoteness changes). + // However, this has the side effect of sending MozLayerTreeReady / + // MozLayerTreeCleared events for remote frames, which the tab switcher + // depends on. aBrowser.docShellIsActive = this.shouldActivateDocShell(aBrowser); // Create a new tab progress listener for the new browser we just injected, @@ -5695,10 +5696,11 @@ 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. + // This shouldn't really be necessary (it should always set the same + // value as activeness is correctly preserved across remoteness changes). + // However, this has the side effect of sending MozLayerTreeReady / + // MozLayerTreeCleared events for remote frames, which the tab switcher + // depends on. browser.docShellIsActive = this.shouldActivateDocShell(browser); // Create a new tab progress listener for the new browser we just diff --git a/docshell/base/CanonicalBrowsingContext.cpp b/docshell/base/CanonicalBrowsingContext.cpp index 7c536a54ed5b..7f01ff6cf8af 100644 --- a/docshell/base/CanonicalBrowsingContext.cpp +++ b/docshell/base/CanonicalBrowsingContext.cpp @@ -167,6 +167,8 @@ void CanonicalBrowsingContext::ReplacedBy( aNewContext->mWebProgress = std::move(mWebProgress); aNewContext->mFields.SetWithoutSyncing(GetBrowserId()); aNewContext->mFields.SetWithoutSyncing(GetHistoryID()); + aNewContext->mFields.SetWithoutSyncing( + GetExplicitActive()); if (mSessionHistory) { mSessionHistory->SetBrowsingContext(aNewContext); diff --git a/mobile/android/chrome/geckoview/geckoview.js b/mobile/android/chrome/geckoview/geckoview.js index 2396a4e084bc..2f2803faf331 100644 --- a/mobile/android/chrome/geckoview/geckoview.js +++ b/mobile/android/chrome/geckoview/geckoview.js @@ -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();