Skip to content

Commit 0b3e5af

Browse files
qnighysvgeesus
authored andcommitted
[cssom-1][css-color-4][css-color-5][css-color-6] Describe CSSOM serialization in terms of declared values rather than specified values
1 parent 3115f3c commit 0b3e5af

4 files changed

Lines changed: 36 additions & 36 deletions

File tree

css-color-4/Overview.bs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5696,7 +5696,7 @@ Resolving sRGB values</h3>
56965696

56975697
If the sRGB color was explicitly specified by the author as a [=named color=],
56985698
or as a [=system color=],
5699-
the [=specified value=] is that named or system color, converted to
5699+
the [=declared value=] is that named or system color, converted to
57005700
<a href="https://infra.spec.whatwg.org/#ascii-lowercase">ASCII lowercase</a>.
57015701
The computed and used value
57025702
is the corresponding sRGB color,
@@ -5705,7 +5705,7 @@ Resolving sRGB values</h3>
57055705
and defaulting to opaque if unspecified).
57065706

57075707
<div class="example" id="ex-named-case">
5708-
<p>The author-provided mixed-case form below has a specified value in all lowercase.</p>
5708+
<p>The author-provided mixed-case form below has a declared value in all lowercase.</p>
57095709
<pre class="lang-css"><span class="swatch" style="--color: purple"></span> pUrPlE
57105710

57115711
<span class="swatch" style="--color: purple"></span> purple</pre>
@@ -5724,25 +5724,25 @@ Resolving sRGB values</h3>
57245724

57255725
<!-- While the function names and named colors
57265726
are <a href="https://infra.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a>,
5727-
the [=specified value=]
5727+
the [=declared value=]
57285728
does not preserve any mixed casing
57295729
and is treated as being all lowercase. -->
57305730

57315731

5732-
Otherwise, the specified, computed and used value
5732+
Otherwise, the declared, computed and used value
57335733
is the corresponding sRGB color,
57345734
paired with the specified alpha channel
57355735
(after clamping to [0, 1])
57365736
and defaulting to opaque if unspecified).
57375737

57385738
For historical reasons, when ''calc()'' in sRGB colors
57395739
resolves to a single value,
5740-
the specified value serialises without the "calc(" ")" wrapper.
5740+
the declared value serialises without the "calc(" ")" wrapper.
57415741

57425742
<div class="example" id="ex-srgb-calc-specified">
57435743
For example, if a color is given as
57445744
<span class="swatch" style="--color: rgb(128 127 255)"></span> rgb(calc(64 * 2) 127 255)
5745-
the specified value will be
5745+
the declared value will be
57465746
rgb(128 127 255)
57475747
and not
57485748
rgb(calc(128) 127 255).
@@ -5751,7 +5751,7 @@ Resolving sRGB values</h3>
57515751
<div class="example" id="ex-srgb-hsl-calc-specified">
57525752
For example, if a color is given as
57535753
<span class="swatch" style="--color: rgb(255 165.2 0)"></span> hsl(38.82 calc(2 * 50%) 50%)
5754-
the specified value will be
5754+
the declared value will be
57555755
rgb(255 165.2 0)
57565756
because the ''calc()'' is lost
57575757
during HSL to RGB conversion.
@@ -5764,7 +5764,7 @@ Resolving sRGB values</h3>
57645764
<div class="example" id="ex-srgb-clamped-calc-specified">
57655765
For example, if a color is given as
57665766
<span class="swatch" style="--color: rgb(255 127 0)"></span> rgb(calc(100 * 4) 127 calc(20 - 35))
5767-
the specified value will be
5767+
the declared value will be
57685768
rgb(255 127 0)
57695769
and not
57705770
rgb(calc(400) 127 calc(-15)).
@@ -5791,7 +5791,7 @@ Resolving Lab and LCH values</h3>
57915791

57925792
This applies to ''lab()'' and ''lch()'' values.
57935793

5794-
The specified, computed and used value
5794+
The declared, computed and used value
57955795
is the corresponding CIE Lab or LCH color
57965796
(after clamping of L, C and H)
57975797
paired with the specified alpha channel
@@ -5810,7 +5810,7 @@ Resolving Oklab and Oklch values</h3>
58105810

58115811
This applies to ''oklab()'' and ''oklch()'' values.
58125812

5813-
The specified, computed and used value
5813+
The declared, computed and used value
58145814
is the corresponding Oklab or Oklch color
58155815
(after clamping of L, C and H)
58165816
paired with the specified alpha channel
@@ -5827,7 +5827,7 @@ Resolving Oklab and Oklch values</h3>
58275827
<h3 id="resolving-color-function-values">
58285828
Resolving values of the ''color()'' function</h3>
58295829

