Skip to content

Commit 60a78a1

Browse files
committed
[css-variables] Specify that you *do* eagerly syntax-check var() functions.
1 parent f0600a5 commit 60a78a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

css-variables/Overview.bs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ Using Cascading Variables: the ''var()'' notation</h2>
373373
For example, ''var(--foo, red, blue)'' defines a fallback of ''red, blue'';
374374
that is, anything between the first comma and the end of the function is considered a fallback value.
375375

376-
A property value containing a ''var()'' function must be assumed to be valid at parse time.
376+
If a property contains one or more ''var()'' functions,
377+
and those functions are syntactically valid,
378+
the entire property's grammar must be assumed to be valid at parse time.
377379
It is only syntax-checked at computed-value time,
378380
after ''var()'' functions have been <a title="substitute a var()">substituted</a>.
379381

css-variables/Overview.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,9 @@ <h2 class="heading settled heading" data-level=3 id=using-variables><span class=
444444
For example, <span class=css data-link-type=maybe title="var(--foo, red, blue)">var(--foo, red, blue)</span> defines a fallback of <span class=css data-link-type=maybe title="red, blue">red, blue</span>;
445445
that is, anything between the first comma and the end of the function is considered a fallback value.
446446

447-
<p> A property value containing a <a class=css data-link-type=maybe href=#funcdef-var title=var()>var()</a> function must be assumed to be valid at parse time.
447+
<p> If a property contains one or more <a class=css data-link-type=maybe href=#funcdef-var title=var()>var()</a> functions,
448+
and those functions are syntactically valid,
449+
the entire property’s grammar must be assumed to be valid at parse time.
448450
It is only syntax-checked at computed-value time,
449451
after <a class=css data-link-type=maybe href=#funcdef-var title=var()>var()</a> functions have been <a data-link-type=dfn href=#substitute-a-var title="substitute a var()">substituted</a>.
450452

0 commit comments

Comments
 (0)