Bug 583000 - Don't try to measure the tab width if there is only one tab. Fixes broken popup windows with browser.tabs.closeWindowWithLastTab=false where accessing tabbrowser.tabs during the construction of tabbrowser-tabs would fail. r=gavin

--HG--
extra : rebase_source : 2fd228cf6903d910ff352f8f754ab1334924c08d
This commit is contained in:
Dão Gottwald 2010-08-25 20:06:49 +02:00
Родитель ea52c5636c
Коммит 00211b001d
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -2650,9 +2650,12 @@
this.setAttribute("closebuttons", "activetab");
break;
case 1:
if (this.childNodes.length == 1 && this._closeWindowWithLastTab)
this.setAttribute("closebuttons", "noclose");
else {
if (this.childNodes.length == 1) {
if (this._closeWindowWithLastTab)
this.setAttribute("closebuttons", "noclose");
else
this.setAttribute("closebuttons", "alltabs");
} else {
let tab = this.tabbrowser.visibleTabs[this.tabbrowser._numPinnedTabs];
if (tab && tab.getBoundingClientRect().width > this.mTabClipWidth)
this.setAttribute("closebuttons", "alltabs");