mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Reifying the result gets quite ad-hoc. Firstly because "parse a component value" produces a ComponentValue, not a full StyleValue like we need for math functions. And second, because not all math functions can be reified as a CSSNumericValue: Besides the fact that I haven't implemented CalculatedStyleValue reification at all yet, there are a lot of math functions with no corresponding CSSMathValue in the spec yet. If the calculation tree contains any of those, the best we can do is reify as a CSSStyleValue, and that isn't a valid return value from CSSNumericValue.parse(). So, I made us throw a SyntaxError in those cases. This seems to match Chrome's behaviour. Spec issue: https://github.com/w3c/css-houdini-drafts/issues/1090