[css-flexbox] ChildIntrinsicLogicalWidth should use fit-content, not max-content
This function needs to match the actual sizing we use. But, since this is the cross-axis size, we use fit-content: https://drafts.csswg.org/css-flexbox/#algo-cross-item See LayoutBox::SizesLogicalWidthToFitContent and LayoutBox::ComputeLogicalWidthUsing for where we do that fit-content sizing; this code makes us match the ComputeLogicalWidthUsing calculation. This bug is currently somewhat hard to trigger because it requires a combination of all of: - flex-wrap: wrap - flex-direction: column - More than one flex line - Not using align-items: flex-start or align-content: flex-start - No explicit width on the flex item - The max-content width needs to be larger than the width of flexbox The reason this does not matter in other cases is because we only use this function to set FlexLine::cross_axis_extent, which we overwrite in AlignFlexLines if we only have one line. And if we do have more than one line, we only use this value for aligning items and lines, so it only matters if we don't use flex-start alignment. This bug will be much easier to trigger once bug 599828 is fixed (there are at least two real-world sites that are affected by this once that bug is fixed) Bug: 876749 Change-Id: I673026bedfaf0e4c4a25830ef686b200ec8f54a1 Reviewed-on: https://chromium-review.googlesource.com/c/1327746 Commit-Queue: Christian Biesinger <cbiesinger@chromium.org> Reviewed-by:Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#607342}
Showing
Please register or sign in to comment