mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:17:45 +00:00
LibWeb: Join out-of-flow block nodes in last parent child if possible
Join out-of-flow block nodes into last child of parent node if last child has inline children.
This commit is contained in:
parent
43c5b94ea6
commit
c1401b37c4
1 changed files with 7 additions and 5 deletions
|
@ -83,13 +83,15 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
|
|||
return layout_parent;
|
||||
}
|
||||
|
||||
if (!layout_parent.children_are_inline()) {
|
||||
// Parent block has block-level children, insert this block into parent.
|
||||
return layout_parent;
|
||||
}
|
||||
|
||||
if (layout_node.is_floating() || layout_node.is_absolutely_positioned()) {
|
||||
// Block is out-of-flow, it can have inline siblings if necessary.
|
||||
if (layout_parent.last_child()->children_are_inline()) {
|
||||
return *layout_parent.last_child();
|
||||
}
|
||||
}
|
||||
|
||||
if (!layout_parent.children_are_inline()) {
|
||||
// Parent block has block-level children, insert this block into parent.
|
||||
return layout_parent;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue