From c1239d7c22272a7be22ae228e11774279c19752c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 7 May 2010 09:50:04 +0200 Subject: [PATCH] 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 --- browser/base/content/browser-tabPreviews.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser-tabPreviews.js b/browser/base/content/browser-tabPreviews.js index 5ba9a2620ae..785101305f9 100644 --- a/browser/base/content/browser-tabPreviews.js +++ b/browser/base/content/browser-tabPreviews.js @@ -310,12 +310,14 @@ var ctrlTab = { }, 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) document.commandDispatcher.advanceFocus(); else document.commandDispatcher.rewindFocus(); } else { + // Focus isn't in the panel yet, so we maintain a virtual selectedIndex. do { this._selectedIndex += aForward ? 1 : -1; if (this._selectedIndex < 0)