Closed Bug 1987945 Opened 3 months ago Closed 3 months ago

Add automatic details relationship to anchor positioned content

Categories

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

task

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: eeejay, Assigned: eeejay)

References

Details

(Whiteboard: [anchorpositioning:m2])

Attachments

(3 files)

No description provided.

There are three functions that select and determine valid details
relationships.

  1. nsCoreUtils::GetAnchorForPositionedFrame and nsCoreUtils::GetPositionedFrameForAnchor

These query layout and determine that there is only a single target
referencing and anchor and vice versa. We need to do this check in
layout because the a11y tree doesn't give us the full picture. For
example, one of two targets could be aria-hidden and it should make the
relationship with between the anchor and other target invalid.

  1. LocalAccessible::GetAnchorPositionTargetDetailsRelation

This uses the functions above to get the target of an anchor, retrieve
its accessible and check that there are no explicit relationships
defined on the anchor (or details relationship for the target).

  1. nsAccUtils::IsValidDetailsTargetForAnchor

This checks the a11y tree structure to make sure this is a valid
relationship. This is written to run also remotely so we don't need
to recalculate and cache relations on each tree mutation.

Assignee: nobody → eitan
Status: NEW → ASSIGNED

This allows us to calculate relations remotely when more than one
relation source is at play. For example, a details relationship will be
determined in order of priority: aria-details, commandfor, popover.

Knowing the relation source remotely allows further filtering. For
example, a popover relation should not be valid if the target is a
sibling of the button. We should determine that remotely instead of
recalculating and sending a new relation cache on each tree mutation
that might change the relation.

It also allows us to provide something like details-from in the
accessible attribute to let ATs know what the source of the relationship
is and for it to determine presentation.

The one sticking point in this change is that determining reverse
relations is less straightforward and requires us to interrogate each
target candidate to see if the relationship is mutual. This is because
relationship sets can be fully or partially "eclipsed" by a higher
priority source on the potential target.

For example:
<button id="toggle" commandfor="popover" command="toggle-popover" aria-details="details">toggle1</button>
<button id="show" commandfor="popover" command="show-popover">show</button>
<dialog id="popover" popover>popover</dialog>
<div id="details">details</div>

The cached stored reverse relationship for "commandfor" on "popover" is
both "toggle" and "show", but the direct details relationship of "toggle" is "details".
So the calculated DETAILS_FOR of "popover" should just be "show".

The change notification here is a bit stilted.. we need an explicit
notification when removing targets or anchors immediately before reflow
so we can collect associated frames and update the relations on their
associated accessibles.

When anchors/targets are added, we need to wait till after reflow in
order to get the frames that are resolved.

Whiteboard: [anchorpositioning:m2]
Pushed by eisaacson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cd9f4b716c6d https://hg.mozilla.org/integration/autoland/rev/ae4f46dfec58 P1: Implement details relationship for CSS anchored local accessibles. r=Jamie,emilio https://github.com/mozilla-firefox/firefox/commit/77defe6ce4dd https://hg.mozilla.org/integration/autoland/rev/b93b02b24271 P2: Cache relations using multiple attributes for same relation type. r=Jamie https://github.com/mozilla-firefox/firefox/commit/e6ae7218f84f https://hg.mozilla.org/integration/autoland/rev/67f28439cbc7 P3: Support details relation in anchored targets in remote accessibles. r=Jamie,layout-anchor-positioning-reviewers,layout-reviewers,emilio,firefox-style-system-reviewers https://github.com/mozilla-firefox/firefox/commit/0a7b2d917f7f https://hg.mozilla.org/integration/autoland/rev/cab61a7bfe8f apply code formatting via Lando

Bug 1991336 broke the build. Relanding.

Flags: needinfo?(eitan)
Attachment #9512929 - Attachment description: Bug 1987945 - P1: Implement details relationship for CSS anchored local accessibles. r?Jamie,jari → Bug 1987945 - P1: Implement details relationship for CSS anchored local accessibles. r=Jamie,emilio
Attachment #9512930 - Attachment description: Bug 1987945 - P2: Cache relations using multiple attributes for same relation type. r?Jamie → Bug 1987945 - P2: Cache relations using multiple attributes for same relation type. r=Jamie
Attachment #9512931 - Attachment description: Bug 1987945 - P3: Support details relation in anchored targets in remote accessibles. r?Jamie,jari → Bug 1987945 - P3: Support details relation in anchored targets in remote accessibles. r=Jamie,layout-anchor-positioning-reviewers,layout-reviewers,emilio,firefox-style-system-reviewers
Pushed by eisaacson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9cb7f8116308 https://hg.mozilla.org/integration/autoland/rev/4544c8e0eda1 P1: Implement details relationship for CSS anchored local accessibles. r=Jamie,emilio https://github.com/mozilla-firefox/firefox/commit/c67896dd6201 https://hg.mozilla.org/integration/autoland/rev/7aaaa4514127 P2: Cache relations using multiple attributes for same relation type. r=Jamie https://github.com/mozilla-firefox/firefox/commit/e31a35d4ea41 https://hg.mozilla.org/integration/autoland/rev/2ba84268f8ac P3: Support details relation in anchored targets in remote accessibles. r=Jamie,layout-anchor-positioning-reviewers,layout-reviewers,emilio,firefox-style-system-reviewers https://github.com/mozilla-firefox/firefox/commit/f21d081a2064 https://hg.mozilla.org/integration/autoland/rev/8bbd7e06665e apply code formatting via Lando
QA Whiteboard: [qa-triage-done-c146/b145]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: