1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:17:46 +00:00

LibWeb: Resolve cyclic % against 0 when available size is min-content

This fixes an issue where replaced elements with cyclic percentage width
would make an oversized min-content contribution to its container.
This commit is contained in:
Andreas Kling 2023-06-08 12:56:34 +02:00
parent a5f8f8238f
commit 3365a1e034
3 changed files with 60 additions and 4 deletions

View file

@ -0,0 +1,15 @@
<!DOCTYPE html><style>
* {
border: 1px solid red;
}
div.w.min { width: min-content; }
div.w.max { width: max-content; }
div.w > img { width: 100%; }
div.h.min { height: min-content; }
div.h.max { height: min-content; }
div.h > img { height: 100%; }
</style>
<div class="w min"><img src="400.png"></div>
<div class="w max"><img src="400.png"></div>
<div class="h min"><img src="400.png"></div>
<div class="h max"><img src="400.png"></div>