Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[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.
  • Loading branch information
dbaron committed Oct 13, 2021
commit 3184e201519f49e5cb17b1d2878b5ae43abd963f
26 changes: 20 additions & 6 deletions css-typed-om/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,8 @@ This list is the object's [=values to iterate over=].
</div>

<xmp class=idl>
typedef (CSSNumericValue or CSSKeywordish) CSSPerspectiveValue;

[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSTransformComponent {
stringifier;
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -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>
Expand Down