Bug 884648 - no object attributes for aria-atomic='false', r=tbsaunde

This commit is contained in:
Alexander Surkov 2013-06-25 18:11:39 -04:00
parent e40687f872
commit fc8f49b4f1
4 changed files with 19 additions and 8 deletions

View File

@ -685,7 +685,7 @@ struct AttrCharacteristics
static const AttrCharacteristics gWAIUnivAttrMap[] = {
{&nsGkAtoms::aria_activedescendant, ATTR_BYPASSOBJ },
{&nsGkAtoms::aria_atomic, ATTR_VALTOKEN | ATTR_GLOBAL },
{&nsGkAtoms::aria_atomic, ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
{&nsGkAtoms::aria_busy, ATTR_VALTOKEN | ATTR_GLOBAL },
{&nsGkAtoms::aria_checked, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, /* exposes checkable obj attr */
{&nsGkAtoms::aria_controls, ATTR_BYPASSOBJ | ATTR_GLOBAL },

View File

@ -130,7 +130,7 @@ nsAccUtils::SetLiveContainerAttributes(nsIPersistentProperties *aAttributes,
nsIContent *aStartContent,
nsIContent *aTopContent)
{
nsAutoString atomic, live, relevant, busy;
nsAutoString live, relevant, busy;
nsIContent *ancestor = aStartContent;
while (ancestor) {
@ -159,10 +159,11 @@ nsAccUtils::SetLiveContainerAttributes(nsIPersistentProperties *aAttributes,
}
// container-atomic attribute
if (atomic.IsEmpty() &&
HasDefinedARIAToken(ancestor, nsGkAtoms::aria_atomic) &&
ancestor->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_atomic, atomic))
SetAccAttr(aAttributes, nsGkAtoms::containerAtomic, atomic);
if (ancestor->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_atomic,
nsGkAtoms::_true, eCaseMatters)) {
SetAccAttr(aAttributes, nsGkAtoms::containerAtomic,
NS_LITERAL_STRING("true"));
}
// container-busy attribute
if (busy.IsEmpty() &&

View File

@ -22,7 +22,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
function doTest()
{
// aria
testAttrs("atomic", {"atomic" : "true"}, true);
testAttrs("atomic", {"atomic" : "true", "container-atomic" : "true"}, true);
testAttrs(getNode("atomic").firstChild, {"container-atomic" : "true"}, true);
testAbsentAttrs("atomic_false", {"atomic" : "false", "container-atomic" : "false"});
testAbsentAttrs(getNode("atomic_false").firstChild, {"container-atomic" : "false"});
testAttrs("autocomplete", {"autocomplete" : "true"}, true);
testAttrs("checkbox", {"checkable" : "true"}, true);
testAttrs("checkedCheckbox", {"checkable" : "true"}, true);
@ -174,7 +178,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
</pre>
<!-- aria -->
<div id="atomic" aria-atomic="true"></div>
<div id="atomic" aria-atomic="true">live region</div>
<div id="atomic_false" aria-atomic="false">live region</div>
<div id="autocomplete" role="textbox" aria-autocomplete="true"></div>
<div id="checkbox" role="checkbox"></div>
<div id="checkedCheckbox" role="checkbox" aria-checked="true"></div>

View File

@ -117,6 +117,9 @@
testRelation("listitem1", RELATION_NODE_PARENT_OF,
[ "listitem1.1", "listitem1.2" ]);
// aria-atomic
testRelation(getNode("atomic").firstChild, RELATION_MEMBER_OF, "atomic");
// aria-controls
getAccessible("tab");
todo(false,
@ -317,6 +320,8 @@
<input type="button" id="button" aria-controls="lr1 lr2"
onclick="getNode('lr1').textContent += '1'; getNode('lr2').textContent += 'a';"/>
<div id="atomic" aria-atomic="true">live region</div>
<span id="flowto" aria-flowto="flowfrom">flow to</span>
<span id="flowfrom">flow from</span>