Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f26d135d648dbe819c5a615361152dfc3d636951
https://github.com/WebKit/WebKit/commit/f26d135d648dbe819c5a615361152dfc3d636951
Author: Alan Baradlay <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/calc-size-height-interpolation-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-height-composition-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-height-interpolation-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-logical-properties-interpolation-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-column-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-height-box-sizing-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-height-expected.txt
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderBox.h
Log Message:
-----------
[css-values-5 calc-size()] Add support for an auto basis in the block axis
https://bugs.webkit.org/show_bug.cgi?id=324503
<rdar://problem/187738630>
Reviewed by Antti Koivisto.
<div style="height: calc-size(auto, size + 30px)">
<div style="height: 84px"></div>
</div>
`auto` on a block is the height of its content, 84px, so the box is 114px tall.
The inline size is known before the children lay out, so the calculation is
done on the way down (BFC).
The block size is not: the children lay out first, `auto` is the height they
came to, and only then is
the calculation applied, which is why the content may end up overflowing the
box.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalHeightByMinMax const):
min-content and max-content behave as auto for a block-axis minimum, but a
calc-size() over one keeps
its own resolution instead of being replaced by the keyword and losing its
calculation.
(WebCore::RenderBox::computeSizingKeywordLogicalContentHeightUsingGeneric
const):
Answers an auto basis with the content height, and substitutes that for `size`
without converting
either side, since this function already answers in the box that box-sizing
selects.
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing const):
Asks for that height when the value is a calc-size(), leaving a bare auto block
size to layout.
(WebCore::RenderBox::resolveCalcSizeContentSize const):
(WebCore::RenderBox::resolveCalcSizeLogicalWidth const):
(WebCore::RenderBox::resolveCalcSizeLogicalHeight const):
The box-sizing conversion moves out of the inline axis wrapper into one both
axes call, now that the
block axis needs it too, leaving each wrapper to pass its own border and
padding.
* Source/WebCore/rendering/RenderBox.h:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-height-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-height-box-sizing-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/calc-size-flex-basis-on-column-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/calc-size-height-interpolation-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-height-composition-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-height-interpolation-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-size/animation/interpolate-size-logical-properties-interpolation-expected.txt:
* LayoutTests/TestExpectations:
calc-size-flex-008 passes now.
Canonical link: https://commits.webkit.org/322463@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications