Bug 1357100 - change implicit val for aria-level on a heading to 2 r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D35616

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gautham Velchuru 2019-08-23 01:28:13 +00:00
Родитель d0797846a4
Коммит 0b2b2ab7b2
2 изменённых файлов: 12 добавлений и 2 удалений

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

@ -1168,7 +1168,14 @@ GroupPos Accessible::GroupPosition() {
// Calculate group level if ARIA is missed.
if (groupPos.level == 0) {
int32_t level = GetLevelInternal();
if (level != 0) groupPos.level = level;
if (level != 0) {
groupPos.level = level;
} else {
const nsRoleMapEntry* role = this->ARIARoleMap();
if (role && role->Is(nsGkAtoms::heading)) {
groupPos.level = 2;
}
}
}
// Calculate position in group and group size if ARIA is missed.
@ -1940,7 +1947,8 @@ void Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
void Accessible::Shutdown() {
// Mark the accessible as defunct, invalidate the child count and pointers to
// other accessibles, also make sure none of its children point to this parent
// other accessibles, also make sure none of its children point to this
// parent
mStateFlags |= eIsDefunct;
int32_t childCount = mChildren.Length();

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

@ -211,6 +211,7 @@
testGroupAttrs("h4", 0, 0, 4);
testGroupAttrs("h5", 0, 0, 5);
testGroupAttrs("h6", 0, 0, 6);
testGroupAttrs("ariaHeadingNoLevel", 0, 0, 2);
// No child item counts or "hierarchical" flag for parent of headings
testAbsentAttrs("headings", {"child-item-count": "", "hierarchical": ""});
@ -487,6 +488,7 @@
<h4 id="h4">heading4</h4>
<h5 id="h5">heading5</h5>
<h6 id="h6">heading6</h6>
<div id="ariaHeadingNoLevel" role="heading">ariaHeadingNoLevel</div>
</div>
<ul id="combo1" role="combobox">Password