mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
LibWeb: Try to place out-of-flow blocks only in anonymous blocks
This change makes out-of-flow blocks to be considered for joining only to anonymous blocks that have inline children. It finally solved the problem that out-of-flow break anonymous blocks into chunks causing wrong layout without regressing Acid2.
This commit is contained in:
parent
e277185eb1
commit
0ca1af00e7
1 changed files with 6 additions and 3 deletions
|
@ -84,9 +84,7 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
|
||||||
return layout_parent;
|
return layout_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Floats should probably also be able to have inline siblings
|
if ((layout_node.is_absolutely_positioned() || layout_node.is_floating()) && layout_parent.last_child()->children_are_inline() && layout_parent.last_child()->is_anonymous()) {
|
||||||
if (layout_node.is_absolutely_positioned() && layout_parent.last_child()->children_are_inline()) {
|
|
||||||
// Block is out-of-flow, it can have inline siblings if necessary.
|
|
||||||
return *layout_parent.last_child();
|
return *layout_parent.last_child();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +93,11 @@ static Layout::Node& insertion_parent_for_block_node(Layout::NodeWithStyle& layo
|
||||||
return layout_parent;
|
return layout_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (layout_node.is_absolutely_positioned() || layout_node.is_floating()) {
|
||||||
|
// Block is out-of-flow, it can have inline siblings if necessary.
|
||||||
|
return layout_parent;
|
||||||
|
}
|
||||||
|
|
||||||
// Parent block has inline-level children (our siblings).
|
// Parent block has inline-level children (our siblings).
|
||||||
// First move these siblings into an anonymous wrapper block.
|
// First move these siblings into an anonymous wrapper block.
|
||||||
Vector<JS::Handle<Layout::Node>> children;
|
Vector<JS::Handle<Layout::Node>> children;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue