mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1013584 - presentation list items should expose generic accessibles, r=davidb
This commit is contained in:
parent
03b91def37
commit
91d762ecff
@ -1555,6 +1555,9 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
|
||||
if (aContext->IsList() &&
|
||||
aContext->GetContent() == aContent->GetParent()) {
|
||||
newAcc = new HTMLLIAccessible(aContent, document);
|
||||
} else {
|
||||
// Otherwise create a generic text accessible to avoid text jamming.
|
||||
newAcc = new HyperTextAccessibleWrap(aContent, document);
|
||||
}
|
||||
break;
|
||||
case eHTMLSelectListType:
|
||||
|
@ -34,10 +34,15 @@
|
||||
accTree = { // div@role="list"
|
||||
role: ROLE_LIST,
|
||||
children: [
|
||||
{ // li text leaf
|
||||
role: ROLE_TEXT_LEAF,
|
||||
name: "item1",
|
||||
children: [ ]
|
||||
{ // li
|
||||
role: ROLE_PARAGRAPH,
|
||||
children: [
|
||||
{ // li text leaf
|
||||
role: ROLE_TEXT_LEAF,
|
||||
name: "item1",
|
||||
children: [ ]
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // li@role="listitem"
|
||||
role: ROLE_LISTITEM,
|
||||
|
@ -56,6 +56,15 @@
|
||||
] };
|
||||
testAccessibleTree("tblfocusable_cnt", tree);
|
||||
|
||||
// Presentation list, expose generic accesisble for list items.
|
||||
tree =
|
||||
{ SECTION: [ // container
|
||||
{ PARAGRAPH: [ // li generic accessible
|
||||
{ TEXT_LEAF: [ ] } // li text
|
||||
] }
|
||||
] };
|
||||
testAccessibleTree("list_cnt", tree);
|
||||
|
||||
// Has ARIA globals or referred by ARIA relationship.
|
||||
tree =
|
||||
{ SECTION: [ // container
|
||||
@ -113,6 +122,12 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="list_cnt">
|
||||
<ul role="presentation">
|
||||
<li>item</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="airaglobalprop_cnt">
|
||||
<label role="presentation" aria-owns="ariaowned">has aria-owns</label>
|
||||
<label role="presentation" id="ariaowned">referred by aria-owns</label>
|
||||
|
@ -80,15 +80,15 @@
|
||||
|
||||
ok(!isAccessible("presentation_ul"),
|
||||
"presentational ul shouldn't be accessible");
|
||||
ok(!isAccessible("item_in_presentation_ul"),
|
||||
"li in presentational ul shouldn't be accessible");
|
||||
ok(!isAccessible("styleditem_in_presentation_ul"),
|
||||
"list styled span in presentational ul shouldn't be accessible");
|
||||
ok(isAccessible("item_in_presentation_ul"),
|
||||
"li in presentational ul should have generic accessible");
|
||||
ok(isAccessible("styleditem_in_presentation_ul"),
|
||||
"list styled span in presentational ul should have generic accessible");
|
||||
|
||||
ok(!isAccessible("presentation_ol"),
|
||||
"presentational ol shouldn't be accessible");
|
||||
ok(!isAccessible("item_in_presentation_ol"),
|
||||
"li in presentational ol shouldn't be accessible");
|
||||
ok(isAccessible("item_in_presentation_ol"),
|
||||
"li in presentational ol should have generic accessible");
|
||||
|
||||
ok(!isAccessible("presentation_dl"),
|
||||
"presentational dl shouldn't be accessible");
|
||||
|
Loading…
Reference in New Issue
Block a user