Skip to content

[css-tables] hidden attribute and display values for tr, thead, tbody, tfoot, colgroup, col #11819

@karlcow

Description

@karlcow

The tests at
https://wpt.fyi/results/html/rendering/non-replaced-elements/tables/hidden-attr.html
for tr, thead, tbody, tfoot, colgroup, col.
fail in any browsers.

<table>
<thead hidden></thead>
</table>

The tests try to assess that
window.getComputedStyle(document.querySelector('thead')).display

should return table-header-group like in the normal case.

<table>
<thead></thead>
</table>

but once the hidden attribute has been specified, all browsers return none (which seems logical).

HTML

https://html.spec.whatwg.org/multipage/interaction.html#attr-hidden
The HTML css defines

colgroup, colgroup[hidden] { display: table-column-group; }
col, col[hidden] { display: table-column; }
thead, thead[hidden] { display: table-header-group; }
tbody, tbody[hidden] { display: table-row-group; }
tfoot, tfoot[hidden] { display: table-footer-group; }
tr, tr[hidden] { display: table-row; }

CSS TABLE

https://www.w3.org/TR/css-tables-3/#mapping

The default CSS doesn't seem to have the same stance.

:matches(colgroup,col,thead,tbody,tfoot,tr,td,th)[hidden] {
  visibility: collapse;
}

Should these WPT tests be changed to reflect the reality of the implementations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    HTMLRequires coordination with HTML peoplecss-tables-3Current Work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions