Skip to content

Commit 457f00e

Browse files
committed
Update the 'invalid vars' section.
--HG-- extra : rebase_source : 954410f5657834a16798d091dde44a69cbb69967
1 parent 5a39a05 commit 457f00e

2 files changed

Lines changed: 50 additions & 34 deletions

File tree

css-variables/Overview.html

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
<h1>CSS Variables Module Level 1</h1>
2323

24-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 31 May 2012</h2>
24+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 1 June 2012</h2>
2525

2626
<dl>
2727
<dt>This version:
28-
<!--<dd><a href="http://www.w3.org/TR/2012/WD-css-variables-20120531/">http://www.w3.org/TR/2012/ED-css-variables-20120531/</a>-->
28+
<!--<dd><a href="http://www.w3.org/TR/2012/WD-css-variables-20120601/">http://www.w3.org/TR/2012/ED-css-variables-20120601/</a>-->
2929

3030

3131
<dd><a href="http://dev.w3.org/csswg/css-variables/">Editor's draft</a>
32-
(version of 31 May 2012)
32+
(version of 1 June 2012)
3333

3434
<dt>Latest version:
3535

@@ -264,7 +264,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
264264
<tr>
265265
<th>Initial:
266266

267-
<td>invalid (a keyword, but see prose)
267+
<td>(nothing, see prose)
268268

269269
<tr>
270270
<th>Applies To:
@@ -299,6 +299,12 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables
299299
custom micro-syntaxes like what's allowed in calc(). There <em>are</em>
300300
still rules, however; for example, unbalanced parentheses are invalid.
301301

302+
<p> The initial value of a <a href="#variable-property"><i>variable
303+
property</i></a> is an empty invalid value. This means that, until a <a
304+
href="#variable-property"><i>variable property</i></a> is explicitly
305+
defined otherwise by a style sheet, it defines an <a
306+
href="#invalid-variable"><i>invalid variable</i></a>
307+
302308
<p> The term <dfn id=variable-property
303309
title="variable property|variables properties">variable property</dfn>
304310
refers to any property whose name is composed of a "var-" prefix followed
@@ -709,21 +715,23 @@ <h3 id=parent-var-notation><span class=secno>3.3. </span> Getting the
709715
<h3 id=using-invalid-variables><span class=secno>3.4. </span> Using Invalid
710716
Variables</h3>
711717

712-
<p> When a variable property has its initial value, a ‘<code
713-
class=css>var()</code>’ function referencing that property represents an
714-
<dfn id=invalid-variable
715-
title="invalid variable|invalid variables">invalid variable</dfn>. Using
716-
an <a href="#invalid-variable"><i>invalid variable</i></a> in a property
717-
value makes the declaration <a
718+
<p> When a <a href="#variable-property"><i>variable property</i></a> has
719+
its initial value, the <a href="#variable0"><i>variable</i></a> it defines
720+
represents an <dfn id=invalid-variable>invalid variable</dfn>. Using an <a
721+
href="#invalid-variable"><i>invalid variable</i></a> in a property value
722+
(including other <a href="#variable-property"><i>variable
723+
properties</i></a>) makes the declaration <a
718724
href="#invalid-at-computed-value-time"><i>invalid at computed-value
719725
time</i></a>.
720726

721-
<p> A declaration that is <dfn id=invalid-at-computed-value-time>invalid at
722-
computed-value time</dfn> results from either using an <a
723-
href="#invalid-variable"><i>invalid variable</i></a> in a property value,
724-
or using a valid variable that produces an invalid declaration when it is
725-
substituted in. When this happens, the declaration must compute to the
726-
property's initial value.
727+
<p> A declaration can be <dfn id=invalid-at-computed-value-time>invalid at
728+
computed-value time</dfn> if it uses an invalid <a
729+
href="#variable0"><i>variable</i></a>, as explained above, or if it uses a
730+
valid <a href="#variable0"><i>variable</i></a>, but the property value,
731+
after substituting its <a href="#variable0"><i>variables</i></a>, is
732+
invalid. When this happens, the computed value of the property is either
733+
the property's inherited value or its initial value depending on whether
734+
the property is inherited or not, respectively.
727735

