LibWeb/Layout: Improve grid item sizing for replaced boxes

With this change we no longer stretch "width: auto" for replaced
elements and also use "width calculation rules for block-level replaced
elements", like suggested by the spec.
This commit is contained in:
Aliaksandr Kalenik 2025-03-20 00:44:06 +01:00 committed by Alexander Kalenik
commit 1f8e7c3cca
Notes: github-actions[bot] 2025-03-20 02:37:49 +00:00
13 changed files with 83 additions and 54 deletions

View file

@ -0,0 +1,12 @@
<!DOCTYPE html><style>
body {
width: 100px;
height: 100px;
}
.img-wrapper {
display: grid;
width: 100%;
height: 100%;
background-color: darkorchid;
}
</style><div class="img-wrapper"><img src="data:image/webp;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAADUlEQVR4nGNgGAWkAwABNgABVtF/yAAAAABJRU5ErkJggg=="></div>