Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: daff5d72c1049582a91f4aae31c5c36ccdd4b8bc
https://github.com/WebKit/WebKit/commit/daff5d72c1049582a91f4aae31c5c36ccdd4b8bc
Author: Sammy Gill <[email protected]>
Date: 2025-05-21 (Wed, 21 May 2025)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-vert-lr-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-vert-lr.html
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[Flex] president.mn: Images in header display squished (vert-lr).
rdar://119196407
https://bugs.webkit.org/show_bug.cgi?id=270959
Reviewed by Alan Baradlay.
RenderFlexibleBox::computeMainSizeFromAspectRatioUsing is used to
compute the main size of a flex item according to section 9.2.3B of flex
layout. Basically, we are supposed to compute the main size from the flex
item's definite cross size and its preferred aspect ratio.
Unfortunately, this can fail in vertical-lr (and probably other) writing
modes.
This seems to be because the code to compute the main size after
we have resolved the cross size and preferred aspect ratio seems to
expect the value to be in physical dimensions as is checks
isHorizontalFlow(). However, the code to resolve the preferred aspect
ratio is a bit all over the place since in some cases the aspect ratio
may be in physical dimensions (i.e. physical width / physical height) and
sometimes, when referring to computeIntrinsicAspectRatio(), may be
logical in terms of the flex item's writing mode (inline size / block
size). This can result in us computing an incorrect main size.
To fix this, we do two main things in this patch:
1.) Switch all of the code related to resolving the preferred aspect
ratio to be in logical dimensions with respect to Flex Layout
(i.e. main size / cross size). This is basically the same as using the
logical dimensions with respect to the flex item's writing mode but
computing the inverse if the flexbox's main axis != flex item's main
axis.
2.) Factor out this code into a dedicated helper function. This is
mostly to reduce clutter in the function it was in before, but this
should also hopefully make it a bit more clear which type of dimensions
we are dealing with when getting the flex item's aspect ratio.
Canonical link: https://commits.webkit.org/295214@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes