зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1099046 - Autocomplete popup displays "moz-action:searchengine,..." for keyword searches while pressing Shift. r=mak
This commit is contained in:
Родитель
e5e50e6761
Коммит
0f72f4bec2
|
@ -418,16 +418,16 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
|
|||
|
||||
/* For results that are actions, their description text is shown instead of
|
||||
the URL - this needs to follow the locale's direction, unlike URLs. */
|
||||
panel:not([noactions]) > richlistbox > richlistitem[type~="action"]:-moz-locale-dir(rtl) > .ac-url-box {
|
||||
panel:not([noactions]) > richlistbox > richlistitem.overridable-action:-moz-locale-dir(rtl) > .ac-url-box {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .ac-url > .ac-action-text,
|
||||
panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .ac-action-icon {
|
||||
panel[noactions] > richlistbox > richlistitem.overridable-action > .ac-url-box > .ac-url > .ac-action-text,
|
||||
panel[noactions] > richlistbox > richlistitem.overridable-action > .ac-url-box > .ac-action-icon {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .ac-url > .ac-url-text {
|
||||
panel[noactions] > richlistbox > richlistitem.overridable-action > .ac-url-box > .ac-url > .ac-url-text {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ skip-if = os == "linux" # Bug 924307
|
|||
skip-if = e10s # Bug 1093153 - no about:home support yet
|
||||
[browser_aboutSyncProgress.js]
|
||||
[browser_action_keyword.js]
|
||||
[browser_action_keyword_override.js]
|
||||
[browser_action_searchengine.js]
|
||||
[browser_action_searchengine_alias.js]
|
||||
[browser_addKeywordSearch.js]
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
add_task(function*() {
|
||||
// This test is only relevant if UnifiedComplete is enabled.
|
||||
if (!Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete")) {
|
||||
todo(false, "Stop supporting old autocomplete components.");
|
||||
return;
|
||||
}
|
||||
|
||||
let itemId =
|
||||
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
|
||||
NetUtil.newURI("http://example.com/?q=%s"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"test");
|
||||
PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "keyword");
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
PlacesUtils.bookmarks.removeItem(itemId);
|
||||
});
|
||||
|
||||
yield promiseAutocompleteResultPopup("keyword search");
|
||||
let result = gURLBar.popup.richlistbox.children[0];
|
||||
|
||||
info("Before override");
|
||||
is_element_hidden(result._url, "URL element should be hidden");
|
||||
is_element_visible(result._extra, "Extra element should be visible");
|
||||
|
||||
info("During override");
|
||||
EventUtils.synthesizeKey("VK_SHIFT" , { type: "keydown" });
|
||||
is_element_hidden(result._url, "URL element should be hidden");
|
||||
is_element_visible(result._extra, "Extra element should be visible");
|
||||
|
||||
EventUtils.synthesizeKey("VK_SHIFT" , { type: "keyup" });
|
||||
|
||||
gURLBar.popup.hidePopup();
|
||||
yield promisePopupHidden(gURLBar.popup);
|
||||
});
|
|
@ -1591,6 +1591,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
|
|||
this._titleBox.flex = 1;
|
||||
|
||||
this.removeAttribute("actiontype");
|
||||
this.classList.remove("overridable-action");
|
||||
|
||||
// The ellipses are hidden via their visibility so that they always
|
||||
// take up space and don't pop in on top of text when shown. For
|
||||
|
@ -1607,6 +1608,7 @@ extends="chrome://global/content/bindings/popup.xml#popup">
|
|||
this.setAttribute("actiontype", action.type);
|
||||
|
||||
if (action.type == "switchtab") {
|
||||
this.classList.add("overridable-action");
|
||||
displayUrl = action.params.url;
|
||||
let desc = this._stringBundle.GetStringFromName("switchToTab");
|
||||
this._setUpDescription(this._action, desc, true);
|
||||
|
@ -1719,7 +1721,8 @@ extends="chrome://global/content/bindings/popup.xml#popup">
|
|||
this._setUpDescription(this._extra, params);
|
||||
|
||||
// Don't emphasize keyword searches in the title or url
|
||||
this.setAttribute("text", "");
|
||||
emphasiseUrl = false;
|
||||
emphasiseTitle = false;
|
||||
} else {
|
||||
// Don't show any description for non keyword types.
|
||||
this._setUpDescription(this._extra, "", true);
|
||||
|
|
Загрузка…
Ссылка в новой задаче