From bfa4143e70319d6b996536aab91710db7b3b440c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 13 Jan 2024 14:34:10 +0100 Subject: [PATCH] LibWeb: Avoid an unnecessary LayoutState lookup in FlexFormattingContext The containing block of a flex item is always formed by the flex container, duh. :^) --- Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index c05125b000..70dba46822 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -203,7 +203,7 @@ void FlexFormattingContext::parent_context_did_dimension_child_root_box() void FlexFormattingContext::populate_specified_margins(FlexItem& item, CSS::FlexDirection flex_direction) const { - auto width_of_containing_block = m_state.get(*item.box->containing_block()).content_width(); + auto width_of_containing_block = m_flex_container_state.content_width(); // FIXME: This should also take reverse-ness into account if (flex_direction == CSS::FlexDirection::Row || flex_direction == CSS::FlexDirection::RowReverse) { item.borders.main_before = item.box->computed_values().border_left().width;