Bug 1418102 - role heading need to have a name computed from its subtree, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Mon, 20 Nov 2017 10:02:52 -0500
changeset 437203 dbff505c9c0543b570f4142ff5664cacb625d0b1
parent 437202 4137a8047398bfafe18d49b772c56e506cc8a5b4
child 437204 b8fde5e050033b10fac9ea4db2ef3cffb1abf6ed
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersmarcoz
bugs1418102
milestone59.0a1
Bug 1418102 - role heading need to have a name computed from its subtree, r=marcoz
accessible/base/RoleMap.h
accessible/tests/mochitest/name/test_general.html
--- a/accessible/base/RoleMap.h
+++ b/accessible/base/RoleMap.h
@@ -858,17 +858,17 @@ ROLE(DOCUMENT_FRAME,
      eNoNameRule)
 
 ROLE(HEADING,
      "heading",
      ATK_ROLE_HEADING,
      @"AXHeading",
      USE_ROLE_STRING,
      IA2_ROLE_HEADING,
-     eNameFromSubtreeIfReqRule)
+     eNameFromSubtreeRule)
 
 ROLE(PAGE,
      "page",
      ATK_ROLE_PAGE,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_PAGE,
      eNoNameRule)
--- a/accessible/tests/mochitest/name/test_general.html
+++ b/accessible/tests/mochitest/name/test_general.html
@@ -143,16 +143,19 @@
       testName("tablemenuitem", "menuitem 1");
 
       // Get the name from child acronym title attribute rather than from
       // acronym content.
       testName("label_with_acronym", "O A T F World Wide Web");
 
       testName("testArticle", "Test article");
 
+      testName("h1", "heading");
+      testName("aria_heading", "aria_heading");
+
       // ////////////////////////////////////////////////////////////////////////
       // title attribute
 
       // If nothing is left. Let's try title attribute.
       testName("btn_title", "title");
 
       // ////////////////////////////////////////////////////////////////////////
       // textarea name
@@ -483,16 +486,19 @@
     <acronym title="O A T F">OATF</acronym>
     <abbr title="World Wide Web">WWW</abbr>
   </label>
 
   <div id="testArticle" role="article" title="Test article">
     <p>This is a paragraph inside the article.</p>
   </div>
 
+  <h1 id="h1" title="oops">heading</h1>
+  <div role="heading" id="aria_heading">aria_heading</div>
+
   <!-- name from title attribute -->
   <span id="btn_title" role="group" title="title">15</span>
 
   <!-- A textarea nested in a label with a text child (bug #453371). -->
   <form>
     <label>Story
       <textarea id="textareawithchild" name="name">Foo</textarea>
       is ended.