Bug 1735589 Part 2 - Respect flex item's pre-stretched cross-size when computing its content size suggestion in inline-axis. r=dholbert

This patch is targeted at the case where the item's inline axis is the main
axis (which typically means a row-oriented flex container).

If our flex item has a "pre-stretched" block size (from align-self:stretch),
then this patch lets its inline-axis content-size-measurements take that
stretched size into account, in case they impact the resulting inline-axis
measurement. That is, the pre-stretched block size can transfer through
aspect-ratio as the inline-size.

Differential Revision: https://phabricator.services.mozilla.com/D131261
This commit is contained in:
Ting-Yu Lin 2024-09-14 02:42:21 +00:00
Родитель b332ef48e3
Коммит 5545ca63c0
3 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -1682,6 +1682,9 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize(
const nscoord availISize = 0; // for min-content size
StyleSizeOverrides sizeOverrides;
sizeOverrides.mStyleISize.emplace(StyleSize::Auto());
if (aFlexItem.IsStretched()) {
sizeOverrides.mStyleBSize.emplace(aFlexItem.StyleCrossSize());
}
const auto sizeInItemWM = aFlexItem.Frame()->ComputeSize(
aItemReflowInput.mRenderingContext, itemWM,
aItemReflowInput.mContainingBlockSize, availISize,

Просмотреть файл

@ -1,3 +0,0 @@
[flex-minimum-width-flex-items-013.html]
bug: https://github.com/web-platform-tests/wpt/pull/26299
expected: FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[flex-aspect-ratio-045.html]
expected: FAIL