Bug 235740

Summary: AX: Incorrect row header announcement in VoiceOver macOS
Product: WebKit Reporter: Adrian Roselli <aroselli>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: andresg_22, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Intel)   
OS: macOS 12   
Attachments:
Description Flags
VoiceOver navigating the table, green arrows indicate the cells with incorrect header information. none

Description Adrian Roselli 2022-01-27 15:13:06 PST
Created attachment 450186 [details]
VoiceOver navigating the table, green arrows indicate the cells with incorrect header information.

Example URL:
https://cdpn.io/aardrian/debug/bGoeqdR

Steps to reproduce the problem:
1. Open Safari.
2. Go to https://cdpn.io/aardrian/debug/bGoeqdR
3. Navigate to any of the first 6 tables.
4. Navigate down any column in the first three rows.
5. Observe how the row header is announced versus what is visible on screen.

What is the expected behavior?
I should hear the row header for the cells in the column.

What went wrong?
I hear the row header from the spanning cells at the bottom of the table or no row header at all.

Does this work in other browsers?
Yes; confirmed to work correctly in Chrome.

More detail:
In the table, the first three (product) rows each have a row header (`<th>`). The first product row (second table row) uses the second spanning row header at the bottom of the table. The second product row (third table row) uses the third spanning row header at the bottom of the table. The third product row (fourth table row) announces no row header. See attached video for example.

Looking at the first product row in the _Unit Price_ column...

What VO should announce:
"Row 2 of 7, Pudding, $1.00"

What VO announces:
"Row 2 of 7, Shipping, $1.00"

Code from video example:
```
    <table>
      <caption>Description Column</caption>
      <tr>
        <th>SKU</th>
        <th id="dh1">Description</th>
        <th>Unit Price</th>
        <th>Quantity</th>
        <th>Total</th>
      </tr>
      <tr>
        <td>123456</td>
        <th>Pudding</th>
        <td>$1.00</td>
        <td>240</td>
        <td>$ 240.00</td>
      </tr>
      <tr>
        <td>987654</td>
        <th>A new set of steak knives</th>
        <td>$90.00</td>
        <td>½</td>
        <td>$ 45.00</td>
      </tr>
      <tr>
        <td>456789</td>
        <th>Sand</th>
        <td>$5.00</td>
        <td>200</td>
        <td>$ 1,000.00</td>
      </tr>
      <tr>
        <th colspan="4" scope="row" headers="dh1">Sub-Total</th>
        <td>$ 1,525.00</td>
      </tr>
      <tr>
        <th colspan="4" scope="row" headers="dh1">Shipping</th>
        <td>FREE</td>
      </tr>
      <tr>
        <th colspan="4" scope="row" headers="dh1">Grand Total</th>
        <td>$ 1,525.00</td>
      </tr>
    </table>
```

Possibly related issue:
Row and column headers not exposed by WebCore accessibility
https://bugs.webkit.org/show_bug.cgi?id=79080
Comment 1 Radar WebKit Bug Importer 2022-01-27 16:17:03 PST
<rdar://problem/88159004>