Yeah, this is a spot where we're doing the right thing. The question here is: what's the cross-size of the flex line? Is it determined using the pre-flexing or post-flexing size of the image? The flexbox spec makes it pretty explicit, I think: > Resolve the flexible lengths of all the flex items to find their **used main size** > 9.4. Cross Size Determination > > 7. Determine **the hypothetical cross size of each item** by performing **layout with the used main size** and the available space, treating auto as fit-content. > 8. Calculate the cross size of each flex line. > [...] Among all the items [...], find the largest outer hypothetical cross size. https://drafts.csswg.org/css-flexbox-1/ In my reduced testcase (data-url / image), the item's used main size is 200px, and when we "perform layout with the used main size" (step 7 quoted above), we get a cross size of 200px, which is then used as this image's cross size and also the line's cross size (which then is reinforced as the image's cross size when it gets stretched to fit the line via default `align-self:stretch` behavior). In [the WPT test](http://wpt.live/css/css-flexbox/flexitem-stretch-image.html), browsers agree that first item's used main size is 345px, and so "perform layout with he used main size" produces a hypothetical cross size of 345px for that item (since it has a 1:1 aspect ratio). Similarly, the other item has a used main size of 255px and a hypothetical cross size of 245px. So the line's cross size is the largest of these, which is 345px, and [both items should be stretched to this height](https://drafts.csswg.org/css-flexbox-1/#algo-stretch) per flexbox section 9.4 step 11. So the test's expectation is wrong. It should have `data-expected-height="345"`, instead of 100. The underlying issue is already reported in Chromium's bug tracker as https://bugs.chromium.org/p/chromium/issues/detail?id=721123
Bug 1626146 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Yeah, this is a spot where we're doing the right thing. The question here is: what's the cross-size of the flex line? Is it determined using the pre-flexing or post-flexing size of the image? The flexbox spec makes it pretty explicit, I think: > Resolve the flexible lengths of all the flex items to find their **used main size** > 9.4. Cross Size Determination > > 7. Determine **the hypothetical cross size of each item** by performing **layout with the used main size** and the available space, treating auto as fit-content. > 8. Calculate the cross size of each flex line. > [...] Among all the items [...], find the largest outer hypothetical cross size. https://drafts.csswg.org/css-flexbox-1/ In my reduced testcase (data-url / image), the item's used main size is 200px, and when we "perform layout with the used main size" (step 7 quoted above), we get a cross size of 200px, which is then used as this image's cross size and also the line's cross size (which then is reinforced as the image's cross size when it gets stretched to fit the line via default `align-self:stretch` behavior). In [the WPT test](http://wpt.live/css/css-flexbox/flexitem-stretch-image.html), browsers agree that first item's used main size is 345px, and so "perform layout with the used main size" produces a hypothetical cross size of 345px for that item (since it has a 1:1 aspect ratio). Similarly, the other item has a used main size of 255px and a hypothetical cross size of 245px. So the line's cross size is the largest of these, which is 345px, and [both items should be stretched to this height](https://drafts.csswg.org/css-flexbox-1/#algo-stretch) per flexbox section 9.4 step 11. So the test's expectation is wrong. It should have `data-expected-height="345"`, instead of 100. The underlying issue is already reported in Chromium's bug tracker as https://bugs.chromium.org/p/chromium/issues/detail?id=721123