diff --git a/accessible/html/HTMLElementAccessibles.cpp b/accessible/html/HTMLElementAccessibles.cpp
index b01c880a90ea..6083636cd8b5 100644
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -165,11 +165,11 @@ role HTMLHeaderOrFooterAccessible::NativeRole() const {
// If other sectioning or sectioning root elements, they become sections.
nsIContent* parent = mContent->GetParent();
while (parent) {
- if (parent->IsAnyOfHTMLElements(nsGkAtoms::article, nsGkAtoms::aside,
- nsGkAtoms::nav, nsGkAtoms::section,
- nsGkAtoms::blockquote, nsGkAtoms::details,
- nsGkAtoms::dialog, nsGkAtoms::fieldset,
- nsGkAtoms::figure, nsGkAtoms::td)) {
+ if (parent->IsAnyOfHTMLElements(
+ nsGkAtoms::article, nsGkAtoms::aside, nsGkAtoms::nav,
+ nsGkAtoms::section, nsGkAtoms::main, nsGkAtoms::blockquote,
+ nsGkAtoms::details, nsGkAtoms::dialog, nsGkAtoms::fieldset,
+ nsGkAtoms::figure, nsGkAtoms::td)) {
break;
}
parent = parent->GetParent();
diff --git a/accessible/tests/mochitest/attributes/test_xml-roles.html b/accessible/tests/mochitest/attributes/test_xml-roles.html
index 29e3e7ce6685..77c0c18d6b11 100644
--- a/accessible/tests/mochitest/attributes/test_xml-roles.html
+++ b/accessible/tests/mochitest/attributes/test_xml-roles.html
@@ -21,9 +21,11 @@
testAttrs("nav", {"xml-roles": "navigation"}, true);
testAttrs("header", {"xml-roles": "banner"}, true);
testAbsentAttrs("article_header", {"xml-roles": "banner"});
+ testAbsentAttrs("main_header", {"xml-roles": "banner"});
testAbsentAttrs("section_header", {"xml-roles": "banner"});
testAttrs("footer", {"xml-roles": "contentinfo"}, true);
testAbsentAttrs("article_footer", {"xml-roles": "contentinfo"});
+ testAbsentAttrs("main_footer", {"xml-roles": "contentinfo"});
testAbsentAttrs("section_footer", {"xml-roles": "contentinfo"});
testAttrs("aside", {"xml-roles": "complementary"}, true);
testAbsentAttrs("section", {"xml-roles": "region"}, true);
@@ -157,6 +159,10 @@
a header within an article
+
+
+
+