From 67066c5140b1a2f026f099cec3fe90525cdf41ec Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 18 Feb 2022 16:17:27 +0000 Subject: LibWeb: Remove fallback value from Length::resolved() Nobody makes undefined Lengths now, (although actually removing Undefined will come in a later commit) so we can remove this parameter, and `resolved_or_auto()`/`resolved_or_zero()`. --- Userland/Libraries/LibWeb/CSS/Length.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'Userland/Libraries/LibWeb/CSS/Length.cpp') diff --git a/Userland/Libraries/LibWeb/CSS/Length.cpp b/Userland/Libraries/LibWeb/CSS/Length.cpp index b85657a567..09503162c0 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.cpp +++ b/Userland/Libraries/LibWeb/CSS/Length.cpp @@ -57,10 +57,8 @@ Length Length::percentage_of(Percentage const& percentage) const return Length { percentage.as_fraction() * raw_value(), m_type }; } -Length Length::resolved(Length const& fallback_for_undefined, Layout::Node const& layout_node) const +Length Length::resolved(Layout::Node const& layout_node) const { - if (is_undefined()) - return fallback_for_undefined; if (is_calculated()) return m_calculated_style->resolve_length(layout_node).release_value(); if (is_relative()) @@ -68,16 +66,6 @@ Length Length::resolved(Length const& fallback_for_undefined, Layout::Node const return *this; } -Length Length::resolved_or_auto(Layout::Node const& layout_node) const -{ - return resolved(make_auto(), layout_node); -} - -Length Length::resolved_or_zero(Layout::Node const& layout_node) const -{ - return resolved(make_px(0), layout_node); -} - float Length::relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontMetrics const& font_metrics, float root_font_size) const { switch (m_type) { -- cgit v1.2.3