Bug 1501595 - Return the correct region-specific role for named html:section elements, r=Jamie
authorMarco Zehe <mzehe@mozilla.com>
Thu, 25 Oct 2018 01:41:15 +0000
changeset 491273 00f3952a69f00c6a8dabab451a301e6a13e3760e
parent 491272 81d7102f5351cf4aa3c5b348b5820f3e499a4d60
child 491274 cb7bc3337f392abcfe442330d4b7350134150864
child 491299 ca744888101ed29447b95c6fa30ae1ff8d207e51
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersJamie
bugs1501595, 1210630
milestone65.0a1
Bug 1501595 - Return the correct region-specific role for named html:section elements, r=Jamie Bug 1210630 introduced a mapping of the html:section element to roles::LANDMARK, however roles::REGION is more appropriate since that is also used by the WAI-ARIA role mapping and contains specific mappings for regions, e. g. on Mac. Differential Revision: https://phabricator.services.mozilla.com/D9651
accessible/html/HTMLElementAccessibles.cpp
accessible/tests/mochitest/elm/test_HTMLSpec.html
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -254,17 +254,17 @@ HTMLHeaderOrFooterAccessible::LandmarkRo
 // HTMLSectionAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 role
 HTMLSectionAccessible::NativeRole() const
 {
   nsAutoString name;
   const_cast<HTMLSectionAccessible*>(this)->Name(name);
-  return name.IsEmpty() ? roles::SECTION : roles::LANDMARK;
+  return name.IsEmpty() ? roles::SECTION : roles::REGION;
 }
 
 nsAtom*
 HTMLSectionAccessible::LandmarkRole() const
 {
   if (!HasOwnContent()) {
     return nullptr;
   }
--- a/accessible/tests/mochitest/elm/test_HTMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html
@@ -1212,17 +1212,17 @@
         absentAttributes: { "xml-roles": "region" },
         interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
       };
       testElm("section", obj);
 
       // HTML:section with an accessible name
 
       obj = {
-        role: ROLE_LANDMARK,
+        role: ROLE_REGION,
         attributes: { "xml-roles": "region" },
         interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
       };
       testElm("named_section", obj);
 
       // ////////////////////////////////////////////////////////////////////////
       // HTML:small contained by paragraph