|
54 | 54 | </p> |
55 | 55 | <h1 class="p-name no-ref" id=title>CSS Custom Properties for Cascading Variables Module Level 1</h1> |
56 | 56 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
57 | | - <span class=dt-updated><span class=value-title title=20131216>16 December 2013</span></span></span></h2> |
| 57 | + <span class=dt-updated><span class=value-title title=20131217>17 December 2013</span></span></span></h2> |
58 | 58 | <div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-variables/>http://dev.w3.org/csswg/css-variables/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-variables-1/>http://www.w3.org/TR/css-variables-1/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-variables/>http://dev.w3.org/csswg/css-variables/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-css-variables-20130312/ rel=previous>http://www.w3.org/TR/2013/WD-css-variables-20130312/</a><dd><a href=http://www.w3.org/TR/2012/WD-css-variables-20120410/ rel=previous>http://www.w3.org/TR/2012/WD-css-variables-20120410/</a> |
59 | 59 | <dt>Feedback:</dt> |
60 | 60 | <dd><a href="mailto:www-style@w3.org?subject=%5Bcss-variables%5D%20feedback">www-style@w3.org</a> |
@@ -384,9 +384,19 @@ <h3 class="heading settled heading" data-level=2.3 id=cycles><span class=secno>2 |
384 | 384 | <p> <a data-link-type=dfn href=#custom-property title="custom properties">Custom properties</a> may use variables in their own values to build up composite variables. |
385 | 385 | This can create cyclic dependencies |
386 | 386 | where a custom property uses its own variable, |
387 | | - or two or more <a data-link-type=dfn href=#custom-property title="custom properties">custom properties</a> each attempt to use the variable that the other defines; |
388 | | - doing so makes all the <a data-link-type=dfn href=#custom-property title="custom properties">custom properties</a> involved in the cycle |
389 | | - compute to their initial value (which is a guaranteed-invalid value). |
| 387 | + or two or more <a data-link-type=dfn href=#custom-property title="custom properties">custom properties</a> each attempt to use the variable that the other defines. |
| 388 | + |
| 389 | +<p> For each element, |
| 390 | + create an undirected dependency graph, |
| 391 | + containing nodes for each <a data-link-type=dfn href=#custom-property title="custom property">custom property</a>. |
| 392 | + If the value of a <a data-link-type=dfn href=#custom-property title="custom property">custom property</a> <var>prop</var> contains a <a data-link-type=dfn href=#variable title=variable>variable</a> <var>var</var> |
| 393 | + (including in the fallback of other <a data-link-type=dfn href=#variable title=variables>variables</a>), |
| 394 | + add an edge between <var>prop</var> and the <a data-link-type=dfn href=#custom-property title="custom property">custom property</a> associated with <var>var</var>. |
| 395 | + <span class=note>Edges are possible from a custom property to itself.</span> |
| 396 | + If there is a cycle in the dependency graph, |
| 397 | + all the <a data-link-type=dfn href=#custom-property title="custom properties">custom properties</a> in the cycle |
| 398 | + must compute to their initial value |
| 399 | + (which is a guaranteed-invalid value). |
390 | 400 |
|
391 | 401 | <div class=example> |
392 | 402 | This example shows a custom property safely using a variable: |
|
0 commit comments