Right now the Blink code for table handling is very heavyweight, cumbersome, and buggy.
For example:
* Blink has separate subclasses for AXTable, AXGrid, AXTableRow, AXTableCell, AXGridCell, etc. - that's a lot of extra code
* Some confusion over whether the children of an AXTable should be only valid AXRows, or other nodes that are children of the table in the DOM but aren't valid rows. Same for rows and cells. Basically the tree structure and table structure are too tightly coupled and don't allow for authoring error.
* Every time a table node is serialized, we serialize a complete mapping from every (row,col) index to corresponding cell ID. Figuring out that mapping involves some loops, so it's very inefficient.
* We're probably not updating everything correctly when the table structure changes.
To simplify it, we could go with the following design:
* Blink no longer has special subclasses for AXTable, AXGridCell, etc.
* Blink returns information about a table's row and column count, and each cell's row and column index, plus spans of course - but no longer computes table-level or row-level information.
* On-demand, AXTree computes the mapping between row and column indexes and cell IDs, and caches it for a short time until the tree changes.
As a follow-up, computation of ARIA row and column indexes could move to AXTree, too.
Comment 1 by bugdroid1@chromium.org
, Apr 18 2018