Commit cd99d52b authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1673683 - Copy activeness status in CanonicalBrowsingContext::ReplacedBy,...

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
parent c10e4bec
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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);
+0 −7
Original line number Diff line number Diff line
@@ -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();