diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp index 75342d1572..46a58bfb37 100644 --- a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp @@ -239,14 +239,14 @@ void LayoutState::UsedValues::set_node(NodeWithStyleAndBoxModelMetrics& node, Us if (width) { border_and_padding = CSSPixels(computed_values.border_left().width) - + computed_values.padding().left().resolved(*m_node, CSS::Length::make_px(containing_block_used_values->content_width())).resolved(*m_node).to_px(*m_node) + + computed_values.padding().left().to_px(*m_node, containing_block_used_values->content_width()) + CSSPixels(computed_values.border_right().width) - + computed_values.padding().right().resolved(*m_node, CSS::Length::make_px(containing_block_used_values->content_width())).resolved(*m_node).to_px(*m_node); + + computed_values.padding().right().to_px(*m_node, containing_block_used_values->content_width()); } else { border_and_padding = CSSPixels(computed_values.border_top().width) - + computed_values.padding().top().resolved(*m_node, CSS::Length::make_px(containing_block_used_values->content_width())).resolved(*m_node).to_px(*m_node) + + computed_values.padding().top().to_px(*m_node, containing_block_used_values->content_width()) + CSSPixels(computed_values.border_bottom().width) - + computed_values.padding().bottom().resolved(*m_node, CSS::Length::make_px(containing_block_used_values->content_width())).resolved(*m_node).to_px(*m_node); + + computed_values.padding().bottom().to_px(*m_node, containing_block_used_values->content_width()); } return unadjusted_pixels - border_and_padding;