Bug 1535263 - Move role=combobox from the input field to a parent node. r=Standard8
authorDão Gottwald <dao@mozilla.com>
Thu, 14 Mar 2019 13:59:14 +0000
changeset 524873 df7a6846edf5cb1bb85a4863cbcc117f38d381e1
parent 524872 6e7fb729f772348dcd502040b26744bb906d796f
child 524874 203ed6d898c152b7c93c80fe52f01fa5b9141b8f
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1535263
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1535263 - Move role=combobox from the input field to a parent node. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D23475
browser/base/content/urlbarBindings.xml
browser/components/urlbar/UrlbarView.jsm
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -17,30 +17,29 @@ file, You can obtain one at http://mozil
 ]>
 
 <bindings id="urlbarBindings" xmlns="http://www.mozilla.org/xbl"
           xmlns:html="http://www.w3.org/1999/xhtml"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="urlbar" extends="chrome://global/content/bindings/textbox.xml#textbox">
-    <content>
+    <content role="combobox">
       <children includes="box"/>
       <xul:moz-input-box anonid="moz-input-box"
                          tooltip="aHTMLTooltip"
                          class="urlbar-input-box"
                          flex="1">
         <children/>
         <html:input anonid="scheme"
                     class="urlbar-scheme textbox-input"
                     required="required"
                     xbl:inherits="textoverflow,focused"/>
         <html:input anonid="input"
                     class="urlbar-input textbox-input"
-                    role="combobox"
                     aria-owns="urlbarView-results"
                     aria-controls="urlbarView-results"
                     aria-autocomplete="both"
                     allowevents="true"
                     inputmode="mozAwesomebar"
                     xbl:inherits="value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,focused,textoverflow"/>
       </xul:moz-input-box>
       <xul:image anonid="urlbar-go-button"
--- a/browser/components/urlbar/UrlbarView.jsm
+++ b/browser/components/urlbar/UrlbarView.jsm
@@ -40,16 +40,17 @@ class UrlbarView {
     this._rows.addEventListener("mousedown", this);
 
     // For the horizontal fade-out effect, set the overflow attribute on result
     // rows when they overflow.
     this._rows.addEventListener("overflow", this);
     this._rows.addEventListener("underflow", this);
 
     this.panel.addEventListener("popupshowing", this);
+    this.panel.addEventListener("popupshown", this);
     this.panel.addEventListener("popuphiding", this);
 
     this.controller.setView(this);
     this.controller.addQueryListener(this);
   }
 
   get oneOffSearchButtons() {
     if (!this._oneOffSearchButtons) {
@@ -652,19 +653,24 @@ class UrlbarView {
       event.target.toggleAttribute("overflow", false);
     }
   }
 
   _on_popupshowing() {
     this.window.addEventListener("resize", this);
   }
 
+  _on_popupshown() {
+    this.input.inputField.setAttribute("aria-expanded", "true");
+  }
+
   _on_popuphiding() {
     this.controller.cancelQuery();
     this.window.removeEventListener("resize", this);
+    this.input.inputField.setAttribute("aria-expanded", "false");
     this.input.inputField.removeAttribute("aria-activedescendant");
   }
 
   _on_resize() {
     // Close the popup as it would be wrongly sized. This can
     // happen when using special OS resize functions like Win+Arrow.
     this.close();
   }