mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Don't insert out-of-flow elements into block pseudo elements
Like 1132c858e9
, out-of-flow elements such
as float elements would get inserted into block level `::before` and
`::after` pseudo-element nodes when they should instead be inserted as a
sibling to the pseudo element. This change fixes that.
This fixes a few layout issues on the swedish tax agency website
(skatteverket.se). :^)
This commit is contained in:
parent
196922ae5b
commit
9ed2669fc8
Notes:
sideshowbarker
2024-07-17 00:23:42 +09:00
Author: https://github.com/arthurc Commit: https://github.com/LadybirdBrowser/ladybird/commit/9ed2669fc8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/443
3 changed files with 29 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x42 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x17 children: not-inline
|
||||
BlockContainer <(anonymous)> at (8,8) content-size 784x17 children: inline
|
||||
frag 0 from TextNode start: 0, length: 3, rect: [8,8 27.15625x17] baseline: 13.296875
|
||||
"foo"
|
||||
TextNode <#text>
|
||||
BlockContainer <div> at (8,25) content-size 27.640625x17 floating [BFC] children: inline
|
||||
frag 0 from TextNode start: 0, length: 3, rect: [8,25 27.640625x17] baseline: 13.296875
|
||||
"bar"
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x42]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17] overflow: [8,8 784x34]
|
||||
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x17]
|
||||
TextPaintable (TextNode<#text>)
|
||||
PaintableWithLines (BlockContainer<DIV>) [8,25 27.640625x17]
|
||||
TextPaintable (TextNode<#text>)
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html><style>
|
||||
body::before {
|
||||
content: "foo";
|
||||
display: block;
|
||||
}
|
||||
div {
|
||||
float: left;
|
||||
}
|
||||
</style><body><div>bar
|
|
@ -99,6 +99,7 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
|
|||
if (layout_node.is_out_of_flow()
|
||||
&& !layout_parent.display().is_flex_inside()
|
||||
&& !layout_parent.display().is_grid_inside()
|
||||
&& !layout_parent.last_child()->is_generated()
|
||||
&& layout_parent.last_child()->is_anonymous()
|
||||
&& layout_parent.last_child()->children_are_inline()) {
|
||||
// Block is out-of-flow & previous sibling was wrapped in an anonymous block.
|
||||
|
|
Loading…
Reference in a new issue