Closed Bug 1395181 Opened 7 years ago Closed 2 years ago

Support "click-ancestor" action on descendants of click handler, instead of "click"

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- disabled
firefox102 --- fixed

People

(Reporter: aaronlev, Assigned: Jamie)

References

Details

(Keywords: papercut)

Attachments

(2 files)

In order to help screen readers avoid too many "clickable" verbalizations, change the name of "click" to "ancestor-click" when the action is inherited via a click handler on an ancestor. For the root clickable item, keep "click".

Note: it must always be action #0 (the default one).

For reference, here is the CL for Chromium: https://chromium-review.googlesource.com/c/chromium/src/+/602261
And the bug/issue: https://bugs.chromium.org/p/chromium/issues/detail?id=689201
As far as I know, Firefox doesn't expose click actions on descendants. For example, if you do this:
data:text/html,<div role="group" aria-label="a" onClick=";"><div role="group" aria-label="b">foo</div></div>
The "a" group gets a click action, but the "b" group does not. (In contrast, in Chrome, it does.) This is why we don't have as many "clickable clickable"s in Firefox as we (currently) do in Chrome.

So, I don't think this specific change (changing the name for descendants) is relevant for Firefox. One could argue that perhaps Firefox *should* expose actions for descendants, in which case it should be "click-ancestor" (not "click").
afaik we expose 'click' actions on text and image descendants of clickable or linkable accessibles, not in general case though.

(In reply to Aaron Leventhal from comment #0)
> In order to help screen readers avoid too many "clickable" verbalizations,
> change the name of "click" to "ancestor-click" when the action is inherited
> via a click handler on an ancestor. For the root clickable item, keep
> "click".

It is not a backward compatible change, so those screen readers who rely on that action probably won't find it or process it properly. So my question would be do we really need to expose any actions on descendants? Especially since Firefox's set of actionalbe elements is lesser than Chrome's one and it seems it doesn't affect badly on Firefox accessibility.
See Also: → 1472799

Exposing a click ancestor action on descendants of click listeners would mean NVDA relies on simulating mouse clicks less often, which would probably solve a bunch of bugs such as activating the Edit Bug button on Bugzilla (bug 1675469), intermittent failure when activating the Show Options button on GitHub comments and occasional other failures trying to activate controls with NVDA across the board.

Severity: normal → S3
Priority: P5 → P3

Previously, we supported an action on text leaf and image accessibles if an ancestor was a link or was clickable.
However, we didn't support it on any other kind of descendant, nor could clients differentiate between a click handler on the descendant itself vs an action propagated because of an ancestor.
In addition, the click was performed on the ancestor element itself, rather than bubbling up to the ancestor.
This was probably never a real problem given the limited scope, but it meant that the actual event target was lost.

This has been replaced by a "click ancestor" action supported on all descendants of ancestors providing an action.
The click is dispatched to the descendant and bubbles up to the ancestor.
Aside from consistency and the ability to differentiate the action, this allows clients to stop relying on simulating clicks themselves to directly target a descendant.
This avoids problems caused by obscured web elements, obscured browser windows and other weird screen coordinate issues.
It thus fixes several problems reported by NVDA screen reader users.

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Attachment #9273196 - Attachment description: Bug 1395181: Support "click ancestor" action on descendants when an ancestor has an action. → Bug 1395181 part 1: Support "click ancestor" action on descendants when an ancestor has an action.

Normally, we treat the body as the DOM node for a DocAccessible.
However, a click listener can be added to the root element; e.g. the html element.
We now treat a click listener added to the root element the same as if one were added to the body.

This required a change to nsAccessibilityService to use the DocAccessible when click listeners change for the root element so a cache update is pushed.
This change was made for the body also, since we weren't pushing a cache update for click listener changes on the body either.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f662752abd85
part 1: Support "click ancestor" action on descendants when an ancestor has an action. r=eeejay
https://hg.mozilla.org/integration/autoland/rev/f96f2a799305
part 2: Support click handlers added to the root element. r=eeejay
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Regressions: 1768219

:ryanvm, as per our discussion on Slack and bug 1768219 comment 4, can you please back out these patches on beta (but leave them on nightly)? Thanks.

Flags: needinfo?(ryanvm)

I've just landed a patch in bug 1768219 which should fix the Talos regression. However, we'll need to wait a bit to know whether it really fixes it. Given where we're at in the beta cycle, it's probably still worth backing this out of beta, unfortunate as that is for users who could benefit from this fix.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: