Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 891677aebe2b1f4c3d1e810c57b8596cbcd39243
https://github.com/WebKit/WebKit/commit/891677aebe2b1f4c3d1e810c57b8596cbcd39243
Author: Alan Baradlay <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-tiny-width-excess-width-distribution-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-tiny-width-excess-width-distribution-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-tiny-width-excess-width-distribution.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-excess-width-distribution-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-excess-width-distribution-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-excess-width-distribution.html
M Source/WebCore/rendering/AutoTableLayout.cpp
Log Message:
-----------
REGRESSION(311393@main): Table cells after a width: 0 column are placed
off-screen
https://bugs.webkit.org/show_bug.cgi?id=325808
<rdar://183452074>
Reviewed by Simon Fraser.
<table style="width: 300px">
<tr>
<td style="width: 20px">text</td>
...
<td style="width: 0; padding: 0"></td>
<td style="width: 1%">text</td>
</tr>
</table>
The last cell should be at the table's right edge. Instead it was placed at x =
-33554152 (caused by NaN).
311393@main stopped ignoring width: 0 on cells, making an empty 'width: 0'
column (with no padding) a fixed column with a max width of 0.
When AutoTableLayout::layout() distributes leftover width over fixed columns,
1. first (and subsequent) columns use up totalFixed,
2. the zero width column computes 0/0 = NaN and
3. the last column gets pushed off-screen.
This is also a pre-existing bug: a positive width that rounds down to 0 in
LayoutUnit (e.g. width: 0.001px) is not ignored either (see first test case).
Stop distributing when we run out of totalFixed space. The remaining fixed
columns have a max width of 0, so they would get 0 anyway, and any width still
left goes to the later passes (e.g. percent columns).
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-tiny-width-excess-width-distribution-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-tiny-width-excess-width-distribution-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-tiny-width-excess-width-distribution.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-excess-width-distribution-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-excess-width-distribution-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-excess-width-distribution.html:
Added.
* Source/WebCore/rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::layout):
Canonical link: https://commits.webkit.org/322376@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications