summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/Length.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-02-18 16:17:27 +0000
committerAndreas Kling <kling@serenityos.org>2022-02-18 19:04:37 +0100
commit67066c5140b1a2f026f099cec3fe90525cdf41ec (patch)
tree31635800dbde6d7a4fc7c9a017527643e279c773 /Userland/Libraries/LibWeb/CSS/Length.cpp
parent5b2482a9396dc5f7044647f9132f55785fabffdd (diff)
downloadserenity-67066c5140b1a2f026f099cec3fe90525cdf41ec.zip
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()`.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Length.cpp')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Length.cpp14
1 files changed, 1 insertions, 13 deletions
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) {