mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1198687 - Fix the accessibility of the urlbar's search suggestions opt-in notification. r=mak
This commit is contained in:
parent
507ce3d9de
commit
adbe205171
@ -1107,18 +1107,32 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
<binding id="urlbar-rich-result-popup" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete-rich-result-popup">
|
||||
|
||||
<content ignorekeys="true" level="top" consumeoutsideclicks="never">
|
||||
<xul:hbox anonid="search-suggestions-notification" align="center">
|
||||
<xul:hbox anonid="search-suggestions-notification"
|
||||
align="center"
|
||||
role="alert"
|
||||
aria-describedby="search-suggestions-notification-text">
|
||||
<xul:description flex="1">
|
||||
&urlbar.searchSuggestionsNotification.question;
|
||||
<xul:label anonid="search-suggestions-notification-learn-more"
|
||||
<!-- Several things here are to make the label accessibile via an
|
||||
accesskey so that a11y doesn't suck: the accesskey, using an
|
||||
onclick handler instead of an href attribute, the control
|
||||
attribute, and having the control attribute refer to a valid ID
|
||||
that is the label itself. -->
|
||||
<xul:label id="search-suggestions-notification-learn-more"
|
||||
class="text-link"
|
||||
value="&urlbar.searchSuggestionsNotification.learnMore;"/>
|
||||
role="link"
|
||||
value="&urlbar.searchSuggestionsNotification.learnMore;"
|
||||
accesskey="&urlbar.searchSuggestionsNotification.learnMore.accesskey;"
|
||||
onclick="document.getBindingParent(this).openSearchSuggestionsNotificationLearnMoreURL();"
|
||||
control="search-suggestions-notification-learn-more"/>
|
||||
</xul:description>
|
||||
<xul:button anonid="search-suggestions-notification-disable"
|
||||
label="&urlbar.searchSuggestionsNotification.disable;"
|
||||
accesskey="&urlbar.searchSuggestionsNotification.disable.accesskey;"
|
||||
onclick="document.getBindingParent(this).dismissSearchSuggestionsNotification(false);"/>
|
||||
<xul:button anonid="search-suggestions-notification-enable"
|
||||
label="&urlbar.searchSuggestionsNotification.enable;"
|
||||
accesskey="&urlbar.searchSuggestionsNotification.enable.accesskey;"
|
||||
onclick="document.getBindingParent(this).dismissSearchSuggestionsNotification(true);"/>
|
||||
</xul:hbox>
|
||||
<xul:richlistbox anonid="richlistbox" class="autocomplete-richlistbox"
|
||||
@ -1143,16 +1157,19 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
);
|
||||
</field>
|
||||
|
||||
<field name="searchSuggestionsNotificationLearnMoreLink" readonly="true">
|
||||
document.getAnonymousElementByAttribute(
|
||||
this, "anonid", "search-suggestions-notification-learn-more"
|
||||
);
|
||||
</field>
|
||||
|
||||
<field name="footer" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "footer");
|
||||
</field>
|
||||
|
||||
<method name="openSearchSuggestionsNotificationLearnMoreURL">
|
||||
<body><![CDATA[
|
||||
let url = Services.urlFormatter.formatURL(
|
||||
Services.prefs.getCharPref("app.support.baseURL") + "suggestions"
|
||||
);
|
||||
openUILinkIn(url, "tab");
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="dismissSearchSuggestionsNotification">
|
||||
<parameter name="enableSuggestions"/>
|
||||
<body><![CDATA[
|
||||
@ -1260,15 +1277,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
<parameter name="aElement"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
// Set the learn-more link href.
|
||||
let link = this.searchSuggestionsNotificationLearnMoreLink;
|
||||
if (!link.hasAttribute("href")) {
|
||||
let url = Services.urlFormatter.formatURL(
|
||||
Services.prefs.getCharPref("app.support.baseURL") + "suggestions"
|
||||
);
|
||||
link.setAttribute("href", url);
|
||||
}
|
||||
|
||||
// With the notification shown, the listbox's height can sometimes be
|
||||
// too small when it's flexed, as it normally is. Also, it can start
|
||||
// out slightly scrolled down. Both problems appear together, most
|
||||
@ -1283,6 +1291,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
this.classList.add("showSearchSuggestionsNotification");
|
||||
this._updateFooterVisibility();
|
||||
|
||||
// This event allows accessibility APIs to see the notification.
|
||||
if (!this.popupOpen) {
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("AlertActive", true, true);
|
||||
this.searchSuggestionsNotification.dispatchEvent(event);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -410,8 +410,11 @@ These should match what Safari and other Apple applications use on OS X Lion. --
|
||||
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.question "Would you like to improve your search experience with suggestions?">
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.learnMore "Learn more…">
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.learnMore.accesskey "l">
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.disable "No">
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.disable.accesskey "n">
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.enable "Yes">
|
||||
<!ENTITY urlbar.searchSuggestionsNotification.enable.accesskey "y">
|
||||
|
||||
<!--
|
||||
Comment duplicated from browser-sets.inc:
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#PopupAutoCompleteRichResult > hbox[anonid="search-suggestions-notification"] > button {
|
||||
-moz-appearance: none;
|
||||
-moz-user-focus: ignore;
|
||||
min-width: 80px;
|
||||
border-radius: 3px;
|
||||
padding: 4px 16px;
|
||||
|
Loading…
Reference in New Issue
Block a user