Bug 564170 - ctrlTab_advanceFocus incorrectly assumes the popupshown has been received if the panel's state is 'open'. r=enn

--HG--
extra : rebase_source : b27e0b98dee9c0f0dbf6cd848650245d1fe19ba2
This commit is contained in:
Dão Gottwald 2010-05-07 09:50:04 +02:00
Родитель d71ab66b3b
Коммит c1239d7c22
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -310,12 +310,14 @@ var ctrlTab = {
}, },
advanceFocus: function ctrlTab_advanceFocus(aForward) { advanceFocus: function ctrlTab_advanceFocus(aForward) {
if (this.panel.state == "open") { if (this._selectedIndex == -1) {
// No virtual selectedIndex, focus must be in the panel already.
if (aForward) if (aForward)
document.commandDispatcher.advanceFocus(); document.commandDispatcher.advanceFocus();
else else
document.commandDispatcher.rewindFocus(); document.commandDispatcher.rewindFocus();
} else { } else {
// Focus isn't in the panel yet, so we maintain a virtual selectedIndex.
do { do {
this._selectedIndex += aForward ? 1 : -1; this._selectedIndex += aForward ? 1 : -1;
if (this._selectedIndex < 0) if (this._selectedIndex < 0)