Bug 996821 - Force semantic HTML elements to have accessible objects. r=surkov

This commit is contained in:
Eitan Isaacson 2014-04-16 18:27:00 -07:00
parent 4202502257
commit 91c61ee285
2 changed files with 29 additions and 1 deletions

View File

@ -1436,15 +1436,21 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
if (tag == nsGkAtoms::abbr ||
tag == nsGkAtoms::acronym ||
tag == nsGkAtoms::article ||
tag == nsGkAtoms::aside ||
tag == nsGkAtoms::blockquote ||
tag == nsGkAtoms::form ||
tag == nsGkAtoms::footer ||
tag == nsGkAtoms::header ||
tag == nsGkAtoms::h1 ||
tag == nsGkAtoms::h2 ||
tag == nsGkAtoms::h3 ||
tag == nsGkAtoms::h4 ||
tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::q) {
tag == nsGkAtoms::nav ||
tag == nsGkAtoms::q ||
tag == nsGkAtoms::section) {
nsRefPtr<Accessible> accessible =
new HyperTextAccessibleWrap(aContent, document);
return accessible.forget();

View File

@ -29,6 +29,15 @@
testRole("aside", ROLE_NOTE);
testRole("section", ROLE_SECTION);
// Bug 996821
// Check that landmark elements get accessibles with styled overflow.
testRole("section_overflow", ROLE_SECTION);
testRole("nav_overflow", ROLE_SECTION);
testRole("header_overflow", ROLE_HEADER);
testRole("aside_overflow", ROLE_NOTE);
testRole("footer_overflow", ROLE_FOOTER);
testRole("article_overflow", ROLE_FOOTER);
// test html:div
testRole("sec", ROLE_SECTION);
@ -127,6 +136,19 @@
<aside id="aside">by the way I am an aside</aside>
<section id="section">a section</section>
<section style="overflow: hidden;" id="section_overflow">
<nav style="overflow: hidden;"
id="nav_overflow">overflow nav</nav>
<header style="overflow: hidden;"
id="header_overflow">overflow header</header>
<aside style="overflow: hidden;"
id="aside_overflow">overflow aside</aside>
<footer style="overflow: hidden;"
id="footer_overflow">overflow footer</footer>
</section>
<article style="overflow: hidden;"
id="article_overflow">overflow article</article>
<p id="p">A paragraph for comparison.</p>
<div id="sec">A normal div</div>
<blockquote id="quote">A citation</blockquote>