[webkit-changes] [WebKit/WebKit] 994ec6: [Flex] Flexbox's cross size is considered definite...
Sammy Gill
noreply at github.com
Wed Feb 5 18:30:52 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 994ec6a36403d8c3aac59c09a40705164bb6591a
https://github.com/WebKit/WebKit/commit/994ec6a36403d8c3aac59c09a40705164bb6591a
Author: Sammy Gill <sammy.gill at apple.com>
Date: 2025-02-05 (Wed, 05 Feb 2025)
Changed paths:
A LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-vert-lr-with-img-expected.html
A LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-vert-lr-with-img.html
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[Flex] Flexbox's cross size is considered definite when its cross size direction is its inline direction.
https://bugs.webkit.org/show_bug.cgi?id=279569
rdar://135897530
Reviewed by Alan Baradlay.
The flex spec states: If a single-line flex container has a definite
cross size, the automatic preferred outer cross size of any stretched
flex items is the flex container’s inner cross size (clamped to the flex
item’s min and max cross size) and is considered definite.
We determine this in flexItemCrossSizeShouldUseContainerCrossSize and
return true if the cross axis is in the physical width direction. This
does not work in all cases, such as
<div style="display: flex; writing-mode: vertical-lr">
...
</div>
In this case the flexbox's cross axis is indeed in the physical width
direction but its cross axis size is based on its contents. This can
cause us to incorrectly compute the base size of the flex item by causing
us to take the steps in 9.2.3B when we should not. Instead we should check
if the cross axis is in the *logical* width direction, since this should
be definite by the time we perform flex layout via the formatting context
in which it participates.
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-vert-lr-with-img-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flexbox-vert-lr-with-img.html: Added.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::flexItemCrossSizeShouldUseContainerCrossSize const):
(WebCore::RenderFlexibleBox::computeCrossSizeForFlexItemUsingContainerCrossSize const):
(WebCore::RenderFlexibleBox::crossAxisIsPhysicalWidth const): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/289903@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list