Closed Bug 1686391 Opened 4 years ago Closed 1 year ago

Stop relying on the layout engine for tables

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

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

People

(Reporter: Jamie, Unassigned)

References

(Blocks 1 open bug)

Details

For HTML tables, we currently query layout for table information. On the modern web, this is causing a bunch of difficult problems:

  1. It is becoming more common to use HTML tables for semantics, but apply (whether explicitly or implicitly via, for example, absolute positioning) CSS display: block, display: inline-block, etc. to some or all of the table elements. This causes layout to treat these as not being part of the table, which makes perfect sense for layout, but doesn't make any sense for a11y. This causes bug 995888, bug 1636807 and bug 1676710 and was also the root cause for a bunch of other bugs we've managed to hack around.
  2. aria-hidden, role="presentation", etc. are perfectly valid within tables, but this means the coordinates calculated by layout are wrong for a11y purposes. See bug 1257490 and bug 1726203.
  3. When a table or something within it gets display: contents, those elements get no layout frame. That results in tables not being exposed at all or very broken tables. See bug 1686123.

I think we should stop relying on layout to calculate table info and instead do it within the a11y engine for all tables, like we already do for ARIA tables/grids. There are two main challenges I see here:

  1. Rowspan. The rowspan in a previous row affects the coordinates of cells in subsequent rows. We need to come up with some way to keep track of which columns in subsequent rows are spanned without potentially walking backwards through the entire table. This needs to work both for initial creation as well as mutations.
  2. Performance. Our ARIAGrid*Accessible code does a lot of tree walking and doesn't cache anything beyond the core header cell cache added in bug 1638238. Given that layout does optimise table info calculation, this could be a significant performance regression. This is covered by bug 1591326.
See Also: → 1591326
See Also: → 1686123
No longer blocks: 1686123
Blocks: 1676710
Blocks: 1726203
See Also: → 1754352
Blocks: 1756120
Whiteboard: [ctw-m1]

The caching implementation in bug 1735970 will solve this, but it is part of the Cache the World project and is thus behind that pref. This bug can be closed once we ship CTW.

No longer blocks: a11y-ctw-tables
Depends on: a11y-ctw-tables
Whiteboard: [ctw-m1]
Depends on: 1782873

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

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