summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-18 19:19:56 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-18 19:19:56 +0100
commitc04c2df0f779f9f9d9d35ab35f4ab3753e2ec5b7 (patch)
tree8373faa49257dd5a43fbaf4c74953e40d8bb967f
parentf0a4b33a5e5cdb2451d9febe1f0e354b78d9eb3b (diff)
downloadserenity-c04c2df0f779f9f9d9d35ab35f4ab3753e2ec5b7.zip
LibWeb: Add missing is_length() check in FFC::is_cross_auto()
We can't access LengthPercentage::length() before verifying that it's indeed a length.
-rw-r--r--Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
index a2e39d122c..525663dc19 100644
--- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp
@@ -310,7 +310,7 @@ float FlexFormattingContext::calculated_main_size(Box const& box) const
bool FlexFormattingContext::is_cross_auto(Box const& box) const
{
auto& cross_length = is_row_layout() ? box.computed_values().height() : box.computed_values().width();
- return cross_length.has_value() && cross_length->length().is_auto();
+ return cross_length.has_value() && cross_length->is_length() && cross_length->length().is_auto();
}
bool FlexFormattingContext::is_main_axis_margin_first_auto(Box const& box) const