@@ -2935,74 +2935,10 @@ with the subclasses representing individual CSS color functions.
29352935<xmp class='idl'>
29362936[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
29372937interface CSSColorValue : CSSStyleValue {
2938- readonly attribute CSSKeywordValue colorSpace;
2939- CSSColorValue to(CSSKeywordish colorSpace);
29402938 [Exposed=Window] static (CSSColorValue or CSSStyleValue) parse(USVString cssText);
29412939};
29422940</xmp>
29432941
2944- <div algorithm=CSSColorValue.colorSpace>
2945- The <dfn attribute for=CSSColorValue>colorSpace</dfn> attribute
2946- must reflect the color space of the value.
2947- For every class but {{CSSColor}} ,
2948- it is a static {{CSSKeywordValue}} ,
2949- with the value given by the following table:
2950-
2951- <table class=data>
2952- <thead>
2953- <tr><th> {{CSSColorValue/colorSpace}} <th> {{CSSColorValue}} subclass
2954- </thead>
2955- <tr><td> "rgb"<td> {{CSSRGB}}
2956- <tr><td> "hsl"<td> {{CSSHSL}}
2957- <tr><td> "hwb"<td> {{CSSHWB}}
2958- <tr><td> "lch"<td> {{CSSLCH}}
2959- <tr><td> "lab"<td> {{CSSLab}}
2960- <tr><td> "oklab"<td> {{CSSOKLab}}
2961- <tr><td> "oklch"<td> {{CSSOKLCH}}
2962- </table>
2963-
2964- {{CSSColor}} defines its behavior for this attribute further down.
2965- </div>
2966-
2967- <div algorithm="CSSColorValue.to()">
2968- The <dfn method for=CSSColorValue>to(|colorSpace|)</dfn> method
2969- of {{CSSColorValue}} objects must,
2970- when called on |this|:
2971-
2972- 1. [=Rectify a keywordish value=] from |colorSpace|,
2973- then set |colorSpace| to the result's value.
2974-
2975- 2. If |colorSpace| is not in the table below,
2976- [=throw=] a "{{SyntaxError}} " {{DOMException}} .
2977-
2978- 3. If |this| is a {{CSSColor}} value,
2979- and its {{CSSColor/colorSpace}} attribute is not a [[css-color-4#predefined|predefined color space]] ,
2980- [=throw=] an "{{InvalidModificationError}} " {{DOMException}} .
2981-
2982- 2. Convert |this| into the color space indicated by |colorSpace|,
2983- and return a new object of the appropriate {{CSSColorValue}} subclass
2984- with its internal slots set appropriately to represent the color.
2985-
2986- The valid |colorSpace| values,
2987- and the classes they cause this method to return,
2988- are indicated by the following table.
2989- Each of these values is [=ASCII case-insensitive=] .
2990-
2991- <table class=data>
2992- <thead>
2993- <tr><th> |colorSpace|<th> {{CSSColorValue}} subclass
2994- </thead>
2995- <tr><td> "rgb"<td> {{CSSRGB}}
2996- <tr><td> "hsl"<td> {{CSSHSL}}
2997- <tr><td> "hwb"<td> {{CSSHWB}}
2998- <tr><td> "lch"<td> {{CSSLCH}}
2999- <tr><td> "lab"<td> {{CSSLab}}
3000- <tr><td> "oklab"<td> {{CSSOKLab}}
3001- <tr><td> "oklch"<td> {{CSSOKLCH}}
3002- <tr><td> any [[css-color-4#predefined|predefined color space]] <td> {{CSSColor}}
3003- </table>
3004- </div>
3005-
30062942<div algorithm="CSSColorValue.parse()">
30072943 The <dfn method for=CSSColorValue>parse(|cssText|)</dfn> method,
30082944 when called,
@@ -3485,7 +3421,9 @@ The {{CSSColor}} class represents the CSS ''color()'' function.
34853421 must, on setting to a new value |val|,
34863422 [=rectify a keywordish value=] from |val|
34873423 and set the corresponding internal slot to the result of that.
3424+ </div>
34883425
3426+ <div algorithm="CSSColor.alpha">
34893427 The <dfn attribute for=CSSColor>alpha</dfn> attribute of a {{CSSColor}} value
34903428 must, on setting to a new value |val|,
34913429 [=rectify a CSSColorPercent=] from |val|
0 commit comments