Bug 1409084: Map inputs with a list attribute to role EDITCOMBOBOX. r=eeejay
authorJames Teh <jteh@mozilla.com>
Wed, 20 May 2020 23:58:22 +0000
changeset 531358 46aa9dd6e711d83fd222cdf9d67260b2bdc84db0
parent 531357 23ddff9da376923836d2e66e9aa71191a065ca7c
child 531359 fd7802694d8f5255871f0da15e8057530ed36e41
push id37438
push userabutkovits@mozilla.com
push dateThu, 21 May 2020 09:36:57 +0000
treeherdermozilla-central@2d00a1a6495c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1409084
milestone78.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 1409084: Map inputs with a list attribute to role EDITCOMBOBOX. r=eeejay Previously, we mapped these to ENTRY. This is incorrect according to the HTML AAM spec and causes problems for JAWS. Differential Revision: https://phabricator.services.mozilla.com/D76066
accessible/html/HTMLFormControlAccessible.cpp
accessible/tests/mochitest/tree/test_txtctrl.html
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -201,17 +201,20 @@ HTMLTextFieldAccessible::HTMLTextFieldAc
               ? eHTMLTextPasswordFieldType
               : eHTMLTextFieldType;
 }
 
 role HTMLTextFieldAccessible::NativeRole() const {
   if (mType == eHTMLTextPasswordFieldType) {
     return roles::PASSWORD_TEXT;
   }
-
+  if (mContent->AsElement()->HasAttr(kNameSpaceID_None,
+                                            nsGkAtoms::list_)) {
+    return roles::EDITCOMBOBOX;
+  }
   return roles::ENTRY;
 }
 
 already_AddRefed<nsIPersistentProperties>
 HTMLTextFieldAccessible::NativeAttributes() {
   nsCOMPtr<nsIPersistentProperties> attributes =
       HyperTextAccessibleWrap::NativeAttributes();
 
--- a/accessible/tests/mochitest/tree/test_txtctrl.html
+++ b/accessible/tests/mochitest/tree/test_txtctrl.html
@@ -82,30 +82,30 @@
           },
         ],
       };
 
       testAccessibleTree("txc6", accTree);
 
       // input@type="email", value
       accTree = {
-        role: ROLE_ENTRY,
+        role: ROLE_EDITCOMBOBOX, // Because of list attribute
         children: [
           { // text child
             role: ROLE_TEXT_LEAF,
             children: [],
           },
         ],
       };
 
       testAccessibleTree("txc7", accTree);
 
       // input@type="search", value
       accTree = {
-        role: ROLE_ENTRY,
+        role: ROLE_EDITCOMBOBOX, // Because of list attribute
         children: [
           { // text child
             role: ROLE_TEXT_LEAF,
             children: [],
           },
         ],
       };