Closed Bug 1849160 Opened 2 years ago Closed 1 year ago

ARIA role should not be set outside the expected context for gridcell, rowheader and columnheader (WPT wai-aria/role/grid-roles.html orphaned)

Categories

(Core :: Disability Access APIs, enhancement)

Firefox 118
enhancement

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: howard-e, Assigned: nlapre)

References

(Blocks 3 open bugs)

Details

Attachments

(4 files)

Steps to reproduce:

Checked failures found in new WPT tests: https://wpt.fyi/results/wai-aria/role/grid-roles.html?label=experimental&label=master&aligned for:

  • orphaned gridcell outside the context of row
  • orphaned rowheader outside the context of row
  • orphaned columnheader outside the context of row

Actual results:

Got the fail messages for the following markup:

<div role="gridcell" data-testname="orphaned gridcell outside the context of row" data-expectedrole="none" class="ex">x</div>
FAIL message: assert_equals: <div role="gridcell" data-testname="orphaned gridcell outside the context of row" data-expectedrole="none" class="ex">x</div> expected "none" but got "gridcell"

<div role="rowheader" data-testname="orphaned rowheader outside the context of row" data-expectedrole="none" class="ex">x</div>
FAIL message: assert_equals: <div role="rowheader" data-testname="orphaned rowheader outside the context of row" data-expectedrole="none" class="ex">x</div> expected "none" but got "rowheader"

<div role="columnheader" data-testname="orphaned columnheader outside the context of row" data-expectedrole="none" class="ex">x</div>
FAIL message: assert_equals: <div role="columnheader" data-testname="orphaned columnheader outside the context of row" data-expectedrole="none" class="ex">x</div> expected "none" but got "columnheader"

Expected results:

These should have all passed

The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Disability Access APIs

I wonder whether the expected role should be generic instead of none, but I think I saw that the harness will soon allow either for none anyway, so this might not really matter.

Blocks: a11y-wpt, aria
Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: ARIA role should not be set outside the expected context for gridcell, rowheader and columnheader → ARIA role should not be set outside the expected context for gridcell, rowheader and columnheader (WPT wai-aria/role/grid-roles.html orphaned)

We have the same problem for listbox/option, menu/menuitem* and tree/treeitem. Whatever solution we come up with here should be extendable to all three.

Comment 4 also applies to tab as well.

This revision changes the behavior of the Role function such that, for child
roles (in parent/child role relationships), the parent role must be present as
an ancestor for the child to have its assigned role. For instance, a "row" node
must have a table in its ancestry tree. To implement this, we walk parents. This
revision also fixes up and removes expected failures for around 18 web platform
tests.

NOTE: This revision is a work in progress. We may not need the changes, based on
the decisions of the ARIA spec maintainers / WPT maintainers.

I wrote this issue to the powers that be. It looks like the resolution is to remove the tests. There's also this ARIA issue which might clarify further. At the moment, however, I suspect this issue will end up WONTFIX and the attached patch will be abandoned.

It looks like these tests are actually valid, though there's some confusing spec disagreement. See this section of the CORE-AAM spec.

It says:

When an element has a role but is not contained in the required context (for example, an orphaned listitem without the required accessible parent of role list), User Agents MUST ignore the role token, and return the computedrole as if the ignored role token had not been included.

This stands in contrast to the language of the ARIA spec ("authors MUST" / "user agents are not responsible"), so I think we still need some spec clarification. However, it's not cut-and-dry that this issue is a WONTFIX. I think I'm going to revive the patch and clean it up.

This revision implements the ARIA rowgroup role in Gecko. Previously, Gecko was
using roles::GROUPING for multiple types of groups and disambiguating them
in various places. This revision unwinds that while maintaining present
functionality.

Assignee: nobody → nlapre
Status: NEW → ASSIGNED

This revision adds a utility function to find the nearest non-generic ancestor
for which a given predicate returns true.

Attachment #9382205 - Attachment description: WIP: Bug 1849160: Orphaned child accessibles fall back to native role, r?Jamie → Bug 1849160 - Part 3: Orphaned child accessibles fall back to native role, r?Jamie

This revision updates newly-failing tests after implementing the ancestor
requirements for certain child roles. Generally, this revision adds ancestors
where appropriate, because tests largely are not testing this particular
behavior.

Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9a745f454db2 Part 1: Implement rowgroup role, r=Jamie https://hg.mozilla.org/integration/autoland/rev/8f14ad3ed8b4 Part 2: Add Accessible::FindAncestorIf, r=Jamie https://hg.mozilla.org/integration/autoland/rev/fe5651e406e5 Part 3: Orphaned child accessibles fall back to native role, r=Jamie https://hg.mozilla.org/integration/autoland/rev/0fb937f8c362 Part 4: Update tests in light of new ancestor role requirements, r=Jamie,devtools-reviewers,nchevobbe

Backed out for causing gv-junit failure on AccessibilityTest#testSelectable

Backout link

Push with failures

Failure log

Flags: needinfo?(nlapre)
Pushed by nlapre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eb17aa9cc1cb Part 1: Implement rowgroup role, r=Jamie https://hg.mozilla.org/integration/autoland/rev/c8e9ae699981 Part 2: Add Accessible::FindAncestorIf, r=Jamie https://hg.mozilla.org/integration/autoland/rev/24a03f6f59b7 Part 3: Orphaned child accessibles fall back to native role, r=Jamie https://hg.mozilla.org/integration/autoland/rev/7815569d22d9 Part 4: Update tests in light of new ancestor role requirements, r=Jamie,devtools-reviewers,nchevobbe,geckoview-reviewers,ohall
Flags: needinfo?(nlapre)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: