Closed Bug 1494196 Opened 6 years ago Closed 1 year ago

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

Categories

(Core :: Disability Access APIs, defect, P3)

defect

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: Jamie, Assigned: nlapre)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Keywords: papercut)

Attachments

(1 file)

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.
See Also: → 1455357
See Also: → 1500958
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.
Keywords: papercut
See Also: → 1793073
Severity: normal → S3

This revision modifies the logic in CreateAccessible such that we create
Accessibles for elements that have ARIA roles (other than presentation, none) or
other ARIA attributes, even if those elements have the display: contents style.
This revision also adds tests to verify the above.

Assignee: nobody → nlapre
Status: NEW → ASSIGNED
Pushed by nlapre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d59b76766f0d
Create Accessible for elements with ARIA role, attributes and display: contents, r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Regressions: 1882145
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: