Bug 255812 - AX: reconcile aria-describedby and aria-description in WebKit
Summary: AX: reconcile aria-describedby and aria-description in WebKit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
: 245985 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-21 14:55 PDT by James Craig
Modified: 2023-05-22 16:48 PDT (History)
9 users (show)

See Also:


Attachments
Patch (7.32 KB, patch)
2023-04-21 17:00 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (25.98 KB, patch)
2023-05-06 00:06 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (28.55 KB, patch)
2023-05-06 07:05 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (33.72 KB, patch)
2023-05-06 13:44 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (37.85 KB, patch)
2023-05-06 20:08 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (38.11 KB, patch)
2023-05-06 23:34 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (43.02 KB, patch)
2023-05-07 10:04 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (43.79 KB, patch)
2023-05-07 11:44 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
Patch (44.55 KB, patch)
2023-05-07 12:49 PDT, chris fleizach
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Craig 2023-04-21 14:55:19 PDT
aria-describedby was the only way in ARIA 1.0, 1.1, and 1.2 to provide an extended description, which WebKit does through AXHelp, the platform tooltip attribute that is also used to expose the title attribute when it is not used to compute the fallback label as part of accname.

aria-description was added in ARIA 1.3 and implemented using AXCustomContent.

This results in a few problems:

1. Long-standing bug: aria-describedby always overwrites the tooltip title in AXHelp.
2. Recent bug: if both aria-description and aria-describedby are used, two different extended descriptions are exposed, rather than aria-describedby overwriting aria-description. (Caveat below *)
3. Recent bug: aria-describedby value (as AXHelp) is spoken by default (expected) but aria-description (as AXCustomContent with default important) is not.


I think the resolution should be:

1. Reconcile a single extended description from aria-describedby and aria-description giving precedent to aria-describedby. (Caveat below *)
2. Change the imortance to AXCustomContentImportanceHigh so it's spoken by default.
3. Keep the tooltip title exposed as AXHelp, unless it has already been used to computed the label (AccName fallback https://w3c.github.io/accname/#comp_tooltip )


* Caveat from above: this extended description precedence order is not actually in the AccName spec yet (which is behind the ARIA spec), but will be soon with https://github.com/w3c/accname/issues/68
Comment 1 Radar WebKit Bug Importer 2023-04-21 14:55:46 PDT
<rdar://problem/108386295>
Comment 2 James Craig 2023-04-21 14:57:38 PDT
In case I missed something, review the ARIA specs for those, including aria-details since it also uses AXCustomContent.

https://w3c.github.io/aria/#aria-describedby
https://w3c.github.io/aria/#aria-description
https://w3c.github.io/aria/#aria-details
Comment 3 chris fleizach 2023-04-21 17:00:07 PDT
Created attachment 466038 [details]
Patch
Comment 4 James Craig 2023-04-26 15:10:47 PDT
Comment on attachment 466038 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=466038&action=review

> LayoutTests/accessibility/aria-description.html:15
> +<div id="button1" role="button" aria-describedby="label1">button</div>
> +<div id="label1">text</div>
> +
> +<div id="button2" role="button" aria-describedby="label2" aria-description="Longer description ignored">button</div>
> +<div id="label2">text</div>
> +

Unless this is already tested in another file, how about a multi-IDREF test, too?

<div id="button3" role="button" aria-describedby="label3 label4" aria-description="this description ignored">button</div>
<div id="label4">concatenated</div>
<div id="label4">description</div>
Comment 5 chris fleizach 2023-05-06 00:06:18 PDT
Created attachment 466242 [details]
Patch
Comment 6 chris fleizach 2023-05-06 07:05:32 PDT
Created attachment 466245 [details]
Patch
Comment 7 chris fleizach 2023-05-06 13:44:39 PDT
Created attachment 466251 [details]
Patch
Comment 8 chris fleizach 2023-05-06 20:08:05 PDT
Created attachment 466255 [details]
Patch
Comment 9 chris fleizach 2023-05-06 23:34:23 PDT
Created attachment 466257 [details]
Patch
Comment 10 chris fleizach 2023-05-07 10:04:32 PDT
Created attachment 466260 [details]
Patch
Comment 11 chris fleizach 2023-05-07 11:44:37 PDT
Created attachment 466264 [details]
Patch
Comment 12 chris fleizach 2023-05-07 12:49:24 PDT
Created attachment 466265 [details]
Patch
Comment 13 EWS 2023-05-08 12:49:47 PDT
Committed 263813@main (352b951ab4a8): <https://commits.webkit.org/263813@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 466265 [details].
Comment 14 chris fleizach 2023-05-22 16:48:18 PDT
*** Bug 245985 has been marked as a duplicate of this bug. ***