Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 35b8a8c39c7572f6d6d4c9d43ea18cfabd709e9d
      
https://github.com/WebKit/WebKit/commit/35b8a8c39c7572f6d6d4c9d43ea18cfabd709e9d
  Author: Alexsander Borges Damaceno <[email protected]>
  Date:   2026-04-16 (Thu, 16 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0.html
    M Source/WebCore/rendering/AutoTableLayout.cpp

  Log Message:
  -----------
  `width: 0` does not collapse table cell to its minimum size
https://bugs.webkit.org/show_bug.cgi?id=285849

Reviewed by Elika Etemad and Darin Adler.

WebKit renders table cells with `width: 0` differently from other major engines
when using the auto table layout algorithm.The engine bug derives from the fact 
that,
in the `width: 0` case for table cells, the cell’s intrinsic width is not being 
calculated.

When calculating the column width,
the `AutoTableLayout::recalcColumn()` function does not execute the code path
responsible for computing the column size for cells with fixed width in case of 
cell with `width: 0`.
This happens because of the following statement is present before compute
cell width `fixedCellLogicalWidth.isPositive()`, where zero value is not 
include only positive
starting from 1.
the column width ends up being determined using the table’s width distribution 
algorithm instead.

This patch removes the condition that skips cells with `width: 0`,
making the code path for fixed width of the cell be executed for `width:0` case.

Tests:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/table-cell-width-0.html:
 Added.
* Source/WebCore/rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):

Canonical link: https://commits.webkit.org/311393@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to