Closed Bug 1636807 Opened 4 years ago Closed 2 years ago

display: block table cells get wrong coordinates when inside a normal <tr>

Categories

(Core :: Disability Access APIs, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox113 --- fixed
firefox114 --- fixed
firefox115 --- fixed

People

(Reporter: Jamie, Unassigned)

References

(Blocks 1 open bug)

Details

Here we go again.

STR:

  1. Open this URL:
    data:text/html,<table><tr><th>a</th><th style="display: block;">b</th><th style="display: block;">c</th><th>d</th></tr></table>
  2. Query the (0-based) column indices for b and c.
    • Expected: 1 and 2.
    • Actual: 0 and 0.
  3. Query the (0-based) column index for d.
    • Expected: 3.
    • Actual: 2.

I haven't debugged this, but here's what I think is happening:

  1. The tr element gets an HTMLTableRowAccessible, which is correct.
  2. As specified by MarkupMap, the th element gets an HTMLTableHeaderCellAccessible because it's a child of an HTML table row.
  3. Things fail because an HTMLTableHeaderCellAccessible needs an nsTableCellFrame, which this doesn't have because it's display: block.

I think we shouldn't use HTMLTableHeaderCellAccessibleWrap for display: block. I guess we can achieve that by checking for AccessibleType() eHTMLTableCellType.

Impact: This causes incorrect table coordinates to be reported by screen readers for affected tables, as well as making screen reader table navigation impossible.
S3 because while this is pretty nasty, I don't know of any cases of it occurring in the wild.
Originally reported as: https://github.com/nvaccess/nvda/issues/8428

(In reply to James Teh [:Jamie] from comment #0)

I think we shouldn't use HTMLTableHeaderCellAccessibleWrap for display: block.

That would only fix step 2, cells b and c. The final th (cell d) would still have an incorrect column index (step 3) because that's what we get from layout. I guess layout treats a block element between two cells as a single cell, regardless of what element it is. The only way I see to fix that is to use our own ARIA table calculation code for everything, even HTML tables.

Depends on: 1686391

This is resolved by Cache the World, which is enabled by default in Firefox 113.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.