Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7eb5ac55cccd0daca7a17fb550ba2ec003b7500a
https://github.com/WebKit/WebKit/commit/7eb5ac55cccd0daca7a17fb550ba2ec003b7500a
Author: Alan Baradlay <[email protected]>
Date: 2026-05-04 (Mon, 04 May 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-min-height-min-content-overflow-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-min-height-min-content-overflow-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-min-height-min-content-overflow.html
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[Flex] min-content sized flex item should not be scrollable
https://bugs.webkit.org/show_bug.cgi?id=313940
Reviewed by Antti Koivisto.
The flex spec says that when a flex item has min-height: auto (initial value)
and
its overflow is scrollable, the automatic minimum size is zero.
This lets scrollable boxes shrink freely. But this overflow exception only
applies to the "auto" keyword - the automatic minimum size.
The code was also applying this exception to explicit min-height: min-content,
max-content, and fit-content values. CSS Sizing 3 says these keywords are
equivalent to auto for block sizes, so the code treated them identically. But
"equivalent for resolution" does not mean "subject to the same override." When
an
author explicitly writes min-height: min-content, they want the box to be at
least as tall as its content. The overflow exception should not zero it out.
The fix separates the two paths: explicit min-content/max-content/fit-content on
the block axis always returns true (content-based minimum applies), while auto
still goes through the overflow check.
Also renamed shouldApplyMinSizeAutoForFlexItem to useContentBasedMinimumSize
since it now covers explicit content-based keywords too, and removed the unused
shouldApplyMinBlockSizeAutoForFlexItem.
Tests:
imported/w3c/web-platform-tests/css/css-flexbox/flex-item-min-height-min-content-overflow.html
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeSizingKeywordLogicalContentHeightUsing):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::useContentBasedMinimumSize):
(WebCore::RenderFlexibleBox::useContentBasedMinimumBlockSize):
(WebCore::RenderFlexibleBox::computeFlexItemMinMaxSizes):
(WebCore::RenderFlexibleBox::flexItemNeedsLayoutForSizing const):
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/312517@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications