Bug 230408

Summary: AX: iOS VoiceOver doesn't correctly announce expanded state of details element if summary has display: inline-block
Product: WebKit Reporter: Oliver Byford <oliver.byford>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: andresg_22, webkit-bug-importer, webkit.org
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: iOS 14   
Bug Depends on:    
Bug Blocks: 252223    
Attachments:
Description Flags
Test case, with alternative versions for comparison none

Description Oliver Byford 2021-09-17 08:54:50 PDT
Given a details element where the summary is set to `display: inline-block`:

```
<details>
  <summary style="display: inline-block;">Summary</summary>
  <p>Content</p>
</details>
```

1. Activate VoiceOver on iOS
2. Swipe to 'Summary'
3. Double tap to expand the details element
4. Swipe forwards to the expanded content
5. Swipe back to 'Summary'

Expected result:
In step 3, after expanding the element , VO should announce 'Summary, expanded'
In step 5, when swiping back to the summary, VO should announce 'Summary, expanded'

Actual result:
In step 3, after expanding the element , VO announces 'Summary, collapsed'
In step 5, when swiping back to the summary, VO announces 'Summary'

This issue does not occur if the summary element is set to `display: inline-block` or the user-agent default `display: list-item`.
Comment 1 Radar WebKit Bug Importer 2021-09-17 08:55:03 PDT
<rdar://problem/83242798>
Comment 2 Oliver Byford 2021-09-17 08:58:46 PDT
Created attachment 438478 [details]
Test case, with alternative versions for comparison

Adding an example test case, with versions using `display: block` and the user-agent default `display` for comparison.
Comment 3 Curtis Wilcox 2023-10-25 15:52:10 PDT
Using iOS 17.1 with the attached test case, after double tapping the summary with inline-block, VoiceOver (VO) repeats the summary's name but doesn't announce the state ("expanded"). After swiping forward and then back, VO again announces only the name but not the state.

After double-tapping the summary with inline-block again, VO does announce both the name and the collapsed state and does so again if I swipe forward and then back.

VO always announces the name and state for the default `display` and `display: block` versions (before iOS 17.1, VO wasn't announcing *any* states for details/summary elements).