Skip to content

Commit ab02eca

Browse files
committed
Changed 'invalid variable use' to 'invalid at computed-value time' and rephrased a few bits to be more general, since attr() probably needs to do the same thing.
1 parent 38c495e commit ab02eca

2 files changed

Lines changed: 33 additions & 26 deletions

File tree

css-variables/Overview.html

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636

3737
<h1>CSS Variables Module Level 1</h1>
3838

39-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 28 September
39+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 29 September
4040
2011</h2>
4141

4242
<dl>
4343
<dt>This version:
4444

4545
<dd><a
46-
href="http://www.w3.org/TR/2011/ED-css-variables-20110928/">http://dev.w3.org/csswg/css-variables/</a>
46+
href="http://www.w3.org/TR/2011/ED-css-variables-20110929/">http://dev.w3.org/csswg/css-variables/</a>
4747
<!--<dt>Latest version:
4848
<dd><a href="http://www.w3.org/TR/css-variables/">http://www.w3.org/TR/css-variables/</a>-->
4949

@@ -353,9 +353,10 @@ <h2 id=using-variables><span class=secno>3. </span> Using Variables</h2>
353353
value that nonetheless has no relation to the variable of that name.
354354

355355
<p>A variable is substituted for its value in the property value at
356-
computed-value time. If the property value, once all variables are
357-
substituted in, is invalid for the property, that is an <a
358-
href="#invalid-variable-use"><i>invalid variable use</i></a>.
356+
computed-value time. If a declaration, once all variables are substituted
357+
in, is invalid, the declaration is <a
358+
href="#invalid-at-computed-value-time"><i>invalid at computed-value
359+
time</i></a>.
359360

360361
<div class=example>
361362
<p>For example, the following usage is fine from a syntax standpoint, but
@@ -378,14 +379,17 @@ <h3 id=using-invalid-variables><span class=secno>3.1. </span> Using Invalid
378379
<p>An <dfn id=invalid-variable title="invalid variable|invalid
379380
variables">invalid variable</dfn> results from having variables directly
380381
or indirectly refer to themselves, or from using an undefined variable.
381-
Using an <a href="#invalid-variable"><i>invalid variable</i></a> results
382-
in an <a href="#invalid-variable-use"><i>invalid variable use</i></a>.
383-
384-
<p>An <dfn id=invalid-variable-use>invalid variable use</dfn> results from
385-
either using an <a href="#invalid-variable"><i>invalid variable</i></a> in
386-
a property value, or using a valid variable that produces an invalid
387-
property value when it is substituted in. When this happens, the property
388-
the variable is used in must compute to the property's initial value.
382+
Using an <a href="#invalid-variable"><i>invalid variable</i></a> in a
383+
property value makes the declaration <a
384+
href="#invalid-at-computed-value-time"><i>invalid at computed-value
385+
time</i></a>.
386+
387+
<p>A declaration that is <dfn id=invalid-at-computed-value-time>invalid at
388+
computed-value time</dfn> results from either using an <a
389+
href="#invalid-variable"><i>invalid variable</i></a> in a property value,
390+
or using a valid variable that produces an invalid declaration when it is
391+
substituted in. When this happens, the declaration must compute to the
392+
property's initial value.
389393

390394
<div class=example>
391395
<p>For example, in the following code:</p>
@@ -397,13 +401,15 @@ <h3 id=using-invalid-variables><span class=secno>3.1. </span> Using Invalid
397401

398402
<p>the &lt;p> elements will have transparent backgrounds (the initial
399403
value for &lsquo;<code class=property>background-color</code>&rsquo;),
400-
rather than red backgrounds.</p>
404+
rather than red backgrounds. This is different from the second</p>
401405
</div>
402406

403-
<p class=note>The <a href="#invalid-variable-use"><i>invalid variable
404-
use</i></a> concept exists because variables can't "fail early" like other
405-
syntax errors can, so by the time the user agent realizes a property value
406-
is invalid, it's already thrown away the other cascaded values.
407+
<p class=note>The <a href="#invalid-at-computed-value-time"><i>invalid at
408+
computed-value time</i></a> concept exists because variables can't "fail
409+
early" like other syntax errors can, so by the time the user agent
410+
realizes a property value is invalid, it's already thrown away the other
411+
cascaded values. I think &lsquo;<code class=css>attr()</code>&rsquo; needs
412+
to rely on it as well, as its behavior is almost identical to variables.
407413

