Bug 249924

Summary: WebKit only distributes extra table-height to tbody rows -- not to thead/tfoot rows
Product: WebKit Reporter: Daniel Holbert <dholbert>
Component: TablesAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, karlcow, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/w3c/csswg-drafts/issues/5776

Daniel Holbert
Reported 2022-12-28 11:34:23 PST
STR: (1) Load either of these testcases: Table using CSS styling: https://bugzilla.mozilla.org/attachment.cgi?id=9310034 Table using HTML parts: https://bugzilla.mozilla.org/attachment.cgi?id=9310036 EXPECTED RESULT: The rows should all be the same height. ACTUAL RESULT: The header/footer rows are only as tall as their content. The css-tables-3 spec "height distribution algorithm" says (in its last paragraph) to distribute any extra available height equally among all rows. There's no exception for rows that are in header/footer groups. Link: https://drafts.csswg.org/css-tables-3/#height-distribution-algorithm Blink has the same behavior as WebKit here, but probably just because this is a legacy WebKit table behavior that Blink inherited. All other browser engines -- Gecko (Firefox), EdgeHTML (Edge 16), Trident (IE11), and Presto (pre-Blink Opera) -- distribute the height equally among all the rows, including the header/footer rows. And that seems to be what the spec calls for, as well. Blink version of this bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=1403995 This was also originally filed as a Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1806961 (but as noted above, Firefox seems to be spec-compliant, and WebKit-derived rendering engines seem to be the odd ones out here; hence I've closed that bug as invalid and filed these Blink/WebKit bugs.)
Attachments
Karl Dubost
Comment 1 2022-12-29 05:33:15 PST
Thanks Daniel! Probably it would be good to have a WPT test for this bug.
Radar WebKit Bug Importer
Comment 2 2023-01-04 11:35:18 PST
Ahmad Saleem
Comment 3 2026-01-29 01:15:24 PST
CSSWG links to - http://wpt.live/css/css-tables/height-distribution/computing-row-measure-0.html Which we partially fail: ``` // Check if section has explicit height that's larger than row heights. auto& logicalHeightLength = style().logicalHeight(); if (auto fixedHeight = logicalHeightLength.tryFixed()) { LayoutUnit specifiedHeight = Style::evaluate<LayoutUnit>(*fixedHeight, style().usedZoomForLength()); if (specifiedHeight > logicalHeight()) { LayoutUnit extraHeight = specifiedHeight - logicalHeight(); distributeExtraLogicalHeightToRows(extraHeight); setLogicalHeight(m_rowPos[numberOfRows]); } } ``` In RenderTableSection::layoutRows() after setLogicalHeight(m_rowPos[numberOfRows]); and before updateLayerTransform(); - fixes above WPT.
Note You need to log in before you can comment on or make changes to this bug.