Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 21ca9215250e768565b6358f3c8ce95d2cd18808
https://github.com/WebKit/WebKit/commit/21ca9215250e768565b6358f3c8ce95d2cd18808
Author: Ahmad Saleem <[email protected]>
Date: 2026-04-28 (Tue, 28 Apr 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-baseline-overflow-hidden-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-baseline-overflow-hidden.html
M Source/WebCore/rendering/RenderFlexibleBox.cpp
Log Message:
-----------
Flex container baseline should be clamped to border edge for scroll containers
https://bugs.webkit.org/show_bug.cgi?id=313354
rdar://175631095
Reviewed by Alan Baradlay.
This patch aligns WebKi with Gecko / Firefox and Blink / Chromium.
RenderFlexibleBox::firstLineBaseline() and lastLineBaseline() derived
the container's baseline from flex item content without clamping. For
an inline-flex with overflow:hidden containing a large replaced element
(e.g. a centered 100x100 image in a 2.55em container), the synthesized
baseline of the image landed far below the container's bottom border
edge, inflating the enclosing line box height.
Per CSS Align ยง9.1 [1]: "if the position of a scroll container's
first/last baseline is outside its border edge, that baseline's
position is clamped to the border edge." Clamp the computed baseline
to [0, logicalHeight()] when the flex container is a scroll container
on its cross axis, consistent with the existing flex item clamping in
marginBoxAscentForFlexItem().
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::firstLineBaseline const):
(WebCore::RenderFlexibleBox::lastLineBaseline const):
*
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-baseline-overflow-hidden-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-baseline-overflow-hidden.html:
Added.
Canonical link: https://commits.webkit.org/312206@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications