Rowgroup headers should go into headers list directly after step 3 (assignment of row headers)

Open
#9,769 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
html
Domain
accessibility

Research direction

Start with the HTML Standard's “Header and data cell semantics” section and the linked table examples. Compare the current row-header, column-header, and rowgroup-header algorithm order with the reported 3.3% example. Done means the normative ordering and resulting header list reflect rowgroup headers before column headers, with the example behavior clarified.

Written by the indexing model from the issue text.

Description

topic: table

When a data cell does not have a headers attribute, the spec puts rowgroup headers into the headers list after running the scanning algorithm for assigning row and column headers. This seems counterintuitive and restricts the situations in which you can use rowgroup scope. It would make more sense for the spec to put rowgroup headers into the headers list directly after running the scanning algorithm for row headers but before running the scanning algorithm for col headers. And my guess is that most people assume the spec works that way.

The data cells from the last table under the table examples (which demonstrates how to use tbody blocks with rowgroup headers) have problematic headers because of this issue. According to the spec, the data cell whose value is 3.3% gets the headers: Percentage of net sales -> 2007 -> Research and development. A more logical order would be Percentage of net sales -> Research and development -> 2007. Research and development is really the parent of Percentage of net sales, not 2007. And the more col/colgroup headers that a data cell has, the more the "distance" grows between the row header(s) for a cell and its rowgroup headers.

https://html.spec.whatwg.org/multipage/tables.html#header-and-data-cell-semantics

For each value of y from principaly to principaly+principalheight-1, run the internal algorithm for scanning and assigning header cells, with the principal cell, the header list, the initial coordinate (principalx,y), and the increments Δx=​−1 and Δy=​0.

For each value of x from principalx to principalx+principalwidth-1, run the internal algorithm for scanning and assigning header cells, with the principal cell, the header list, the initial coordinate (x,principaly), and the increments Δx=​0 and Δy=​−1.

If the principal cell is anchored in a row group, then add all header cells that are row group headers and are anchored in the same row group with an x-coordinate less than or equal to principalx+principalwidth-1 and a y-coordinate less than or equal to principaly+principalheight-1 to header list.

If the principal cell is anchored in a column group, then add all header cells that are column group headers and are anchored in the same column group with an x-coordinate less than or equal...

Dominant language
HTML
Stars
9.4k
Forks
3.2k
Avg merge
3d 9h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from whatwg/html

All issues in whatwg/html

Similar issues

More Accessibility issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.