Bug 1524564 - Set aria-activedescendant on the input rather than the view so the input delegates a11y focus. r=Standard8
authorDão Gottwald <dao@mozilla.com>
Tue, 12 Mar 2019 15:23:58 +0000
changeset 521547 4619f517e391
parent 521546 f115573cf9a8
child 521548 f78cbd4bc030
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1524564
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 1524564 - Set aria-activedescendant on the input rather than the view so the input delegates a11y focus. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D23109
browser/components/urlbar/UrlbarView.jsm
--- a/browser/components/urlbar/UrlbarView.jsm
+++ b/browser/components/urlbar/UrlbarView.jsm
@@ -496,19 +496,19 @@ class UrlbarView {
     if (this._selected) {
       this._selected.toggleAttribute("selected", false);
       this._selected.toggleAttribute("aria-selected", false);
     }
     this._selected = item;
     if (item) {
       item.toggleAttribute("selected", true);
       item.toggleAttribute("aria-selected", true);
-      this._rows.setAttribute("aria-activedescendant", item.id);
+      this.input.inputField.setAttribute("aria-activedescendant", item.id);
     } else {
-      this._rows.removeAttribute("aria-activedescendant");
+      this.input.inputField.removeAttribute("aria-activedescendant");
     }
 
     if (updateInput) {
       let result = null;
       if (item) {
         let resultIndex = item.getAttribute("resultIndex");
         result = this._queryContext.results[resultIndex];
       }
@@ -655,16 +655,17 @@ class UrlbarView {
 
   _on_popupshowing() {
     this.window.addEventListener("resize", this);
   }
 
   _on_popuphiding() {
     this.controller.cancelQuery();
     this.window.removeEventListener("resize", this);
+    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();
   }
 }