Bug 239479 - AX: Support display:contents for table elements
Summary: AX: Support display:contents for table elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 258223 258430 258439 259608
Blocks:
  Show dependency treegraph
 
Reported: 2022-04-18 18:41 PDT by Tyler Wilcock
Modified: 2023-09-07 18:50 PDT (History)
8 users (show)

See Also:


Attachments
Video of Safari iPadOS 16.5 navigating assorted tables via swipe-right (with some explore-by-touch to demonstrate cells mid-table). (2.74 MB, video/mp4)
2023-05-31 04:19 PDT, Adrian Roselli
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2022-04-18 18:41:52 PDT
Setting display:contents on any table-related element (e.g. <table>, <tr>, <td>, ...) breaks AX semantics for the table.
Comment 1 Radar WebKit Bug Importer 2022-04-18 18:41:59 PDT
<rdar://problem/91931942>
Comment 2 Adrian Roselli 2022-07-15 04:58:23 PDT
Test page: https://codepen.io/aardrian/pen/xxGEKKJ
Comment 3 Roman Komarov 2023-01-02 13:50:07 PST
Just want to bump this issue — `display: contents` currently properly works on table elements both in Chrome and Firefox, it would be really nice for it to also work in Safari.
Comment 4 Devon Govett 2023-02-22 13:08:52 PST
Note that this affects more than just HTML <table> elements, it also affects any element with role="grid".
Comment 5 Adrian Roselli 2023-05-31 04:19:26 PDT
Created attachment 466544 [details]
Video of Safari iPadOS 16.5 navigating assorted tables via swipe-right (with some explore-by-touch to demonstrate cells mid-table).

I filed a broader issue:
https://bugs.webkit.org/show_bug.cgi?id=257458

It demonstrates how table cells with `flex`, `grid`, and `contents` caus the entire table to be skipped. Table cells with `block` and `inline-block` report incorrect counts, header associations, and row info.
Comment 6 Tyler Wilcock 2023-07-12 15:26:56 PDT
STP 174 was just released with table improvements:

https://developer.apple.com/documentation/safari-technology-preview-release-notes/stp-release-174#Accessibility

With STP 174, I am able to Ctrl-Option-Arrow and Ctrl-Option-A (read-all) through the display:contents table in the testcase created by Adrian (https://cdpn.io/aardrian/debug/xxGEKKJ). 

> Note that this affects more than just HTML <table> elements, it also affects any element with role="grid".
This was indeed true, and should also be addressed in STP 174 (fixed by https://bugs.webkit.org/show_bug.cgi?id=258430)

Will leave this open for folks to test STP 174 if interested. Please let me know if you encounter additional issues. Thanks!
Comment 7 Adrian Roselli 2023-07-21 12:06:07 PDT
Using Safari Technology Preview 174 on macOS 13.4.1, I found the following two issues:

1. Tables with display: contents on the <td> and <th> can be navigated into using table navigation (Ctrl + Opt + arrows)., but VoiceOver announces each cell as “blank”.

2. Tables with display: contents on the <td> and <th> do not announce cell contents when using read-all (Ctrl + Opt + A). VoiceOver simply announces the column and row position.
Comment 8 Tyler Wilcock 2023-07-28 16:30:29 PDT
(In reply to Adrian Roselli from comment #7)
> Using Safari Technology Preview 174 on macOS 13.4.1, I found the following
> two issues:
> 
> 1. Tables with display: contents on the <td> and <th> can be navigated into
> using table navigation (Ctrl + Opt + arrows)., but VoiceOver announces each
> cell as “blank”.
> 
> 2. Tables with display: contents on the <td> and <th> do not announce cell
> contents when using read-all (Ctrl + Opt + A). VoiceOver simply announces
> the column and row position.
These should be fixed by https://bugs.webkit.org/show_bug.cgi?id=259608 which just landed in `main`. Will post here when that fix is in a Safari Technology Preview (but it should also be in the release notes). Thanks!
Comment 9 Tyler Wilcock 2023-08-09 18:32:10 PDT
> These should be fixed by https://bugs.webkit.org/show_bug.cgi?id=259608
> which just landed in `main`. Will post here when that fix is in a Safari
> Technology Preview (but it should also be in the release notes). Thanks!
This fix was just released in STP 176: https://developer.apple.com/documentation/safari-technology-preview-release-notes/stp-release-176
Comment 10 Adrian Roselli 2023-08-13 11:05:32 PDT
Tested again in Safari Technology Preview 176 on macOS 13.4.1 for *only* the two new issues I found (I am not testing for regressions):

1. WORKS. Tables with display: contents on the <td> and <th> can be navigated into using table navigation (Ctrl + Opt + arrows)., but VoiceOver announces each cell as “blank”.

2. WORKS. Tables with display: contents on the <td> and <th> do not announce cell contents when using read-all (Ctrl + Opt + A). VoiceOver simply announces the column and row position.

Again, I *did not* test on iOS/iPadOS.

I am happy to see this progress.
Comment 11 Tyler Wilcock 2023-09-07 18:50:52 PDT
Closing as this was fixed by:

https://bugs.webkit.org/show_bug.cgi?id=258439
https://bugs.webkit.org/show_bug.cgi?id=259608