5830-
The specified, computed and used value
5830+
The declared, computed and used value
58315831
is the color in the specified [=color space=],
58325832
paired with the specified alpha channel
58335833
(as a <<number>>, not a <<percentage>>;
@@ -5859,7 +5859,7 @@ Resolving values of the ''color()'' function</h3>
58595859
''transparent'',
58605860
and ''color>/currentcolor''.
58615861

5862-
The specified value for each <<system-color>> keyword
5862+
The declared value for each <<system-color>> keyword
58635863
and <<deprecated-color>> keyword
58645864
is itself.
58655865
The computed value
@@ -5872,12 +5872,12 @@ Resolving values of the ''color()'' function</h3>
58725872

58735873
<pre class="lang-html">&lt;button style="color: <span class="swatch" style="--color: ButtonText"></span> ButtonText; background: <span class="swatch" style="--color: ButtonFace"></span> ButtonFace">&lt;/button></pre>
58745874

5875-
The specified value of the color property is "ButtonText"
5875+
The declared value of the color property is "ButtonText"
58765876
while the computed value could be, for example,
58775877
<span class="swatch" style="--color: #FFF"></span> rgb(0, 0, 0).
58785878
</div>
58795879

5880-
The specified value of ''transparent'' is "transparent"
5880+
The declared value of ''transparent'' is "transparent"
58815881
while the computed and used value is [=transparent black=].
58825882

58835883
The ''currentcolor'' keyword computes to itself.
@@ -6086,7 +6086,7 @@ Serializing alpha values</h3>
60866086
</div>
60876087

60886088
Because <<alpha-value>>s which were specified outside the valid range
6089-
are clamped at parse time, the specified value will be clamped.
6089+
are clamped at parse time, the declared value will be clamped.
60906090
However, per [[css-values-4#calc-range]], <<alpha-value>>s
60916091
specified using calc() are not clamped when the specified form is serialized;
60926092
but the computed values are clamped.
@@ -6095,7 +6095,7 @@ Serializing alpha values</h3>
60956095
<p>For example an alpha value which was specified directly as 120%
60966096
would be serialized as the string "1".
60976097
However, if it was specified as calc(2*60%)
6098-
the specified value would be serialized as the string "calc(1.2)".
6098+
the declared value would be serialized as the string "calc(1.2)".
60996099
</p>
61006100
</div>
61016101

@@ -6118,14 +6118,14 @@ Serializing sRGB values</h3>
61186118
https://github.com/w3c/csswg-drafts/issues/8312
61196119
-->
61206120

6121-
is derived from the [=specified value=].
6121+
is derived from the [=declared value=].
61226122

61236123
When serializing the value of a property
61246124
which was set by the author to a CSS [=named color=],
61256125
a [=system color=],
61266126
a <a href="#deprecated-system-colors">deprecated-color</a>,
61276127
or ''transparent''
6128-
therefore, for the [=specified value=],
6128+
therefore, for the [=declared value=],
61296129
the <a href="https://infra.spec.whatwg.org/#ascii-lowercase">ASCII lowercase</a>
61306130
keyword value is retained.
61316131
For the computed and used value,
@@ -6135,11 +6135,11 @@ Serializing sRGB values</h3>
61356135
system-color-compute.html
61366136
</wpt>
61376137

6138-
Thus, the serialized specified value of ''transparent'' is the string "transparent",
6138+
Thus, the serialized declared value of ''transparent'' is the string "transparent",
61396139
while the serialized computed value of ''transparent'' is the string "rgba(0, 0, 0, 0)".
61406140

61416141
For all other sRGB values,
6142-
the specified, computed and used value
6142+
the declared, computed and used value
61436143
is the corresponding sRGB value.
61446144

61456145
Corresponding sRGB values use either the ''rgb()'' or ''rgba()'' form

css-color-5/Overview.bs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,7 @@ an implicit value of 1 (fully opaque) is the default.
27732773
Serializing color-mix()
27742774
</h3>
27752775

2776-
The serialization of the specified value of a ''color-mix()'' function
2776+
The serialization of the declared value of a ''color-mix()'' function
27772777
is the string "color-mix(in ",
27782778
followed by the specified <<color-space>> in all-lowercase,
27792779
followed by ", ",
@@ -2791,15 +2791,15 @@ the second percentage is typically omitted,
27912791
even if explicitly specified.
27922792

27932793
<div class="example" id="ex-serial-specified-mix">
2794-
For example, the serialized specified value of
2794+
For example, the serialized declared value of
27952795
<pre>color-mix(in oklab, teal, peru 40%)</pre>
27962796
would be the string "color-mix(in oklab, teal 60%, peru)".
27972797

2798-
The serialized specified value of
2798+
The serialized declared value of
27992799
<pre>color-mix(in oklab, teal 50%, peru 50%)</pre>
28002800
would be the string "color-mix(in oklab, teal, peru)".
28012801

2802-
The serialized specified value of
2802+
The serialized declared value of
28032803
<pre>color-mix(in oklab, teal 70%, peru 70%)</pre>
28042804
would be the string "color-mix(in oklab, teal 70%, peru 70%)"
28052805
because the fact that these normalize to 50% each
@@ -2808,7 +2808,7 @@ even if explicitly specified.
28082808

28092809
The serialization of the result of a ''color-mix()'' function
28102810
depends on whether the keyword ''currentColor'' is used in the mix.
2811-
If so, the result is serialized as the specified value.
2811+
If so, the result is serialized as the declared value.
28122812
This allows the correct mixture to be used
28132813
on child elements whose ''color'' property has a different value.
28142814
Otherwise, it
@@ -2899,16 +2899,16 @@ is the same as that specified in
28992899
Serializing Relative Color Functions
29002900
</h3>
29012901

2902-
The serialization of the specified value of a relative color function
2902+
The serialization of the declared value of a relative color function
29032903
is a string identifying the color function in all-lowercase,
29042904
followed by "(from ",
2905-
followed by the serialization of the specified value of the origin color,
2905+
followed by the serialization of the declared value of the origin color,
29062906
followed by a single space,
29072907
followed by a singly-space-separated list of the arguments to the color function,
29082908
followed by ")".
29092909

29102910
<div class="example" id="ex-serial-rcs-specified-simple">
2911-
For example, the result of serializing the specified value
2911+
For example, the result of serializing the declared value
29122912

29132913
<pre class="lang-css">OkLcH(from peru l c h)</pre>
29142914

@@ -2919,7 +2919,7 @@ followed by ")".
29192919

29202920
The serialization of the result of a relative color function
29212921
depends on whether the keyword ''currentColor'' is the [=origin color=].
2922-
If so, the result is serialized as the specified value.
2922+
If so, the result is serialized as the declared value.
29232923
This allows the correct value to be used
29242924
on child elements whose ''color'' property has a different value.
29252925
Otherwise, it

css-color-6/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ results of the
379379
Serializing contrast-color() {#serial-contrast-color}
380380
-----------------------------------------------------
381381

382-
The [=specified value=] of the ''contrast-color()'' function
382+
The [=declared value=] of the ''contrast-color()'' function
383383
is serialized with each keyword value as specified
384384
and each component in canonical order.
385385

cssom-1/Overview.bs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,7 @@ depends on the component, as follows:
28022802
<dd>
28032803
The &lt;number> component serialized as per &lt;number> followed by the unit in canonical form as defined in its respective specification.
28042804

2805-
Issue: Probably should distinguish between specified and computed / resolved values.
2805+
Issue: Probably should distinguish between declared and computed / resolved values.
28062806

28072807
<dt><<color>>
28082808
<dd>
@@ -2811,7 +2811,7 @@ depends on the component, as follows:
28112811
If &lt;color&gt; is a component of a computed value, see [[css-color-4#serializing-color-values]].
28122812

28132813

2814-
If <<color>> is a component of a specified value, then
2814+
If <<color>> is a component of a declared value, then
28152815
for sRGB values, see
28162816
[[css-color-4#resolving-sRGB-values]].
28172817
For other color functions, see
@@ -2842,7 +2842,7 @@ For other color functions, see
28422842
<dd>
28432843
The &lt;number> component serialized as per &lt;number> followed by the unit in its canonical form as defined in its respective specification.
28442844

2845-
Issue: Probably should distinguish between specified and computed / resolved values.
2845+
Issue: Probably should distinguish between declared and computed / resolved values.
28462846

28472847
<dt><<identifier>>
28482848
<dd>The identifier
@@ -2857,7 +2857,7 @@ For other color functions, see
28572857
<dd>
28582858
The &lt;number> component serialized as per &lt;number> followed by the unit in its canonical form as defined in its respective specification.
28592859

2860-
Issue: Probably should distinguish between specified and computed / resolved values.
2860+
Issue: Probably should distinguish between declared and computed / resolved values.
28612861

28622862
<dt><<number>>
28632863
<dd>
@@ -2908,7 +2908,7 @@ For other color functions, see
29082908
<dd>The <a>absolute-URL string</a>
29092909
<a lt="serialize a URL">serialized as URL</a>.
29102910

2911-
Issue: This should differentiate specified and computed <<url>> values, see <a href="https://github.com/w3c/csswg-drafts/issues/3195">#3195</a>.
2911+
Issue: This should differentiate declared and computed <<url>> values, see <a href="https://github.com/w3c/csswg-drafts/issues/3195">#3195</a>.
29122912
</dl>
29132913

29142914

@@ -2934,7 +2934,7 @@ define the CSS components.
29342934

29352935
#### Examples #### {#serializing-css-values-examples}
29362936

2937-
Here are some examples of before and after results on specified values.
2937+
Here are some examples of before and after results on declared values.
29382938
The before column could be what the author wrote in a style sheet, while
29392939
the after column shows what querying the DOM would return.
29402940

0 commit comments

Comments
 (0)