Bug 1119450: Clicks on the search go button shouldn't open the search popup. r=felipe

--HG--
extra : rebase_source : 0f7fa4e6e6cc833a41cac28288bdce38722815a7
This commit is contained in:
Dave Townsend 2015-01-09 11:05:50 -08:00
parent 8714e66bdc
commit 6022ced1e2
2 changed files with 22 additions and 0 deletions

View File

@ -751,6 +751,11 @@
<handler event="click" button="0">
<![CDATA[
// Ignore clicks on the search go button.
if (event.originalTarget.getAttribute("anonid") == "search-go-button") {
return;
}
// Open the suggestions whenever clicking on the search icon or if there
// is text in the textbox.
if (event.originalTarget.getAttribute("anonid") == "searchbar-search-button" ||

View File

@ -3,6 +3,7 @@
const searchbar = document.getElementById("searchbar");
const searchIcon = document.getAnonymousElementByAttribute(searchbar, "anonid", "searchbar-search-button");
const goButton = document.getAnonymousElementByAttribute(searchbar, "anonid", "search-go-button");
const textbox = searchbar._textbox;
const searchPopup = document.getElementById("PopupSearchAutoComplete");
@ -318,3 +319,19 @@ add_task(function* refocus_window_doesnt_open_popup_keyboard() {
searchPopup.removeEventListener("popupshowing", listener, false);
textbox.value = "";
});
// Clicking the search go button shouldn't open the popup
add_no_popup_task(function* search_go_doesnt_open_popup() {
gBrowser.selectedTab = gBrowser.addTab();
gURLBar.focus();
textbox.value = "foo";
searchbar.inputChanged();
let promise = promiseOnLoad();
EventUtils.synthesizeMouseAtCenter(goButton, {});
yield promise;
textbox.value = "";
gBrowser.removeCurrentTab();
});