Bug 1646561 - Stop using DocShell::GetVisibility in nsFocusManager. r=emilio,mconley
We stop checking for the tab state to be `STATE_LOADED` since it messes up initial focus. Instead, we directly check if the tab is warming, since that was the intention of this check, AFAICT. See Bug 1397426 for where this was introduced. Differential Revision: https://phabricator.services.mozilla.com/D108452
This commit is contained in:
@@ -476,9 +476,9 @@ class AsyncTabSwitcher {
|
||||
this.noteMakingTabVisibleWithoutLayers();
|
||||
}
|
||||
|
||||
this.maybeActivateDocShell(this.requestedTab);
|
||||
this.tabbrowser._adjustFocusAfterTabSwitch(showTab);
|
||||
this.window.gURLBar.afterTabSwitchFocusChange();
|
||||
this.maybeActivateDocShell(this.requestedTab);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,14 +538,13 @@ class AsyncTabSwitcher {
|
||||
// the loaded state, but the DocShell is still not yet active, we
|
||||
// should activate it.
|
||||
let browser = tab.linkedBrowser;
|
||||
let state = this.getTabState(tab);
|
||||
let canCheckDocShellState =
|
||||
!browser.mDestroyed &&
|
||||
(browser.docShell || browser.frameLoader.remoteTab);
|
||||
if (
|
||||
tab == this.requestedTab &&
|
||||
canCheckDocShellState &&
|
||||
state == this.STATE_LOADED &&
|
||||
!this.warmingTabs.has(tab) &&
|
||||
!browser.docShellIsActive &&
|
||||
!this.minimizedOrFullyOccluded
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user