LibWeb: Resolve flex item % main size to 0 during min-content sizing

When the flex container is sized under a min-content constraint in the
main axis, any flex items with a percentage main size should collapse
to zero width, not take up their own intrinsic min-content size.

This is not in the spec, but matches how other browsers behave.

Fixes an issue where the cartoons on https://basecamp.com/ were way
too large. :^)
This commit is contained in:
Andreas Kling 2024-10-06 15:22:20 +02:00 committed by Andreas Kling
commit 59ed823724
Notes: github-actions[bot] 2024-10-06 14:04:52 +00:00
3 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,19 @@
<!doctype html>
<style type="text/css">
* {
outline: 1px solid black;
}
html {
display: flex;
align-items: center;
width: 60px;
height: 50px;
}
body {
display: flex;
}
img {
width: 100%;
}
</style>
<body><img src="../120.png">