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 4619f517e391d5bfa81d27936a2d0c080e8a90bc
parent 521546 f115573cf9a82f025084210a0379a0fc84e2436a
child 521548 f78cbd4bc0307b5fd000195194022613f9d22fc1
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();
   }
 }