Bug 610650 - Change implementation of HTML5 landmark elements to conform to implementor guidelines; r=marcoz

This commit is contained in:
David Bolter 2011-07-05 10:28:53 -04:00
parent e7bf31636d
commit e4876f1b7c
2 changed files with 10 additions and 7 deletions

View File

@ -1255,19 +1255,18 @@ nsHyperTextAccessible::GetAttributesInternal(nsIPersistentProperties *aAttribute
}
// For the html landmark elements we expose them like we do aria landmarks to
// make AT navigation schemes "just work".
// make AT navigation schemes "just work". Note html:header is redundant as
// a landmark since it usually contains headings. We're not yet sure how the
// web will use html:footer but our best bet right now is as contentinfo.
if (mContent->Tag() == nsAccessibilityAtoms::nav)
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::xmlroles,
NS_LITERAL_STRING("navigation"));
else if (mContent->Tag() == nsAccessibilityAtoms::header)
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::xmlroles,
NS_LITERAL_STRING("banner"));
else if (mContent->Tag() == nsAccessibilityAtoms::footer)
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::xmlroles,
NS_LITERAL_STRING("contentinfo"));
else if (mContent->Tag() == nsAccessibilityAtoms::aside)
nsAccUtils::SetAccAttr(aAttributes, nsAccessibilityAtoms::xmlroles,
NS_LITERAL_STRING("note"));
NS_LITERAL_STRING("complementary"));
return NS_OK;
}

View File

@ -31,9 +31,8 @@
// Some AT may look for this
testAttrs("nav", {"xml-roles" : "navigation"}, true);
testAttrs("header", {"xml-roles" : "banner"}, true);
testAttrs("footer", {"xml-roles" : "contentinfo"}, true);
testAttrs("aside", {"xml-roles" : "note"}, true);
testAttrs("aside", {"xml-roles" : "complementary"}, true);
testAttrs("main", {"xml-roles" : "main"}, true); // ARIA override
// And some AT may look for this
@ -63,6 +62,11 @@
title="Map <article> like we do aria role article">
Mozilla Bug 613502
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=610650"
title="Change implementation of HTML5 landmark elements to conform">
Mozilla Bug 610650
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">