Skip to content

Commit d8a1804

Browse files
committed
[css-values-5] Clean up Arbitrary Substitution Function prose
1 parent e589c28 commit d8a1804

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

css-values-5/Overview.bs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Inline Github Issues: no
1717
Default Highlight: css
1818
</pre>
1919
<pre class='link-defaults'>
20+
spec:css-color-4; type:property; text:color
2021
spec:css-values-4; type: dfn;
2122
text: determine the type of a calculation
2223
text: keyword
@@ -1259,11 +1260,6 @@ Conditional Value Selection: the ''if()'' notation</h3>
12591260
if no condition matches,
12601261
then the ''if()'' notation represents an empty token stream.
12611262

1262-
Note: [=Arbitrary substitution functions=] all resolve at [=computed value=] time;
1263-
therefore if the resulting property value is invalid,
1264-
it falls back to the property's [=initial value=]
1265-
rather than to an earlier value in the [=cascade=].
1266-
12671263
The ''if()'' notation syntax is defined as follows:
12681264

12691265
<pre class=prod>
@@ -2616,24 +2612,28 @@ Interpolating sizing keywords: the 'interpolate-size' property</h3>
26162612
Appendix A: Arbitrary Substitution Functions</h2>
26172613

26182614
An <dfn export>arbitrary substitution function</dfn>
2619-
is a function that will,
2615+
is a [=functional notation=] that will,
26202616
when resolved,
2621-
substitute itself with other content
2622-
which is unknowable at parse time.
2623-
2624-
Specifically,
2625-
[=arbitrary substitution functions=] are allowed in <em>all properties</em>.
2626-
When present, the property must be assumed to be valid
2627-
2628-
[=Arbitrary substitution functions=] can be used in place of any part of a value
2629-
in any property on an element.
2630-
They can not be used as
2631-
property names,
2632-
selectors,
2633-
or anything else besides property values,
2634-
unless otherwise specified.
2635-
2636-
<wpt>
2617+
substitute itself with other values
2618+
that are potentially unknowable at parse time--
2619+
and must therefore be parsed while resolving its [=computed value=].
2620+
2621+
Note: Since [=arbitrary substitution functions=] resolve at [=computed value=] time,
2622+
if the resulting value after substitution is invalid,
2623+
the property falls back (essentially) to ''unset'' behavior,
2624+
rather than falling back to an earlier value in the [=cascade=]
2625+
the way declarations invalid at parse time do.
2626+
See [[#invalid-substitution]].
2627+
2628+
Unless otherwise specified,
2629+
[=arbitrary substitution functions=] can be used
2630+
in place of any part of any property's value
2631+
(including within other [=functional notations=]);
2632+
and are not valid in any other context.
2633+
2634+
ISSUE: Should any of these functions be valid in contexts outside of properties?
2635+
2636+
<wpt pathprefix="css/css-variables">
26372637
variable-external-font-face-01.html
26382638
variable-font-face-01.html
26392639
variable-font-face-02.html
@@ -2654,13 +2654,13 @@ Appendix A: Arbitrary Substitution Functions</h2>
26542654
for having an invalid property name.
26552655
</div>
26562656

2657-
If a property contains one or more [=arbitrary substitution functions=],
2658-
and those functions are syntactically valid,
2659-
the entire property's grammar must be assumed to be valid at parse time.
2657+
If a property value contains one or more [=arbitrary substitution functions=],
2658+
and those functions are themselves syntactically valid,
2659+
the entire value's grammar must be assumed to be valid at parse time.
26602660
It is only syntax-checked at computed-value time,
26612661
after [=arbitrary substitution=].
26622662

2663-
<wpt>
2663+
<wpt pathprefix="css/css-variables">
26642664
variable-reference-18.html
26652665
variable-reference-19.html
26662666
variable-reference-30.html
@@ -2669,12 +2669,12 @@ Appendix A: Arbitrary Substitution Functions</h2>
26692669
Each [=arbitrary substitution function=]
26702670
must define how to <dfn export>resolve an arbitrary substitution function</dfn>
26712671
for itself,
2672-
returning optional "result" and "fallback" values.
2673-
The "result" is used to replace the function
2672+
returning optional |result| and |fallback| values.
2673+
The |result| is used to replace the function
26742674
as long as it does not contain the [=guaranteed-invalid value=];
2675-
the "fallback" is used otherwise.
2676-
The "fallback" does not need to be resolved in any way;
2677-
[=substitution=] will handle that if it's actually used.
2675+
the |fallback| is used otherwise.
2676+
(The |fallback| does not need to be resolved in any way;
2677+
[=substitution=] will handle that if it's actually used.)
26782678

26792679
Note: See, for example, [=resolve a var() function=].
26802680

@@ -2712,7 +2712,7 @@ Appendix A: Arbitrary Substitution Functions</h2>
27122712
replace |value| with the [=guaranteed-invalid value=].
27132713
</div>
27142714

2715-
<wpt>
2715+
<wpt pathprefix="css/css-variables">
27162716
css-variable-change-style-001.html
27172717
css-variable-change-style-002.html
27182718
variable-declaration-01.html
@@ -2739,7 +2739,7 @@ Appendix A: Arbitrary Substitution Functions</h2>
27392739
variable-substitution-variable-declaration.html
27402740
</wpt>
27412741

2742-
<wpt title="CSSOM">
2742+
<wpt pathprefix="css/css-variables" title="CSSOM">
27432743
variable-reference-cssom.html
27442744
</wpt>
27452745

@@ -2787,7 +2787,7 @@ Appendix A: Arbitrary Substitution Functions</h2>
27872787
to enforce that they are separate tokens even when re-parsing.
27882788
</div>
27892789

2790-
<wpt>
2790+
<wpt pathprefix="css/css-variables">
27912791
variable-declaration-14.html
27922792
variable-declaration-53.html
27932793
variable-declaration-54.html
@@ -2796,15 +2796,15 @@ Appendix A: Arbitrary Substitution Functions</h2>
27962796
variable-reference-without-whitespace.html
27972797
</wpt>
27982798

2799-
In properties,
2800-
[=arbitrary substitution functions=] are [=substituted=] at computed-value time,
2799+
[=Arbitrary substitution functions=] are [=substituted=]
2800+
during style [=computed value|computation=],
28012801
before any other value transformations or introspection can occur.
28022802
If a property,
28032803
after [=substitution=],
28042804
does not match its declared grammar,
28052805
the declaration is <a>invalid at computed-value time</a>.
28062806

2807-
<wpt>
2807+
<wpt pathprefix="css/css-variables">
28082808
variable-declaration-16.html
28092809
variable-declaration-17.html
28102810
variable-declaration-18.html
@@ -2820,7 +2820,7 @@ Appendix A: Arbitrary Substitution Functions</h2>
28202820
(and possibly whitespace/comments),
28212821
its value is determined as if that keyword were its [=specified value=] all along.
28222822

2823-
<wpt>
2823+
<wpt pathprefix="css/css-variables">
28242824
whitespace-in-fallback-crash.html
28252825
wide-keyword-fallback-001.html
28262826
wide-keyword-fallback-002.html
@@ -2903,7 +2903,7 @@ Invalid Substitution</h3>
29032903
as if the property's value had been specified as the ''unset'' keyword.
29042904
</dl>
29052905

2906-
<wpt>
2906+
<wpt pathprefix="css/css-variables">
29072907
variables-substitute-guaranteed-invalid.html
29082908
</wpt>
29092909

@@ -2965,7 +2965,7 @@ Substitution in Shorthand Properties</h3>
29652965
the shorthand must be parsed
29662966
and the longhands must be given their appropriate values at that point.
29672967

2968-
<wpt>
2968+
<wpt pathprefix="css/css-variables">
29692969
variable-reference-36.html
29702970
variable-reference-37.html
29712971
variable-reference-38.html
@@ -2985,7 +2985,7 @@ Substitution in Shorthand Properties</h3>
29852985
[=Pending-substitution values=] must be serialized as the empty string,
29862986
if an API allows them to be observed.
29872987

2988-
<wpt>
2988+
<wpt pathprefix="css/css-variables">
29892989
variable-definition-border-shorthand-serialize.html
29902990
vars-border-shorthand-serialize.html
29912991
</wpt>
@@ -3054,7 +3054,7 @@ Safely Handling Overly-Long Substitution</h3>
30543054
If an [=arbitrary substitution function=] would expand into a longer token stream than this limit,
30553055
it instead is replaced with the [=guaranteed-invalid value=].
30563056

3057-
<wpt>
3057+
<wpt pathprefix="css/css-variables">
30583058
long-variable-reference-crash.html
30593059
variable-exponential-blowup.html
30603060
</wpt>

0 commit comments

Comments
 (0)