From c9223528a099c1e8323c1ae178af1311ddea573b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 6 May 2023 17:15:53 +0200 Subject: [PATCH] LibWeb: Get rid of weird Length::resolved() usage in LayoutState The second call to resolved() turns non-finite lengths into "auto". This is a very strange ad-hoc behavior that we need to get rid of. --- Userland/Libraries/LibWeb/Layout/LayoutState.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;