summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-27 17:15:37 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-13 00:04:51 +0100
commit1dfb3d555cb096a6bf7b5a81ce8ef12975d29b6a (patch)
tree6928acc5a206aa3a16f66bf98ca226c0710ef1a6 /Userland/Libraries
parent1ce1af5d8b0907c2bdf573f86ffdd8cc38a0bbc6 (diff)
downloadserenity-1dfb3d555cb096a6bf7b5a81ce8ef12975d29b6a.zip
LibWeb: Remove FFC::cross_size_is_absolute_or_resolved_nicely()
This is now answered authoritatively by Layout::Box itself.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp25
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h1
2 files changed, 1 insertions, 25 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index 0dcf9c2619..b545861d5b 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -245,30 +245,7 @@ bool FlexFormattingContext::has_cross_min_size(Box const& box) const
bool FlexFormattingContext::has_definite_cross_size(Box const& box) const
{
- return (is_row_layout() ? box.has_definite_height() : box.has_definite_width()) && cross_size_is_absolute_or_resolved_nicely(box);
-}
-
-bool FlexFormattingContext::cross_size_is_absolute_or_resolved_nicely(NodeWithStyle const& box) const
-{
- auto length_percentage = is_row_layout() ? box.computed_values().height() : box.computed_values().width();
-
- if (!length_percentage.has_value())
- return false;
-
- // FIXME: Handle calc here.
- if (length_percentage->is_length()) {
- auto& length = length_percentage->length();
- if (length.is_absolute() || length.is_relative())
- return true;
- if (length.is_auto())
- return false;
- }
-
- if (!box.parent())
- return false;
- if (length_percentage->is_percentage() && cross_size_is_absolute_or_resolved_nicely(*box.parent()))
- return true;
- return false;
+ return is_row_layout() ? box.has_definite_height() : box.has_definite_width();
}
float FlexFormattingContext::specified_main_size_of_child_box(Box const& child_box) const
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
index 294fd03b56..12acfe4fc3 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.h
@@ -61,7 +61,6 @@ private:
float specified_cross_size(Box const&) const;
bool has_main_min_size(Box const&) const;
bool has_cross_min_size(Box const&) const;
- bool cross_size_is_absolute_or_resolved_nicely(NodeWithStyle const&) const;
float specified_main_max_size(Box const&) const;
float specified_cross_max_size(Box const&) const;
float calculated_main_size(Box const&) const;