1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

LibWeb: Position abspos children of flex container after parent layout

If we wait until after the parent context has laid out the flex
container, abspos children are able to use the final results of the
parent sizing the flex container.

This makes `height:auto` work on abspos children of a flex container.
This commit is contained in:
Andreas Kling 2022-07-22 16:36:17 +02:00
parent 7aa9e03e85
commit 050e70cc7e
2 changed files with 5 additions and 0 deletions

View file

@ -136,7 +136,10 @@ void FlexFormattingContext::run(Box const& run_box, LayoutMode layout_mode)
// part of the spec, and simply covering up the fact that our inside layout currently
// mutates the height of BFC roots.
copy_dimensions_from_flex_items_to_boxes();
}
void FlexFormattingContext::parent_context_did_dimension_child_root_box()
{
flex_container().for_each_child_of_type<Box>([&](Layout::Box& box) {
if (box.is_absolutely_positioned())
layout_absolutely_positioned_element(box);