Bug 1319366 - When fullscreen, defer new tab selection until exiting fullscreen completed. r=jchen,sebastian

MozReview-Commit-ID: 2vAkpp7M7Cv

--HG--
extra : rebase_source : f6444974a190e8f0992bb7af6446739c14821a11
This commit is contained in:
Nevin Chen 2017-02-03 18:00:27 +08:00
Родитель e065b3c989
Коммит 6c1328a7f4
1 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -432,7 +432,7 @@ var BrowserApp = {
// Tab selection has changed during a fullscreen transition, handle it now.
let tab = this.fullscreenTransitionTab;
this.fullscreenTransitionTab = null;
this._handleTabSelected(tab);
this.selectTab(tab);
}
});
@ -1206,8 +1206,21 @@ var BrowserApp = {
addTab: function addTab(aURI, aParams) {
aParams = aParams || {};
let fullscreenState;
if (this.selectedBrowser) {
fullscreenState = this.selectedBrowser.contentDocument.fullscreenElement;
if (fullscreenState) {
aParams.selected = false;
}
}
let newTab = new Tab(aURI, aParams);
if (fullscreenState) {
this.fullscreenTransitionTab = newTab;
doc.exitFullscreen();
}
if (typeof aParams.tabIndex == "number") {
this._tabs.splice(aParams.tabIndex, 0, newTab);
} else {
@ -1312,6 +1325,7 @@ var BrowserApp = {
// remember the new tab for this.
this.fullscreenTransitionTab = aTab;
doc.exitFullscreen();
return;
}
let message = {