Skip to content

Commit

Permalink
Bug 1484248 - Accessible name calculation from label content should i…
Browse files Browse the repository at this point in the history
…nclude cells. r=surkov

Change the name calculation rule of HTML 'table' element from eNoNameRule
to eNameFromSubtreeIfReqRule. That way the table won't get an accessible
name, but will be descended when building a name from a parent element's
contents.

--HG--
extra : rebase_source : 218aec9f90b0c420a5f6785e929e5512b6704567
  • Loading branch information
joanmarie committed Aug 17, 2018
1 parent df1c9fe commit 7471d49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion accessible/base/RoleMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ ROLE(TABLE,
ROLE_SYSTEM_TABLE,
ROLE_SYSTEM_TABLE,
"android.widget.GridView",
eNoNameRule)
eNameFromSubtreeIfReqRule)

ROLE(COLUMNHEADER,
"columnheader",
Expand Down
14 changes: 14 additions & 0 deletions accessible/tests/mochitest/name/test_ARIACore_examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
// more own inner text, separated by 1 space.
testName("chkbx", "Flash the screen 5 times");

// Example 4 from section 4.3.1 under 2.F.
// Name from content should include all the child nodes, including
// table cells.
testName("input_with_html_label", "foo bar baz");

SimpleTest.finish();
}

Expand Down Expand Up @@ -73,5 +78,14 @@
<!-- Label from combined text and subtree -->
<div id="chkbx" role="checkbox" aria-checked="false">Flash the screen
<span role="textbox" aria-multiline="false"> 5 </span> times</div>

<!-- Label with name from content should include table -->
<input id="input_with_html_label" />
<label for="input_with_html_label" id="label">
<div>foo</div>
<table><tr><td>bar</td></tr></table>
<div>baz</div>
</label>

</body>
</html>

0 comments on commit 7471d49

Please sign in to comment.