Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5cc9b1797e0e294e250d524f30347722bb0c99d5
https://github.com/WebKit/WebKit/commit/5cc9b1797e0e294e250d524f30347722bb0c99d5
Author: Alan Baradlay <[email protected]>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
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-flex-basis-on-row-expected.txt
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/style/values/sizing/StylePreferredSize.cpp
Log Message:
-----------
[css-values-5 calc-size()] Add support for calc-size() on flex-basis when the
main axis is the flex item's block axis
https://bugs.webkit.org/show_bug.cgi?id=324505
<rdar://problem/187738680>
Reviewed by Antti Koivisto.
<div style="display: flex; flex-direction: column; height: 200px">
<div style="height: 50px; flex-basis: calc-size(auto, size * 1.6 +
23px)">…</div>
</div>
`auto` on flex-basis is the block size property, 50px, so the item is 103px
tall.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp:
(WebCore::FlexFormattingUtils::flexBasisForFlexItem):
Keeps a calc-size() on either axis now that the block axis resolves one, so the
axis check is gone.
* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::flexBaseSizeForFlexItem):
(WebCore::FlexFormattingContext::flexBaseSizeForFlexItem):
Measures the item as is when its flex basis is the main size property itself,
which is what
flexBasisForFlexItem() now answers flex-basis: auto with when that property is
a calc-size().
Installing the property as its own override would apply its calculation twice.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeightUsingGeneric const):
Resolves the block size property and lets it stand for the content height while
a flex basis of
calc-size(auto, …) is in place, which is what `auto` means there.
* Source/WebCore/style/values/sizing/StylePreferredSize.cpp:
(WebCore::Style::PreferredSize::asMinimumSize const):
(WebCore::Style::PreferredSize::asFlexBasis const):
Carry a keyword-basis calc-size() across instead of letting switchOn() rebuild
it as the bare
keyword, which is how a flex-basis of auto lost the calculation on the main
size property.
*
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/calc-size-flex-basis-on-row-expected.txt:
Canonical link: https://commits.webkit.org/322494@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications