1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 11:37:45 +00:00

LibWeb: Treat % max-width as none when containing block size indefinite

This is technically "undefined behavior" per CSS 2.2, but it seems
sensible to mirror the behavior of max-height in the same situation.
It also appears to match how other engines behave.

Fixes #19242
This commit is contained in:
Andreas Kling 2023-06-14 18:35:02 +02:00
parent ff1606ffaf
commit 3a11b55286
7 changed files with 34 additions and 11 deletions

View file

@ -0,0 +1,7 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x136 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x120 children: not-inline
BlockContainer <div> at (8,8) content-size 784x120 children: inline
line 0 width: 120, height: 120, bottom: 120, baseline: 120
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 120x120]
ImageBox <img> at (8,8) content-size 120x120 children: not-inline

View file

@ -0,0 +1,4 @@
<!DOCTYPE html><style>
body { display: max-content; }
img { max-width: 100%; }
</style><body><div><img src="120.png">