mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:57:44 +00:00
LibWeb: Resolve replaced element size constraints using aspect ratios
Some replaced elements can have intrinsic aspect ratios but no intrinsic size. In these cases, the tentative sizes are undefined, and can therefore sometimes be zero. However, when resolving the size constraints, we are already guaranteed to have an intrinsic aspect ratio, so let's use that instead to calculate the resolved sizes.
This commit is contained in:
parent
051f357110
commit
e3f693ca7c
3 changed files with 37 additions and 1 deletions
15
Tests/LibWeb/Layout/input/replaced-within-max-content.html
Normal file
15
Tests/LibWeb/Layout/input/replaced-within-max-content.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.container {
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.replaced {
|
||||
min-width: 150px;
|
||||
max-width: 200px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body><div class="container"><img class="replaced" src="data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><path d="M0,0h10v10h-10v-10"></path></svg>">
|
Loading…
Add table
Add a link
Reference in a new issue