408414
<h2 id=cssom><span class=secno>4. </span> APIs</h2>
409415

@@ -715,15 +721,16 @@ <h2 class=no-num id=index>Index</h2>
715721
<li>inactive, <a href="#inactive-var-rule"
716722
title=inactive><strong>2.</strong></a>
717723

724+
<li>invalid at computed-value time, <a
725+
href="#invalid-at-computed-value-time" title="invalid at computed-value
726+
time"><strong>3.1.</strong></a>
727+
718728
<li>invalid variable, <a href="#invalid-variable" title="invalid
719729
variable"><strong>3.1.</strong></a>
720730

721731
<li>invalid variables, <a href="#invalid-variable" title="invalid
722732
variables"><strong>3.1.</strong></a>
723733

724-
<li>invalid variable use, <a href="#invalid-variable-use" title="invalid
725-
variable use"><strong>3.1.</strong></a>
726-
727734
<li>renderer, <a href="#renderer" title=renderer><strong>6.2.</strong></a>
728735

729736

css-variables/Overview.src.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ <h2 id='using-variables'>
155155

156156
<p>A variable can be used anywhere a value is expected in CSS. Variables can not be used as property names, selectors, or anything else besides property values - doing so either produces an invalid value or, in some situations like the attribute value of an attribute selector, a valid value that nonetheless has no relation to the variable of that name.</p>
157157

158-
<p>A variable is substituted for its value in the property value at computed-value time. If the property value, once all variables are substituted in, is invalid for the property, that is an <i>invalid variable use</i>.</p>
158+
<p>A variable is substituted for its value in the property value at computed-value time. If a declaration, once all variables are substituted in, is invalid, the declaration is <i>invalid at computed-value time</i>.</p>
159159

160160
<div class='example'>
161161
<p>For example, the following usage is fine from a syntax standpoint, but results in nonsense when the variable is substituted in:</p>
@@ -170,9 +170,9 @@ <h2 id='using-variables'>
170170
<h3 id='using-invalid-variables'>
171171
Using Invalid Variables</h3>
172172

173-
<p>An <dfn title="invalid variable|invalid variables">invalid variable</dfn> results from having variables directly or indirectly refer to themselves, or from using an undefined variable. Using an <i>invalid variable</i> results in an <i>invalid variable use</i>.</p>
173+
<p>An <dfn title="invalid variable|invalid variables">invalid variable</dfn> results from having variables directly or indirectly refer to themselves, or from using an undefined variable. Using an <i>invalid variable</i> in a property value makes the declaration <i>invalid at computed-value time</i>.</p>
174174

175-
<p>An <dfn>invalid variable use</dfn> results from either using an <i>invalid variable</i> in a property value, or using a valid variable that produces an invalid property value when it is substituted in. When this happens, the property the variable is used in must compute to the property's initial value.</p>
175+
<p>A declaration that is <dfn>invalid at computed-value time</dfn> results from either using an <i>invalid variable</i> in a property value, or using a valid variable that produces an invalid declaration when it is substituted in. When this happens, the declaration must compute to the property's initial value.</p>
176176

177177
<div class='example'>
178178
<p>For example, in the following code:</p>
@@ -182,10 +182,10 @@ <h3 id='using-invalid-variables'>
182182
p { background-color: red; }
183183
p { background-color: $invalid; }</pre>
184184

185-
<p>the &lt;p> elements will have transparent backgrounds (the initial value for 'background-color'), rather than red backgrounds.</p>
185+
<p>the &lt;p> elements will have transparent backgrounds (the initial value for 'background-color'), rather than red backgrounds. This is different from the second</p>
186186
</div>
187187

188-
<p class='note'>The <i>invalid variable use</i> concept exists because variables can't "fail early" like other syntax errors can, so by the time the user agent realizes a property value is invalid, it's already thrown away the other cascaded values.</p>
188+
<p class='note'>The <i>invalid at computed-value time</i> concept exists because variables can't "fail early" like other syntax errors can, so by the time the user agent realizes a property value is invalid, it's already thrown away the other cascaded values. I think ''attr()'' needs to rely on it as well, as its behavior is almost identical to variables.</p>
189189

190190
<h2 id='cssom'>
191191
APIs</h2>

0 commit comments

Comments
 (0)