LibWeb: Accept fit-content as a value for min-width and max-width

This starts working immediately in BFC thanks to calculate_inner_width
being used for width constraints. :^)
This commit is contained in:
Andreas Kling 2023-05-26 19:08:28 +02:00
parent 1bb4e5c428
commit 8ba7bd1b67
Notes: sideshowbarker 2024-07-16 23:57:20 +09:00
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,15 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (1,1) content-size 798x56.9375 [BFC] children: not-inline
BlockContainer <body> at (10,10) content-size 780x38.9375 children: not-inline
BlockContainer <div.box> at (11,11) content-size 138.28125x17.46875 children: inline
line 0 width: 138.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 18, rect: [11,11 138.28125x17.46875]
"Well hello friends"
TextNode <#text>
BlockContainer <div.box2> at (11,30.46875) content-size 138.28125x17.46875 children: inline
line 0 width: 138.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 18, rect: [11,30.46875 138.28125x17.46875]
"Well hello friends"
TextNode <#text>
BlockContainer <(anonymous)> at (10,48.9375) content-size 780x0 children: inline
TextNode <#text>

View file

@ -0,0 +1,13 @@
<!doctype html><style>
* { border: 1px solid black; }
.box {
background: orange;
min-width: fit-content;
width: 10px;
}
.box2 {
background: pink;
max-width: fit-content;
width: 1000px;
}
</style><div class="box">Well hello friends</div><div class="box2">Well hello friends</div>

View file

@ -1235,6 +1235,7 @@
"percentage [0,∞]"
],
"valid-identifiers": [
"fit-content",
"none"
],
"quirks": [
@ -1265,6 +1266,7 @@
],
"valid-identifiers": [
"auto",
"fit-content",
"none"
],
"quirks": [