From 7d93875123e0139e7a5dfe05b03eb731f5450f3c Mon Sep 17 00:00:00 2001 From: nainar Date: Mon, 12 Feb 2018 13:30:32 +1100 Subject: [PATCH] Serialize out of range values as calcs Fixes #574 --- css-typed-om/Overview.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index a22e83cd..3f76fc1d 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -360,7 +360,9 @@ probably in an appendix. : If |value| is a {{CSSStyleValue}}, :: If |value| does not [=match a CSS production|match the grammar=] of a [=list-valued property iteration=] of |property|, [=throw=] a {{TypeError}} and exit this algorithm. - Otherwise, return the |value|. + If the |property| only allows certain values, and is passed a {{CSSUnitValue}} |value| that is outside that range, + wrap |value| in a {{CSSMathSum}}, with only one entry in |values|, so that it serializes to 'calc(' + |value| + ')'. + Return the |value|. : If |value| is a {{DOMString}}, :: [=Parse a CSSStyleValue=] with property |property|, cssText |value|, and parseMultiple set to `false`,