Bug 1520791 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Before bug 1506608 landed, we were flipping the remoteness of the initial tab, which caused us to hit this part of the codebase: [1].

shouldActivateDocShell would return true, and bam, the docShellIsActive property would be set to true.

Because we don't flip remoteness for the initial tab (which is a good thing), we never hit this code path, so the property is never touched.

What's particularly troubling is that the TabParent and the underlying DocShell are out of sync - TabParent's mDocShellIsActive member defaults to false[2], but DocShell's mIsActive member defaults to true[3]. That's what Gijs was seeing in comment 1.

Given how close we are to the uplift, here's what I suggest:

1. We paper over the issue the safe way by setting the docShellIsActive property on the TabParent for the initial tab manually.
2. File a follow-up bug to reconcile the initial active states between TabParent and nsDocShell.


[1]: https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/browser/base/content/tabbrowser.js#1697-1701
[2]: https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/dom/ipc/TabParent.cpp#158
[3]: https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/docshell/base/nsDocShell.cpp#366
Before bug 1506608 landed, we were flipping the remoteness of the initial tab, which caused us to hit this part of the codebase:  ([1]).

shouldActivateDocShell would return true, and bam, the docShellIsActive property would be set to true.

Because we don't flip remoteness for the initial tab (which is a good thing), we never hit this code path, so the property is never touched.

What's particularly troubling is that the TabParent and the underlying DocShell are out of sync - TabParent's mDocShellIsActive member defaults to false ([2]), but DocShell's mIsActive member defaults to true ([3]). That's what Gijs was seeing in comment 1.

Given how close we are to the uplift, here's what I suggest:

1. We paper over the issue the safe way by setting the docShellIsActive property on the TabParent for the initial tab manually.
2. File a follow-up bug to reconcile the initial active states between TabParent and nsDocShell.


[1]: https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/browser/base/content/tabbrowser.js#1697-1701
[2]: https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/dom/ipc/TabParent.cpp#158
[3]: https://searchfox.org/mozilla-central/rev/bee8cf15c901b9f4b0c074c9977da4bbebc506e3/docshell/base/nsDocShell.cpp#366

Back to Bug 1520791 Comment 3