Bug 259487 - AX: Unstyled lists with multiple children have list semantics removed
Summary: AX: Unstyled lists with multiple children have list semantics removed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 16
Hardware: All macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-25 10:28 PDT by Diane Ko
Modified: 2023-11-03 14:59 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diane Ko 2023-07-25 10:28:39 PDT
WebKit removes the semantics of lists whenever the list styling is removed. In a tweet from James Craig (https://twitter.com/cookiecrook/status/1084142936583892992), the heuristics for a list are defined in AccessibilityList.cpp (https://github.com/WebKit/webkit/blob/main/Source/WebCore/accessibility/AccessibilityList.cpp#L137-L143):
1. If it's a named list, like ol or aria=list, then it's a list.
  1a. Unless the list has no children, then it's not a list.
2. If it displays visible list markers, it's a list.
3. If it does not display list markers and has only one child, it's not a list.
4. If it does not have any listitem children, it's not a list.
5. Otherwise it's a list (for now).

This would imply from the heuristics that an unstyled list that has more than one child should be considered a list. However, in the actual code logic, this isn't the case.

It seems like either the heuristics in the code comment are incorrect or the logic to match those heuristics is incorrect. As I generally agree with the heuristics in the code comment, it would be great to have the code match the written heuristics. Thanks!
Comment 1 Radar WebKit Bug Importer 2023-07-25 10:28:49 PDT
<rdar://problem/112843417>
Comment 2 Adrian Roselli 2023-10-25 08:14:21 PDT
Statement from Apple Safari rep:

> Also, at the moment, we don't believe https://bugs.webkit.org/show_bug.cgi?id=259487 is a report of a bug, but rather a (handy) report that the comment is out of date. We're looking into it, so aren't 100% sure yet... more later... but meanwhile, it does not look like this is an issue for Interop 2024 — especially since how precisely screenreaders are to handle lists is not standardized. Perhaps it should be, but that's another thing to discuss outside the Interop 2024 Focus Area proposal process.

https://github.com/web-platform-tests/interop/issues/512#issuecomment-1778254874

I can assure you that some authors (and users) consider this a bug.

If Apple can issue that statement on an unrelated issue, can we get clarity here on this specific bug report from an Apple rep?
Comment 3 James Craig 2023-10-26 16:26:18 PDT
I wrote the original tests cases for the patch https://bug-134187-attachments.webkit.org/attachment.cgi?id=233587 

And wrote extensively on reasons for the change before and after this thread.
https://twitter.com/cookiecrook/status/1337226933822603270

And I'm confident that the bug is an and/or transposition in the comment, not a bug in the implementation. 

We discussed the fix should be:

```diff
- 3. If it does not display list markers and has only one child, it's not a list.
+ 3. If it does not display list markers or has only one child, it's not a list.
```

and to intersperse the individual step comments with each respective block, so that it's less likely to get out of date in the future... 

In particular, this change https://webkit.org/b/193382 (UL in NAV should retain list heuristic) was was fixed, but wasn't added to the preceding comment block.
Comment 4 James Craig 2023-10-26 17:46:45 PDT
More comments were already interspersed. Corrected that typo other editorial changes.

https://github.com/WebKit/WebKit/pull/19616/
Comment 5 James Craig 2023-10-26 17:49:13 PDT
Thanks Diane, for catching that the comment didn't match the implementation.
Comment 6 EWS 2023-11-03 14:59:18 PDT
Committed 270206@main (b503c374a46e): <https://commits.webkit.org/270206@main>

Reviewed commits have been landed. Closing PR #19616 and removing active labels.