diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index d0ca7778900..b2c0b6f2ce4 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace Web::Layout { @@ -70,6 +71,10 @@ void FlexFormattingContext::run(Box const& run_box, LayoutMode layout_mode) // 3. Determine the flex base size and hypothetical main size of each item for (auto& flex_item : m_flex_items) { + if (flex_item.box.is_replaced_box()) { + // FIXME: Get rid of prepare_for_replaced_layout() and make replaced elements figure out their intrinsic size lazily. + static_cast(flex_item.box).prepare_for_replaced_layout(); + } determine_flex_base_size_and_hypothetical_main_size(flex_item); }