Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b52469f4fcd7242b2b0da42e6a203d9d149ca693
https://github.com/WebKit/WebKit/commit/b52469f4fcd7242b2b0da42e6a203d9d149ca693
Author: Alan Baradlay <[email protected]>
Date: 2026-04-29 (Wed, 29 Apr 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001.html
M Source/WebCore/rendering/RenderBox.cpp
Log Message:
-----------
Absolutely positioned table ignores min-height and shrinks below content
height
https://bugs.webkit.org/show_bug.cgi?id=313605
Reviewed by Antti Koivisto.
Two issues in computeOutOfFlowPositionedLogicalHeightUsing:
1. The MinimumSize overload had a blanket isRenderTable() early
return that ignored min-height.
<div style="position: relative; width: 100px; height: 50px;">
<table style="position: absolute; width: 100%; min-height: 30px;">
<tr><td></td></tr>
</table>
</div>
Before:
computeOutOfFlowPositionedLogicalHeightUsing(min-height: 30px)
-> isRenderTable() -> return contentLogicalHeight = 0
-> min-height ignored, table is 0px
After:
computeOutOfFlowPositionedLogicalHeightUsing(min-height: 30px)
-> guard removed -> evaluate(30px) = 30
-> table is 30px
The guard was redundant for min-height: auto -- the regular
code path already resolves auto to 0 (isAuto -> 0_css_px).
2. Removing the MinimumSize guard also removed an accidental
content floor. The old guard returned contentLogicalHeight for
min-height: auto, which at line 688 (after rows are laid out)
equaled the accumulated section height. This prevented
updateLogicalHeight from shrinking the table below its content.
<div style="position: relative; width: 100px;">
<table style="position: absolute; width: 100%; height: 100%;">
<tr><td><div style="height: 40px;"></div></td></tr>
</table>
</div>
Containing block is 0px (auto height, no in-flow children).
height: 100% of 0 = 0. Without the content floor, the table
would shrink from 40px (content) to 0px at updateLogicalHeight.
The fix adds an explicit content floor in
computeOutOfFlowPositionedLogicalHeight. This is out-of-flow
specific because only the out-of-flow constraint equation can
produce a height smaller than content. In-flow tables don't
need it -- their logicalHeight is the accumulated section
height and nothing overrides it.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001.html:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeOutOfFlowPositionedLogicalHeight const):
(WebCore::RenderBox::computeOutOfFlowPositionedLogicalHeightUsing const):
Canonical link: https://commits.webkit.org/312313@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications