@@ -896,6 +896,23 @@ Any place that accepts a {{CSSKeywordValue}}
896
896
also accepts a raw {{USVString}} ,
897
897
by using the following typedef and algorithm:
898
898
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
+
899
916
<div algorithm="CSSKeywordValue.value">
900
917
The <dfn attribute for=CSSKeywordValue>value</dfn> attribute of a {{CSSKeywordValue}} |this| must,
901
918
on setting a value |value|,
@@ -1613,35 +1630,35 @@ The following are the arithmetic operations you can perform on dimensions:
1613
1630
4. Return the [=list/item=] of |args| whose sole [=list/item=] has the largest [=sum value/value=] .
1614
1631
</div>
1615
1632
</dl>
1633
+ </div>
1616
1634
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|:
1619
1637
1620
- 1. Let |types| be an initially empty [=list=] .
1638
+ 1. Let |types| be an initially empty [=list=] .
1621
1639
1622
- 2. [=map/For each=] |unit| → |power| in |unit map|:
1640
+ 2. [=map/For each=] |unit| → |power| in |unit map|:
1623
1641
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|.
1627
1645
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>
1630
1648
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:
1634
1652
1635
- 1. Let |result| be a copy of |units1|.
1653
+ 1. Let |result| be a copy of |units1|.
1636
1654
1637
- 2. [=map/For each=] |unit| → |power| in |units2|:
1655
+ 2. [=map/For each=] |unit| → |power| in |units2|:
1638
1656
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|.
1642
1660
1643
- 3. Return |result|.
1644
- </div>
1661
+ 3. Return |result|.
1645
1662
</div>
1646
1663
1647
1664
The {{CSSNumericValue/parse()}} method allows a {{CSSNumericValue}}
0 commit comments