From 2b65e86ec7fb04d5c0e31256e80bee31a66c6d96 Mon Sep 17 00:00:00 2001 From: stelar7 Date: Sat, 19 Oct 2024 00:43:35 +0200 Subject: [PATCH] LibWeb: Add debug log message for missing calc() context --- Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp index f815a6be32a..e79b075c2b0 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp @@ -52,8 +52,10 @@ static double resolve_value(CSSMathValue::CalculationResult::Value value, Option return length.absolute_length_to_px().to_double(); // If we dont have a context, we cant resolve the length, so return NAN - if (!context.has_value()) + if (!context.has_value()) { + dbgln("Failed to resolve length, likely due to calc() being used with relative units and a property not taking it into account"); return Number(Number::Type::Number, NAN).value(); + } return length.to_px(*context).to_double(); });