author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Tue, 10 Oct 2017 17:48:02 +0200 | |
changeset 385343 | 6771bdd9b24eedc4df2f99f2e77874acf38a0b56 |
parent 385342 | 672c8297a9b4a9967c24bec456597b03458f90c7 |
child 385344 | 4eae12c81330175739f303189d82ddcb0fa434de |
push id | 32652 |
push user | archaeopteryx@coole-files.de |
push date | Tue, 10 Oct 2017 21:49:31 +0000 |
treeherder | mozilla-central@f1ecd5c26948 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1404651 |
milestone | 58.0a1 |
backs out | 6bec02f9a646f11777dbc12ceeb90af76198242d |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1418,21 +1418,23 @@ oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused); if (this.isFindBarInitialized(oldTab)) { let findBar = this.getFindBar(oldTab); oldTab._findBarFocused = (!findBar.hidden && findBar._findField.getAttribute("focused") == "true"); } - let activeEl = document.activeElement; - // In e10s, if focus isn't already in the tabstrip or on the new browser, - // and the new browser's previous focus wasn't in the url bar but focus is - // there now, we need to adjust focus further. - if (gMultiProcessBrowser && activeEl != newBrowser && activeEl != newTab) { + // If focus is in the tab bar, retain it there. + if (document.activeElement == oldTab) { + // We need to explicitly focus the new tab, because + // tabbox.xml does this only in some cases. + newTab.focus(); + } else if (gMultiProcessBrowser && document.activeElement !== newBrowser) { + let keepFocusOnUrlBar = newBrowser && newBrowser._urlbarFocused && gURLBar && gURLBar.focused; if (!keepFocusOnUrlBar) { // Clear focus so that _adjustFocusAfterTabSwitch can detect if // some element has been focused and respect that. document.activeElement.blur();