mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 950014 - [Australis] Ctrl-K no longer goes to home page of default search engine (when search toolbar hidden). r=mconley,gijs
--HG-- extra : rebase_source : 011ff25a2a6ed81e93c45f041ead35d5cf2be82b
This commit is contained in:
parent
57dfa18eb4
commit
3af4176799
@ -2950,13 +2950,11 @@ const BrowserSearch = {
|
||||
openSearchPageIfFieldIsNotActive(searchBar);
|
||||
};
|
||||
if (placement && placement.area == CustomizableUI.AREA_PANEL) {
|
||||
PanelUI.show().then(() => {
|
||||
// The panel is not constructed until the first time it is shown.
|
||||
focusSearchBar();
|
||||
});
|
||||
// The panel is not constructed until the first time it is shown.
|
||||
PanelUI.show().then(focusSearchBar);
|
||||
return;
|
||||
}
|
||||
if (placement.area == CustomizableUI.AREA_NAVBAR && searchBar &&
|
||||
if (placement && placement.area == CustomizableUI.AREA_NAVBAR && searchBar &&
|
||||
searchBar.parentNode.classList.contains("overflowedItem")) {
|
||||
let navBar = document.getElementById(CustomizableUI.AREA_NAVBAR);
|
||||
navBar.overflowable.show().then(() => {
|
||||
|
@ -86,6 +86,30 @@ add_task(function() {
|
||||
is(document.activeElement, searchbar.textbox.inputField, "The searchbar should be focused");
|
||||
});
|
||||
|
||||
// Ctrl+K should open the search page if the search bar has been customized out.
|
||||
add_task(function() {
|
||||
this.originalOpenUILinkIn = openUILinkIn;
|
||||
try {
|
||||
CustomizableUI.removeWidgetFromArea("search-container");
|
||||
let placement = CustomizableUI.getPlacementOfWidget("search-container");
|
||||
is(placement, null, "Search container should be in palette");
|
||||
|
||||
let openUILinkInCalled = false;
|
||||
openUILinkIn = (aUrl, aWhichTab) => {
|
||||
is(aUrl, Services.search.defaultEngine.searchForm, "Search page should be requested to open.");
|
||||
is(aWhichTab, "current", "Should use the current tab for the search page.");
|
||||
openUILinkInCalled = true;
|
||||
};
|
||||
sendWebSearchKeyCommand();
|
||||
yield waitForCondition(function() openUILinkInCalled);
|
||||
ok(openUILinkInCalled, "The search page should have been opened.")
|
||||
} catch (e) {
|
||||
ok(false, e);
|
||||
}
|
||||
openUILinkIn = this.originalOpenUILinkIn;
|
||||
CustomizableUI.reset();
|
||||
});
|
||||
|
||||
function sendWebSearchKeyCommand() {
|
||||
if (Services.appinfo.OS === "Darwin")
|
||||
EventUtils.synthesizeKey("k", { accelKey: true });
|
||||
|
Loading…
Reference in New Issue
Block a user