|
29 | 29 | } |
30 | 30 | </style> |
31 | 31 |
|
| 32 | + <style> |
| 33 | + pre.idl { border:solid thin; background:#eee; color:#000; padding:0.5em } |
| 34 | + pre.idl :link, pre.idl :visited { color:inherit; background:transparent } |
| 35 | + </style> |
| 36 | + |
32 | 37 | <body> |
33 | 38 | <div class=head> <!--begin-logo--> |
34 | 39 | <p><a href="http://www.w3.org/"><img alt=W3C height=48 |
35 | 40 | src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo--> |
36 | 41 |
|
37 | 42 | <h1>CSS Variables Module Level 1</h1> |
38 | 43 |
|
39 | | - <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 29 September |
| 44 | + <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 30 September |
40 | 45 | 2011</h2> |
41 | 46 |
|
42 | 47 | <dl> |
43 | 48 | <dt>This version: |
44 | 49 |
|
45 | 50 | <dd><a |
46 | | - href="http://www.w3.org/TR/2011/ED-css-variables-20110929/">http://dev.w3.org/csswg/css-variables/</a> |
| 51 | + href="http://www.w3.org/TR/2011/ED-css-variables-20110930/">http://dev.w3.org/csswg/css-variables/</a> |
47 | 52 | <!--<dt>Latest version: |
48 | 53 | <dd><a href="http://www.w3.org/TR/css-variables/">http://www.w3.org/TR/css-variables/</a>--> |
49 | 54 |
|
@@ -153,6 +158,23 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2> |
153 | 158 | </ul> |
154 | 159 |
|
155 | 160 | <li><a href="#cssom"><span class=secno>4. </span> APIs</a> |
| 161 | + <ul class=toc> |
| 162 | + <li><a href="#cssom-simple"><span class=secno>4.1. </span> The Simple |
| 163 | + API</a> |
| 164 | + |
| 165 | + <li><a href="#cssom-stylesheet"><span class=secno>4.2. </span> Additions |
| 166 | + to the Stylesheet Interface</a> |
| 167 | + <ul class=toc> |
| 168 | + <li><a href="#cssom-cssrule"><span class=secno>4.2.1. </span> Changes |
| 169 | + to interface CSSRule</a> |
| 170 | + |
| 171 | + <li><a href="#cssom-cssvariablerule"><span class=secno>4.2.2. </span> |
| 172 | + Interface CSSVariableRule</a> |
| 173 | + |
| 174 | + <li><a href="#cssom-cssvariable"><span class=secno>4.2.3. </span> |
| 175 | + Interface CSSVariableComponentValue</a> |
| 176 | + </ul> |
| 177 | + </ul> |
156 | 178 |
|
157 | 179 | <li><a href="#grammar"><span class=secno>5. </span> The Grammar of |
158 | 180 | Variables</a> |
@@ -420,13 +442,109 @@ <h3 id=using-invalid-variables><span class=secno>3.1. </span> Using Invalid |
420 | 442 |
|
421 | 443 | <h2 id=cssom><span class=secno>4. </span> APIs</h2> |
422 | 444 |
|
423 | | - <p class=issue>Define the "basic" CSSOM APIs from <a |
424 | | - href="http://disruptive-innovations.com/zoo/cssvariables/#mozTocId847334">Daniel's |
425 | | - and Hyatt's spec</a>. |
| 445 | + <p>CSS Variables are mutable - one can change them after they've been |
| 446 | + defined, through the CSSOM. This can be done in two ways: one can read the |
| 447 | + current variable definition and set an override definition through the |
| 448 | + convenient <code>.vars</code> property, or manipulate the definitions in |
| 449 | + the stylesheets directly through the standard CSSOM stylesheet interface. |
| 450 | + |
| 451 | + <h3 id=cssom-simple><span class=secno>4.1. </span> The Simple API</h3
73A5
span>> |
426 | 452 |
|
427 | 453 | <p class=issue>Define the more convenient CSSOM API from <a |
428 | 454 | href="http://www.xanthir.com/blog/b4AD0">my blog post</a>. |
429 | 455 |
|
| 456 | + <h3 id=cssom-stylesheet><span class=secno>4.2. </span> Additions to the |
| 457 | + Stylesheet Interface</h3> |
| 458 | + |
| 459 | + <p>This specification extends the IDL definitions in the CSSOM spec <a |
| 460 | + href="#CSSOM" rel=biblioentry>[CSSOM]<!--{{!CSSOM}}--></a> in several |
| 461 | + ways. |
| 462 | + |
| 463 | + <h4 id=cssom-cssrule><span class=secno>4.2.1. </span> Changes to interface |
| 464 | + CSSRule</h4> |
| 465 | + |
| 466 | + <dl> |
| 467 | + <dt>IDL Definition |
| 468 | + |
| 469 | + <dd> |
| 470 | + <pre class=idl> |
| 471 | +interface CSSRule { |
| 472 | + |
| 473 | + // RuleType |
| 474 | + const unsigned short UNKNOWN_RULE = 0; |
| 475 | + const unsigned short STYLE_RULE = 1; |
| 476 | + const unsigned short CHARSET_RULE = 2; |
| 477 | + const unsigned short IMPORT_RULE = 3; |
| 478 | + const unsigned short MEDIA_RULE = 4; |
| 479 | + const unsigned short FONT_FACE_RULE = 5; |
| 480 | + const unsigned short PAGE_RULE = 6; |
| 481 | + <ins>const unsigned short <a href="#variablerule"><code>VARIABLE_RULE</code></a> = 11;</ins> |
| 482 | + readonly attribute unsigned short type; |
| 483 | + attribute DOMString cssText; |
| 484 | + // raises(DOMException) on setting |
| 485 | + readonly attribute CSSStyleSheet parentStyleSheet; |
| 486 | + readonly attribute CSSRule parentRule; |
| 487 | +};</pre> |
| 488 | + |
| 489 | + <dt>Defined Constants |
| 490 | + |
| 491 | + <dd><dfn id=variablerule><code>VARIABLE_RULE</code></dfn>: The rule is a |
| 492 | + <code>CSSVariableRule</code>. |
| 493 | + </dl> |
| 494 | + |
| 495 | + <p class=issue>Going with value 11 for now, since CSSOM seems to reserve |
| 496 | + 0-10. |
| 497 | + |
| 498 | + <h4 id=cssom-cssvariablerule><span class=secno>4.2.2. </span> Interface |
| 499 | + CSSVariableRule</h4> |
| 500 | + |
| 501 | + <p>The <code>CSSVariableRule</code> interface represents a ‘<code |
| 502 | + class=css>@var</code>’ rule within a CSS stylesheet. The |
| 503 | + ‘<code class=css>@var</code>’ rule is used to define |
| 504 | + variables. |
| 505 | + |
| 506 | + <dl> |
| 507 | + <dt>IDL Definition |
| 508 | + |
| 509 | + <dd> |
| 510 | + <pre class=idl> |
| 511 | +interface CSSVariableRule : CSSRule { |
| 512 | + attribute DOMString name; |
| 513 | + attribute DOMString value; |
| 514 | +}</pre> |
| 515 | + </dl> |
| 516 | + |
| 517 | + <h4 id=cssom-cssvariable><span class=secno>4.2.3. </span> Interface |
| 518 | + CSSVariableComponentValue</h4> |
| 519 | + |
| 520 | + <p>The CSSVariableComponentValue interface represents a call to a CSS |
| 521 | + Variable. |
| 522 | + |
| 523 | + <dl> |
| 524 | + <dt>IDL Definition |
| 525 | + |
| 526 | + <dd> |
| 527 | + <pre class=idl> |
| 528 | +[NoInterfaceObject] interface CSSVariableComponentValue { |
| 529 | + attribute DOMString variableName; |
| 530 | + readonly attribute any variableValue; |
| 531 | +}</pre> |
| 532 | + |
| 533 | + <dt>Attributes |
| 534 | + |
| 535 | + <dd> |
| 536 | + <dl> |
| 537 | + <dt><code>variableName</code> of type <code>DOMString</code> |
| 538 | + |
| 539 | + <dd>This attribute is used for the name of the variable. Changing this |
| 540 | + attribute changes the variable being referred to. |
| 541 | + |
| 542 | + <dt><code>variableValue</code> of type <code>any</code>, readonly |
| 543 | + |
| 544 | + <dd>This attribute is used for the value of the variable. |
| 545 | + </dl> |
| 546 | + </dl> |
| 547 | + |
430 | 548 | <h2 id=grammar><span class=secno>5. </span> The Grammar of Variables</h2> |
431 | 549 |
|
432 | 550 | <p class=issue>I'm not sure if I've done this section correctly. For now, |
@@ -668,10 +786,19 @@ <h3 class=no-num id=normative-references>Normative references</h3> |
668 | 786 | <dt id=CSS21>[CSS21] |
669 | 787 |
|
670 | 788 | <dd>Bert Bos; et al. <a |
671 | | - href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style |
| 789 | + href="http://www.w3.org/TR/2011/REC-CSS2-20110607/"><cite>Cascading Style |
672 | 790 | Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June |
673 | 791 | 2011. W3C Recommendation. URL: <a |
674 | | - href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a> |
| 792 | + href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a> |
| 793 | + </dd> |
| 794 | + <!----> |
| 795 | + |
| 796 | + <dt id=CSSOM>[CSSOM] |
| 797 | + |
| 798 | + <dd>Anne van Kesteren. <a |
| 799 | + href="http://www.w3.org/TR/2011/WD-cssom-20110712/"><cite>CSSOM.</cite></a> |
| 800 | + 12 July 2011. W3C Working Draft. (Work in progress.) URL: <a |
| 801 | + href="http://www.w3.org/TR/2011/WD-cssom-20110712/">http://www.w3.org/TR/2011/WD-cssom-20110712/</a> |
675 | 802 | </dd> |
676 | 803 | <!----> |
677 | 804 |
|
@@ -707,9 +834,9 @@ <h3 class=no-num id=other-references>Other references</h3> |
707 | 834 | <dt id=CSS3COLOR>[CSS3COLOR] |
708 | 835 |
|
709 | 836 | <dd>Tantek Çelik; Chris Lilley; L. David Baron. <a |
710 | | - href="http://www.w3.org/TR/2011/REC-css3-color-20110607"><cite>CSS Color |
| 837 | + href="http://www.w3.org/TR/2011/REC-css3-color-20110607/"><cite>CSS Color |
711 | 838 | Module Level 3.</cite></a> 7 June 2011. W3C Recommendation. URL: <a |
712 | | - href="http://www.w3.org/TR/2011/REC-css3-color-20110607">http://www.w3.org/TR/2011/REC-css3-color-20110607</a> |
| 839 | + href="http://www.w3.org/TR/2011/REC-css3-color-20110607/">http://www.w3.org/TR/2011/REC-css3-color-20110607/</a> |
713 | 840 | </dd> |
714 | 841 | <!----> |
715 | 842 | </dl> |
@@ -746,6 +873,9 @@ <h2 class=no-num id=index>Index</h2> |
746 | 873 | <li>as conformance class, <a href="#style-sheet" title="style sheet, as |
747 | 874 | conformance class"><strong>6.2.</strong></a> |
748 | 875 | </ul> |
| 876 | + |
| 877 | + <li><a href="#variablerule"><code>VARIABLE_RULE</code></a>, <a |
| 878 | + href="#variablerule" title="VARIABLE_RULE"><strong>4.2.1.</strong></a> |
749 | 879 | </ul> |
750 | 880 | <!--end-index--> |
751 | 881 |
|
|
0 commit comments