1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 20:05:07 +00:00
serenity/Tests/LibWeb/Layout/input/flex/flex-container-with-max-width-and-negative-margin-in-same-axis.html
Andreas Kling 1ebae7a779 LibWeb: Stop changing width of block-level flex containers during layout
If the parent BFC can come up with a nice stretch-fit width for the flex
container, it will have already done so *before* even entering flex
layout. There's no need to do it again, midway through the flex layout
algorithm.

This wasn't just unnecessary, but we were also doing it incorrectly and
not taking margins into account when calculating the amount of available
space for stretch-fit. This led to oversized flex containers in the
presence of negative margins.

Fixes #18614
2023-05-08 15:56:00 +02:00

12 lines
No EOL
255 B
HTML

<!DOCTYPE html><html><head><style>
#container-of-flex {
max-width: 100px;
}
#flex {
display: flex;
margin-left: -100px;
background-color: orange;
height: 100px;
}
</style></head><body><div id="container-of-flex"><div id="flex"> </div>