728736
<div class=example>
729737
<p> For example, in the following code:
@@ -749,8 +757,7 @@ <h3 id=using-invalid-variables><span class=secno>3.4. </span> Using Invalid
749757
computed-value time</i></a> concept exists because variables can't "fail
750758
early" like other syntax errors can, so by the time the user agent
751759
realizes a property value is invalid, it's already thrown away the other
752-
cascaded values. I think ‘<code class=css>attr()</code>’ needs to rely
753-
on it as well, as its behavior is almost identical to variables.
760+
cascaded values.
754761

755762
<h2 id=cssom><span class=secno>4. </span> CSSOM</h2>
756763

@@ -1061,9 +1068,6 @@ <h2 class=no-num id=index>Index</h2>
10611068
<li>invalid variable, <a href="#invalid-variable"
10621069
title="invalid variable"><strong>3.4.</strong></a>
10631070

1064-
<li>invalid variables, <a href="#invalid-variable"
1065-
title="invalid variables"><strong>3.4.</strong></a>
1066-
10671071
<li>&lt;parent-var>, <a href="#parent-var-notation-type"
10681072
title="&lt;parent-var>"><strong>3.3.</strong></a>
10691073

@@ -1121,7 +1125,7 @@ <h2 class=no-num id=property-index>Property index</h2>
11211125

11221126
<td>&lt;value>
11231127

1124-
<td>invalid (a keyword, but see prose)
1128+
<td>(nothing, see prose)
11251129

11261130
<td>all elements
11271131

css-variables/Overview.src.html

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h2 id="defining-variables">
127127
<td><var>&lt;value></var>
128128
<tr>
129129
<th>Initial:
130-
<td>invalid (a keyword, but see prose)
130+
<td>(nothing, see prose)
131131
<tr>
132132
<th>Applies To:
133133
<td>all elements
@@ -158,6 +158,12 @@ <h2 id="defining-variables">
158158
for example,
159159
unbalanced parentheses are invalid.
160160

161+
<p>
162+
The initial value of a <i>variable property</i> is an empty invalid value.
163+
This means that,
164+
until a <i>variable property</i> is explicitly defined otherwise by a style sheet,
165+
it defines an <i>invalid variable</i>
166+
161167
<p>
162168
The term <dfn title="variable property|variables properties">variable property</dfn> refers to any property
163169
whose name is composed of a "var-" prefix
@@ -582,17 +588,25 @@ <h3 id='using-invalid-variables'>
582588
Using Invalid Variables</h3>
583589

584590
<p>
585-
When a variable property has its initial value,
586-
a ''var()'' function referencing that property
587-
represents an <dfn title="invalid variable|invalid variables">invalid variable</dfn>.
588-
Using an <i>invalid variable</i> in a property value makes the declaration <i>invalid at computed-value time</i>.
591+
When a <i>variable property</i> has its initial value,
592+
the <i>variable</i> it defines
593+
represents an <dfn>invalid variable</dfn>.
594+
Using an <i>invalid variable</i> in a property value
595+
(including other <i>variable properties</i>)
596+
makes the declaration <i>invalid at computed-value time</i>.
589597

590598
<p>
591-
A declaration that is <dfn>invalid at computed-value time</dfn>
592-
results from either using an <i>invalid variable</i> in a property value,
593-
or using a valid variable that produces an invalid declaration when it is substituted in.
599+
A declaration can be <dfn>invalid at computed-value time</dfn>
600+
if it uses an invalid <i>variable</i>, as explained above,
601+
or if it uses a valid <i>variable</i>,
602+
but the property value,
603+
after substituting its <i>variables</i>,
604+
is invalid.
594605
When this happens,
595-
the declaration must compute to the property's initial value.
606+
the computed value of the property is either
607+
the property's inherited value
608+
or its initial value
609+
depending on whether the property is inherited or not, respectively.
596610

597611
<div class='example'>
598612
<p>
@@ -621,9 +635,7 @@ <h3 id='using-invalid-variables'>
621635
The <i>invalid at computed-value time</i> concept exists
622636
because variables can't "fail early" like other syntax errors can,
623637
so by the time the user agent realizes a property value is invalid,
624-
it's already thrown away the other cascaded values.
625-
I think ''attr()'' needs to rely on it as well,
626-
as its behavior is almost identical to variables.
638+
it's already thrown away the other cascaded values.
627639

628640
<h2 id='cssom'>
629641
CSSOM</h2>

0 commit comments

Comments
 (0)