Bug 267056

Summary: AX: Tables with one row of all header cells should not be exposed as data tables
Product: WebKit Reporter: Joshua Hoffman <jhoffman23>
Component: AccessibilityAssignee: Joshua Hoffman <jhoffman23>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
jhoffman23: commit-queue+
Patch none

Joshua Hoffman
Reported 2024-01-03 11:52:24 PST
WebKit currently exposes tables with one row of all header cells as data tables, even though other single row tables are not. These should be considered layout tables.
Attachments
Patch (5.73 KB, patch)
2024-01-03 12:00 PST, Joshua Hoffman
jhoffman23: commit-queue+
Patch (5.74 KB, patch)
2024-01-04 20:07 PST, Joshua Hoffman
no flags
Radar WebKit Bug Importer
Comment 1 2024-01-03 11:52:34 PST
Joshua Hoffman
Comment 2 2024-01-03 12:00:29 PST
Joshua Hoffman
Comment 3 2024-01-03 13:00:38 PST
Tyler Wilcock
Comment 4 2024-01-03 18:57:47 PST
Comment on attachment 469280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=469280&action=review > COMMIT_MESSAGE:13 > +AXObjectCache::childrenChanged was also updated to recompute a tables exposability when > +rows change outside of table sections (tbody, thead, tfoot). Is this required for the test in this patch to pass? Or does this fix some other bug that isn't tested? > Source/WebCore/accessibility/AccessibilityTable.cpp:339 > + if (firstRow && currentParent == firstRow && rowIsAllTableHeaderCells && cellCountForEachRow.get(currentParent.get()) >= 1 && rowCount >= 2) Seems like we accidentally added an extra space between && and cellCountForEachRow. > LayoutTests/accessibility/single-th-layout-table.html:35 > + await waitFor(() => accessibilityController.accessibleElementById('table1') != null); Can we also verify the table's role, row count, and column count? Just to make sure it isn't being exposed as a group or something.
Joshua Hoffman
Comment 5 2024-01-03 19:16:38 PST
Comment on attachment 469280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=469280&action=review >> COMMIT_MESSAGE:13 >> +rows change outside of table sections (tbody, thead, tfoot). > > Is this required for the test in this patch to pass? Or does this fix some other bug that isn't tested? Yes, as we have special logic to determine if the presence thead/tbody/tfoot indicate data tables, we want this patch to be agnostic of those factors. This test will implicitly test this addition, as well, as this layout test would not work without it. >> Source/WebCore/accessibility/AccessibilityTable.cpp:339 >> + if (firstRow && currentParent == firstRow && rowIsAllTableHeaderCells && cellCountForEachRow.get(currentParent.get()) >= 1 && rowCount >= 2) > > Seems like we accidentally added an extra space between && and cellCountForEachRow. Will remove that, thanks! >> LayoutTests/accessibility/single-th-layout-table.html:35 >> + await waitFor(() => accessibilityController.accessibleElementById('table1') != null); > > Can we also verify the table's role, row count, and column count? Just to make sure it isn't being exposed as a group or something. Yep, good call.
Joshua Hoffman
Comment 6 2024-01-04 20:07:58 PST
EWS
Comment 7 2024-01-05 17:43:26 PST
Committed 272716@main (51f8361485f6): <https://commits.webkit.org/272716@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 469294 [details].
Note You need to log in before you can comment on or make changes to this bug.