Bug 655584 - Close popup when switching to tab that previously had urlbar focused. r=gavin

This commit is contained in:
Brian R. Bondy 2011-05-25 10:44:28 +02:00
Родитель 6fd7f68025
Коммит ce67658990
3 изменённых файлов: 28 добавлений и 0 удалений

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

@ -963,6 +963,10 @@
// if the tab is a blank one.
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
if (newBrowser._urlbarFocused && gURLBar) {
// Explicitly close the popup if the URL bar retains focus
gURLBar.closePopup();
if (!window.fullScreen) {
gURLBar.focus();
break;

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

@ -171,6 +171,7 @@ _BROWSER_FILES = \
browser_bug623893.js \
browser_bug624734.js \
browser_bug647886.js \
browser_bug655584.js \
browser_findbarClose.js \
browser_contextSearchTabPosition.js \
browser_ctrlTab.js \

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

@ -0,0 +1,23 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// Bug 655584 - awesomebar suggestions don't update after tab is closed
function test() {
var tab1 = gBrowser.addTab();
var tab2 = gBrowser.addTab();
// When urlbar in a new tab is focused, and a tab switch occurs,
// the urlbar popup should be closed
gBrowser.selectedTab = tab2;
gURLBar.focus(); // focus the urlbar in the tab we will switch to
gBrowser.selectedTab = tab1;
gURLBar.openPopup();
gBrowser.selectedTab = tab2;
ok(!gURLBar.popupOpen, "urlbar focused in tab to switch to, close popup");
// cleanup
gBrowser.removeCurrentTab();
gBrowser.removeCurrentTab();
}