From 3184e201519f49e5cb17b1d2878b5ae43abd963f Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Wed, 13 Oct 2021 09:51:51 -0400 Subject: [PATCH] [css-typed-om] Add support for perspective(none) to CSSPerspective. This adds support for the none argument to the perspective() transform function to CSSPerspective. Fixes #1051. --- css-typed-om/Overview.bs | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 6a99b77e..ace2a79e 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -2442,6 +2442,8 @@ This list is the object's [=values to iterate over=]. + typedef (CSSNumericValue or CSSKeywordish) CSSPerspectiveValue; + [Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)] interface CSSTransformComponent { stringifier; @@ -2499,8 +2501,8 @@ This list is the object's [=values to iterate over=]. [Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)] interface CSSPerspective : CSSTransformComponent { - constructor(CSSNumericValue length); - attribute CSSNumericValue length; + constructor(CSSPerspectiveValue length); + attribute CSSPerspectiveValue length; }; [Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)] @@ -2742,10 +2744,20 @@ This list is the object's [=values to iterate over=]. when invoked, perform the following steps: - 1. If |length| does not [=CSSNumericValue/match=] <<length>>, - [=throw=] a {{TypeError}}. + 1. If |length| is a {{CSSNumericValue}}: + + 1. If |length| does not [=CSSNumericValue/match=] <<length>>, + [=throw=] a {{TypeError}}. + + 2. Otherwise (that is, if |length| is not a {{CSSNumericValue}}): + + 1. [=Rectify a keywordish value=] from |length|, + then set |length| to the result's value. + + 2. If |length| does not repreent the identifier 'none', + [=throw=] a {{TypeError}}. - 2. Return a new {{CSSPerspective}} object + 3. Return a new {{CSSPerspective}} object with its {{CSSPerspective/length}} internal slot set to |length|, and its {{CSSTransformComponent/is2D}} internal slot set to `false`. @@ -5404,7 +5416,9 @@ while CSS <<transform-function>> values become {{CSSTransformComponent}}s. :: 1. Return a new {{CSSPerspective}} object, whose {{CSSPerspective/length}} internal slot - is set to the [=reify a numeric value|reification=] of the specified length + is set to the reification of the specified length + (see [=reify a numeric value=] if it is a length, and + [=reify an identifier=] if it is the keyword 'none') and whose {{CSSTransformComponent/is2D}} internal slot is `false`. </dl>