mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Allow replaced elements to host children
We add a new formatting context that simply runs layout for an anonymous block formatting context within it. This allows replaced elements to contain children, if the parent rewrites inline-flow to inline-block.
This commit is contained in:
committed by
Alexander Kalenik
parent
bc60768cb0
commit
dd0c821291
Notes:
github-actions[bot]
2026-02-23 06:28:55 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/dd0c8212917 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8056 Reviewed-by: https://github.com/kalenikaliaksandr ✅ Reviewed-by: https://github.com/konradekk
@@ -243,7 +243,7 @@ static GC::Ptr<Box> nearest_ancestor_capable_of_forming_a_containing_block(Node&
|
||||
if (ancestor->is_block_container()
|
||||
|| ancestor->display().is_flex_inside()
|
||||
|| ancestor->display().is_grid_inside()
|
||||
|| ancestor->is_svg_svg_box()) {
|
||||
|| ancestor->is_replaced_box_with_children()) {
|
||||
return as<Box>(ancestor);
|
||||
}
|
||||
}
|
||||
@@ -1424,6 +1424,11 @@ bool NodeWithStyleAndBoxModelMetrics::should_create_inline_continuation() const
|
||||
if (is_svg_box() || is_svg_svg_box() || is_svg_foreign_object_box())
|
||||
return false;
|
||||
|
||||
// Replaced boxes with children (e.g. media elements with shadow DOM controls)
|
||||
// have their own formatting context; don't split them.
|
||||
if (parent()->is_replaced_box_with_children())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user