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

LibWeb: Handle fit-content in calculate_max_content_contribution in GFC

Fixes https://github.com/SerenityOS/serenity/issues/21569
This commit is contained in:
Aliaksandr Kalenik 2023-10-25 20:56:54 +02:00 committed by Andreas Kling
parent 04a4ffaa3d
commit 58f8068853
3 changed files with 41 additions and 3 deletions

View file

@ -0,0 +1,25 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x33.46875 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x17.46875 children: not-inline
Box <div.flex> at (8,8) content-size 784x17.46875 flex-container(row) [FFC] children: not-inline
Box <div.grid> at (8,8) content-size 67.4375x17.46875 flex-item [GFC] children: not-inline
BlockContainer <div.w-fit> at (8,8) content-size 31.25x17.46875 [BFC] children: inline
line 0 width: 31.25, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 4, rect: [8,8 31.25x17.46875]
"Col1"
TextNode <#text>
BlockContainer <div.w-fit> at (41.71875,8) content-size 33.71875x17.46875 [BFC] children: inline
line 0 width: 33.71875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 4, rect: [41.71875,8 33.71875x17.46875]
"Col2"
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x33.46875]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17.46875]
PaintableBox (Box<DIV>.flex) [8,8 784x17.46875]
PaintableBox (Box<DIV>.grid) [8,8 67.4375x17.46875]
PaintableWithLines (BlockContainer<DIV>.w-fit) [8,8 31.25x17.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.w-fit) [41.71875,8 33.71875x17.46875]
TextPaintable (TextNode<#text>)

View file

@ -0,0 +1,12 @@
<!DOCTYPE html><style type="text/css">
.flex {
display: flex;
}
.grid {
display: grid;
grid-template-columns: 1fr 1fr;
}
.w-fit {
width: fit-content;
}
</style><div class="flex"><div class="grid"><div class="w-fit">Col1</div><div class="w-fit">Col2</div>