@@ -896,6 +896,23 @@ Any place that accepts a {{CSSKeywordValue}}
896896also accepts a raw {{USVString}} ,
897897by using the following typedef and algorithm:
898898
899+ <pre class=idl>
900+ typedef (DOMString or CSSKeywordValue) CSSKeywordish;
901+ </pre>
902+
903+ <div algorithm>
904+ To <dfn export>rectify a keywordish value</dfn> |val|,
905+ perform the following steps:
906+
907+ 1. If |val| is a {{CSSKeywordValue}} ,
908+ return |val|.
909+
910+ 2. If |val| is a {{DOMString}} ,
911+ return a new {{CSSKeywordValue}}
912+ with its {{CSSKeywordValue/value}} internal slot
913+ set to |val|.
914+ </div>
915+
899916<div algorithm="CSSKeywordValue.value">
900917 The <dfn attribute for=CSSKeywordValue>value</dfn> attribute of a {{CSSKeywordValue}} |this| must,
901918 on setting a value |value|,
@@ -1613,35 +1630,35 @@ The following are the arithmetic operations you can perform on dimensions:
16131630 4. Return the [=list/item=] of |args| whose sole [=list/item=] has the largest [=sum value/value=] .
16141631 </div>
16151632 </dl>
1633+ </div>
16161634
1617- <div algorithm>
1618- To <dfn export>create a type from a unit map</dfn> |unit map|:
1635+ <div algorithm>
1636+ To <dfn export>create a type from a unit map</dfn> |unit map|:
16191637
1620- 1. Let |types| be an initially empty [=list=] .
1638+ 1. Let |types| be an initially empty [=list=] .
16211639
1622- 2. [=map/For each=] |unit| → |power| in |unit map|:
1640+ 2. [=map/For each=] |unit| → |power| in |unit map|:
16231641
1624- 1. Let |type| be the result of [=creating a type=] from |unit|.
1625- 2. Set |type|’s sole [=map/value=] to |power|.
1626- 3. [=list/Append=] |type| to |types|.
1642+ 1. Let |type| be the result of [=creating a type=] from |unit|.
1643+ 2. Set |type|’s sole [=map/value=] to |power|.
1644+ 3. [=list/Append=] |type| to |types|.
16271645
1628- 3. Return the result of [=CSSNumericValue/multiplying=] all the [=list/items=] of |types|.
1629- </div>
1646+ 3. Return the result of [=CSSNumericValue/multiplying=] all the [=list/items=] of |types|.
1647+ </div>
16301648
1631- <div algorithm>
1632- The <dfn export>product of two unit maps</dfn> |units1| and |units2|
1633- is the result given by the following steps:
1649+ <div algorithm>
1650+ The <dfn export>product of two unit maps</dfn> |units1| and |units2|
1651+ is the result given by the following steps:
16341652
1635- 1. Let |result| be a copy of |units1|.
1653+ 1. Let |result| be a copy of |units1|.
16361654
1637- 2. [=map/For each=] |unit| → |power| in |units2|:
1655+ 2. [=map/For each=] |unit| → |power| in |units2|:
16381656
1639- 1. If |result|[|unit|] [=map/exists=] ,
1640- increment |result|[|unit|] by |power|.
1641- 3. Otherwise, set |result|[|unit|] to |power|.
1657+ 1. If |result|[|unit|] [=map/exists=] ,
1658+ increment |result|[|unit|] by |power|.
1659+ 3. Otherwise, set |result|[|unit|] to |power|.
16421660
1643- 3. Return |result|.
1644- </div>
1661+ 3. Return |result|.
16451662</div>
16461663
16471664The {{CSSNumericValue/parse()}} method allows a {{CSSNumericValue}}
0 commit comments