You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: css-variables/Overview.src.html
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ <h2 id='using-variables'>
155
155
156
156
<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>
157
157
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>
159
159
160
160
<divclass='example'>
161
161
<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'>
170
170
<h3id='using-invalid-variables'>
171
171
Using Invalid Variables</h3>
172
172
173
-
<p>An <dfntitle="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 <dfntitle="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>
174
174
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>
<p>the <p> elements will have transparent backgrounds (the initial value for 'background-color'), rather than red backgrounds.</p>
185
+
<p>the <p> elements will have transparent backgrounds (the initial value for 'background-color'), rather than red backgrounds. This is different from the second</p>
186
186
</div>
187
187
188
-
<pclass='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
+
<pclass='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>
0 commit comments