mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
LibWeb: Resolve used insets for floating elements
This makes the game carousel work on https://null.com/ :^)
This commit is contained in:
parent
a2591bc5fa
commit
c83ae729d2
5 changed files with 61 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (2,2) content-size 796x62.9375 [BFC] children: not-inline
|
||||||
|
BlockContainer <body> at (12,12) content-size 600x42.9375 children: not-inline
|
||||||
|
BlockContainer <div.exekiller> at (14,14) content-size 200x17.46875 positioned children: inline
|
||||||
|
line 0 width: 65.4375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||||
|
frag 0 from TextNode start: 0, length: 9, rect: [14,14 65.4375x17.46875]
|
||||||
|
"exekiller"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <div.athena> at (24,25.46875) content-size 200x17.46875 positioned children: inline
|
||||||
|
line 0 width: 53.171875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||||
|
frag 0 from TextNode start: 0, length: 6, rect: [24,25.46875 53.171875x17.46875]
|
||||||
|
"athena"
|
||||||
|
TextNode <#text>
|
|
@ -0,0 +1,13 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (2,2) content-size 796x31.46875 [BFC] children: not-inline
|
||||||
|
BlockContainer <body> at (12,12) content-size 600x0 children: not-inline
|
||||||
|
BlockContainer <div.exekiller> at (14,14) content-size 200x17.46875 positioned floating [BFC] children: inline
|
||||||
|
line 0 width: 65.4375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||||
|
frag 0 from TextNode start: 0, length: 9, rect: [14,14 65.4375x17.46875]
|
||||||
|
"exekiller"
|
||||||
|
TextNode <#text>
|
||||||
|
BlockContainer <div.athena> at (18,18) content-size 200x17.46875 positioned floating [BFC] children: inline
|
||||||
|
line 0 width: 53.171875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
|
||||||
|
frag 0 from TextNode start: 0, length: 6, rect: [18,18 53.171875x17.46875]
|
||||||
|
"athena"
|
||||||
|
TextNode <#text>
|
16
Tests/LibWeb/Layout/input/block-and-inline/relpos-block.html
Normal file
16
Tests/LibWeb/Layout/input/block-and-inline/relpos-block.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<!DOCTYPE html><style>
|
||||||
|
* { border: 2px solid black; }
|
||||||
|
body { width: 600px; }
|
||||||
|
div {
|
||||||
|
width: 200px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.athena {
|
||||||
|
background: green;
|
||||||
|
top: -10px;
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
.exekiller {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
</style><body><div class="exekiller">exekiller</div><div class="athena">athena</div></body>
|
17
Tests/LibWeb/Layout/input/block-and-inline/relpos-float.html
Normal file
17
Tests/LibWeb/Layout/input/block-and-inline/relpos-float.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html><style>
|
||||||
|
* { border: 2px solid black; }
|
||||||
|
body { width: 600px; }
|
||||||
|
div {
|
||||||
|
width: 200px;
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.athena {
|
||||||
|
background: green;
|
||||||
|
top: 4px;
|
||||||
|
left: -200px;
|
||||||
|
}
|
||||||
|
.exekiller {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
</style><body><div class="exekiller">exekiller</div><div class="athena">athena</div></body>
|
|
@ -988,6 +988,8 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
|
||||||
if (line_builder)
|
if (line_builder)
|
||||||
line_builder->recalculate_available_space();
|
line_builder->recalculate_available_space();
|
||||||
|
|
||||||
|
compute_inset(box);
|
||||||
|
|
||||||
if (independent_formatting_context)
|
if (independent_formatting_context)
|
||||||
independent_formatting_context->parent_context_did_dimension_child_root_box();
|
independent_formatting_context->parent_context_did_dimension_child_root_box();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue