From 89b2dcbb96fea5d04e1b48903784a4d044a0bb61 Mon Sep 17 00:00:00 2001 From: wuggy Date: Mon, 14 Sep 2026 13:57:28 -0700 Subject: [PATCH] Fix build error --- layout/style/nsRuleNode.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index d6c16296fd..063e6cc10e 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -1788,6 +1788,25 @@ SetFactor(const nsCSSValue& aValue, float& aField, RuleNodeCacheConditions& aCon } return; + #include "CSSCalc.h" + + struct RuleNodeReduceNumberCalcOps + : public mozilla::css::BasicFloatCalcOps + , public mozilla::css::CSSValueInputCalcOps + { + float ComputeLeafValue(const nsCSSValue& aValue) + { + MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Number, + "Expected a number-only calc expression"); + return aValue.GetFloatValue(); + } + + float ComputeNumber(const nsCSSValue& aValue) + { + return mozilla::css::ComputeCalc(aValue, *this); + } + }; + case eCSSUnit_Calc: { RuleNodeReduceNumberCalcOps ops; aField = css::ComputeCalc(aValue, ops);