Skip to content

Commit

Permalink
LibWeb: Add debug log message for missing calc() context
Browse files Browse the repository at this point in the history
(cherry picked from commit 2b65e86ec7fb04d5c0e31256e80bee31a66c6d96)
  • Loading branch information
stelar7 authored and nico committed Nov 19, 2024
1 parent bc7a73e commit 17f9f8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 17f9f8c

Please sign in to comment.