Bug 532338 - Inappropriate IAccessible2 role for DL and DT tags. r=MarcoZ,surkov

This commit is contained in:
David Bolter 2010-01-11 13:55:52 -05:00
Родитель 0ccee0c61c
Коммит bc0724e79d
2 изменённых файлов: 18 добавлений и 6 удалений

Просмотреть файл

@ -555,7 +555,8 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame *aFrame,
else if (tag == nsAccessibilityAtoms::optgroup) {
*aAccessible = new nsHTMLSelectOptGroupAccessible(aNode, aWeakShell);
}
else if (tag == nsAccessibilityAtoms::ul || tag == nsAccessibilityAtoms::ol) {
else if (tag == nsAccessibilityAtoms::ul || tag == nsAccessibilityAtoms::ol ||
tag == nsAccessibilityAtoms::dl) {
*aAccessible = new nsHTMLListAccessible(aNode, aWeakShell);
}
else if (tag == nsAccessibilityAtoms::a) {
@ -570,17 +571,18 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame *aFrame,
*aAccessible = new nsHTMLLinkAccessible(aNode, aWeakShell);
}
else if (tag == nsAccessibilityAtoms::li && aFrame->GetType() != nsAccessibilityAtoms::blockFrame) {
// Normally this is created by the list item frame which knows about the bullet frame
// However, in this case the list item must have been styled using display: foo
else if (tag == nsAccessibilityAtoms::dt ||
(tag == nsAccessibilityAtoms::li &&
aFrame->GetType() != nsAccessibilityAtoms::blockFrame)) {
// Normally for li, it is created by the list item frame (in nsBlockFrame)
// which knows about the bullet frame; however, in this case the list item
// must have been styled using display: foo
*aAccessible = new nsHTMLLIAccessible(aNode, aWeakShell, EmptyString());
}
else if (tag == nsAccessibilityAtoms::abbr ||
tag == nsAccessibilityAtoms::acronym ||
tag == nsAccessibilityAtoms::blockquote ||
tag == nsAccessibilityAtoms::dd ||
tag == nsAccessibilityAtoms::dl ||
tag == nsAccessibilityAtoms::dt ||
tag == nsAccessibilityAtoms::form ||
tag == nsAccessibilityAtoms::h1 ||
tag == nsAccessibilityAtoms::h2 ||

Просмотреть файл

@ -46,6 +46,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=472326
// get broken.
testRole("p", ROLE_PARAGRAPH);
// Test dl, dt, dd
testRole("definitionlist", ROLE_LIST);
testRole("definitionterm", ROLE_LISTITEM);
testRole("definitiondescription", ROLE_PARAGRAPH);
SimpleTest.finish();
}
@ -79,5 +84,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=472326
<h4 id="head4">A heading level 4</h4>
<h5 id="head5">A heading level 5</h5>
<h6 id="head6">A heading level 6</h6>
<dl id="definitionlist">
<dt id="definitionterm">gecko</dt>
<dd id="definitiondescription">geckos have sticky toes</dd>
</dl>
</body>
</html>