Element with ARIA role and display: contents doesn't get an accessible

NEW
Unassigned

Status

()

P3
normal
2 months ago
24 days ago

People

(Reporter: Jamie, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 months ago
STR:
1. Open this test case:
data:text/html,<div role="list" style="display: contents;"><div role="listitem">foo</div></div>
2. Use the Accessibility Inspector to examine the tree.
Expected: document -> list -> list item
Actual: document -> list item

If a display: contents element has an ARIA role, we should create an accessible for it, just like we do for MarkupMap.
(Reporter)

Updated

2 months ago
See Also: → bug 1455357
(Reporter)

Updated

25 days ago
See Also: → bug 1500958
(Reporter)

Comment 1

24 days ago
Notes about fixing this:
in nsAccessibilityService::CreateAccessible, at around line 1073, we have this block:

    if (content->IsElement() && content->AsElement()->IsDisplayContents()) {

Within that block, we create accessibles for display: contents, but *only* if there is an entry in the MarkupMap. We must also create an accessible if there are ARIA attributes. I think we can use MustBeAccessible() for this, but it needs to be tweaked so it doesn't assume a frame.

For most cases, we just want a HyperTextAccessible. However, ARIA grids are a notable exception. There is a block of code around line 1195 which deals with this, starting with this code:

    if (isARIATablePart && (!newAcc || newAcc->IsGenericHyperText())) {

We'll need to split that out (probably into a function) and use it in both places.
You need to log in before you can comment on or make changes to this bug.