浏览代码

LibWeb: Add debug log message for missing calc() context

stelar7 9 月之前
父节点
当前提交
2b65e86ec7
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Userland/Libraries/LibWeb/CSS/StyleValues/CSSMathValue.cpp

+ 3 - 1
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();
                 return length.absolute_length_to_px().to_double();
 
 
             // If we dont have a context, we cant resolve the length, so return NAN
             // 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 Number(Number::Type::Number, NAN).value();
+            }
 
 
             return length.to_px(*context).to_double();
             return length.to_px(*context).to_double();
         });
         });