@@ -143,44 +143,28 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
143143
144144 < li > < a href ="#cssom "> < span class =secno > 4. </ span > APIs</ a >
145145 < ul class =toc >
146- < li > < a href ="#cssom-simple "> < span class =secno > 4.1. </ span > The Simple
147- API</ a >
148-
149- < li > < a href ="#cssom-stylesheet "> < span class =secno > 4.2. </ span > Additions
150- to the Stylesheet Interface</ a >
151- < ul class =toc >
152- < li > < a href ="#cssom-cssrule "> < span class =secno > 4.2.1. </ span > Changes
153- to interface CSSRule</ a >
154-
155- < li > < a href ="#cssom-cssvariablerule "> < span class =secno > 4.2.2. </ span >
156- Interface CSSVariableRule</ a >
157-
158- < li > < a href ="#cssom-cssvariable "> < span class =secno > 4.2.3. </ span >
159- Interface CSSVariableComponentValue</ a >
160- </ ul >
146+ < li > < a href ="#cssom-cssvariable "> < span class =secno > 4.1. </ span >
147+ Interface CSSVariableComponentValue</ a >
161148 </ ul >
162149
163- < li > < a href ="#grammar "> < span class =secno > 5. </ span > The Grammar of
164- Variables</ a >
165-
166- < li > < a href ="#conformance "> < span class =secno > 6. </ span > Conformance</ a >
150+ < li > < a href ="#conformance "> < span class =secno > 5. </ span > Conformance</ a >
167151 < ul class =toc >
168- < li > < a href ="#conventions "> < span class =secno > 6 .1. </ span > Document
152+ < li > < a href ="#conventions "> < span class =secno > 5 .1. </ span > Document
169153 Conventions</ a >
170154
171- < li > < a href ="#conformance-classes "> < span class =secno > 6 .2. </ span >
155+ < li > < a href ="#conformance-classes "> < span class =secno > 5 .2. </ span >
172156 Conformance Classes</ a >
173157
174- < li > < a href ="#partial "> < span class =secno > 6 .3. </ span > Partial
158+ < li > < a href ="#partial "> < span class =secno > 5 .3. </ span > Partial
175159 Implementations</ a >
176160
177- < li > < a href ="#experimental "> < span class =secno > 6 .4. </ span > Experimental
161+ < li > < a href ="#experimental "> < span class =secno > 5 .4. </ span > Experimental
178162 Implementations</ a >
179163
180- < li > < a href ="#testing "> < span class =secno > 6 .5. </ span > Non-Experimental
164+ < li > < a href ="#testing "> < span class =secno > 5 .5. </ span > Non-Experimental
181165 Implementations</ a >
182166
183- < li > < a href ="#cr-exit-criteria "> < span class =secno > 6 .6. </ span > CR Exit
167+ < li > < a href ="#cr-exit-criteria "> < span class =secno > 5 .6. </ span > CR Exit
184168 Criteria</ a >
185169 </ ul >
186170
@@ -556,122 +540,19 @@ <h3 id=using-invalid-variables><span class=secno>3.1. </span> Using Invalid
556540
557541 < h2 id =cssom > < span class =secno > 4. </ span > APIs</ h2 >
558542
559- < p > CSS Variables are mutable - one can change them after they've been
560- defined, through the CSSOM. This can be done in two ways: one can read the
561- current variable definition and set an override definition through the
562- convenient < code > .vars</ code > property, or manipulate the definitions in
563- the stylesheets directly through the standard CSSOM stylesheet interface.
564-
565- < h3 id =cssom-simple > < span class =secno > 4.1. </ span > The Simple API</ h3 >
566-
567- < p class =issue > Not exactly sure how to define this, but I want to put a
568- ‘< code class =property > css</ code > ’ property on
569- < code > document</ code > (and hopefully < code > window</ code > ) as a hook for
570- this and other future CSS apis. < code > document.css</ code > would then
571- expose a ‘< code class =property > vars</ code > ’ property that
572- implements CSSOverrideVariablesMap. Variables are document-global, so they
573- need to be exposed at the document level, not the stylesheet level.
574-
575- < p class =issue > Do I need to define the concept of the override stylesheet?
576- Several browsers already expose this concept of a script-only stylesheet
577- that overrides all other stylesheets.
578-
579- < p > The CSSOverrideVariablesMap presents a simple interface to the variables
580- in the override stylesheet, which take precedence over variables defined
581- elsewhere in the document. As a convenience, it also allows reading normal
582- variables defined elsewhere in the document, as long as there is no
583- variable with the same name in the override stylesheet.
584-
585- < pre class =idl >
586- [NoInterfaceObject] CSSOverrideVariablesMap {
587- getter any (DOMString variableName);
588- setter void (DOMString variableName, any variableValue);
589- creator void (DOMString variableName, any variableValue);
590- deleter void (DOMString variableName);
591- }</ pre >
592-
593- < p > On getting, if a variable named < var > variableName</ var > exists in the
594- override stylesheet, return its value. Otherwise, if a variable named
595- < var > variableName</ var > is defined in the document, return its value.
596- Otherwise, return null.
597-
598- < p > On setting, find the variable named < var > variableName</ var > in the
599- override stylesheet and set its value to < var > variableValue</ var > .
600-
601- < p > On creating, append a new variable rule to the override stylesheet, with
602- the variable name set to < var > variableName</ var > and the value set to
603- < var > variableValue</ var > .
604-
605- < p > On deleting, remove the variable with the name < var > variableName</ var >
606- from the override stylesheet.
607-
608- < h3 id =cssom-stylesheet > < span class =secno > 4.2. </ span > Additions to the
609- Stylesheet Interface</ h3 >
610-
611- < p > This specification extends the IDL definitions in the CSSOM spec < a
612- href ="#CSSOM " rel =biblioentry > [CSSOM]<!--{{!CSSOM}}--> </ a > in several
613- ways.
614-
615- < h4 id =cssom-cssrule > < span class =secno > 4.2.1. </ span > Changes to interface
616- CSSRule</ h4 >
617-
618- < dl >
619- < dt > IDL Definition
620-
621- < dd >
622- < pre class =idl >
623- interface CSSRule {
624-
625- // RuleType
626- const unsigned short UNKNOWN_RULE = 0;
627- const unsigned short STYLE_RULE = 1;
628- const unsigned short CHARSET_RULE = 2;
629- const unsigned short IMPORT_RULE = 3;
630- const unsigned short MEDIA_RULE = 4;
631- const unsigned short FONT_FACE_RULE = 5;
632- const unsigned short PAGE_RULE
7D67
= 6;
633- < ins > const unsigned short < a
634- href ="#variablerule "> < code > VARIABLE_RULE</ code > </ a > = 11;</ ins >
635- readonly attribute unsigned short type;
636- attribute DOMString cssText;
637- // raises(DOMException) on setting
638- readonly attribute CSSStyleSheet parentStyleSheet;
639- readonly attribute CSSRule parentRule;
640- };</ pre >
641-
642- < dt > Defined Constants
643-
644- < dd > < dfn id =variablerule > < code > VARIABLE_RULE</ code > </ dfn > : The rule is a
645- < code > CSSVariableRule</ code > .
646- </ dl >
647-
648- < p class =issue > Going with value 11 for now, since CSSOM seems to reserve
649- 0-10.
650-
651- < h4 id =cssom-cssvariablerule > < span class =secno > 4.2.2. </ span > Interface
652- CSSVariableRule</ h4 >
653-
654- < p > The < code > CSSVariableRule</ code > interface represents a ‘< code
655- class =css > @var</ code > ’ rule within a CSS stylesheet. The
656- ‘< code class =css > @var</ code > ’ rule is used to define
657- variables.
543+ < p > < a href ="#data-property "> < i > Data properties</ i > </ a > are ordinary
544+ properties, and can be read or modified using all of the existing CSSOM
545+ APIs for reading or modifying properties.
658546
659- < dl >
660- < dt > IDL Definition
547+ < p > The specification extends the IDL definitions in the CSSOM spec to
548+ represent the use of the ‘< code class =css > data()</ code > ’
549+ function.
661550
662- < dd >
663- < pre class =idl >
664- interface CSSVariableRule : CSSRule {
665- attribute DOMString name;
666- attribute DOMString value;
667- }</ pre >
668- </ dl >
551+ < h3 id =cssom-cssvariable > < span class =secno > 4.1. </ span > Interface
552+ CSSVariableComponentValue</ h3 >
669553
670- < h4 id =cssom-cssvariable > < span class =secno > 4.2.3. </ span > Interface
671- CSSVariableComponentValue</ h4 >
672-
673- < p > The CSSVariableComponentValue interface represents a call to a CSS
674- Variable.
554+ < p > The CSSVariableComponentValue interface represents a use of the
555+ ‘< code class =css > data()</ code > ’ function.
675556
676557 < dl >
677558 < dt > IDL Definition
@@ -689,66 +570,21 @@ <h4 id=cssom-cssvariable><span class=secno>4.2.3. </span> Interface
689570 < dl >
690571 < dt > < code > variableName</ code > of type < code > DOMString</ code >
691572
692- < dd > This attribute is used for the name of the variable. Changing this
693- attribute changes the variable being referred to.
573+ < dd > This attribute represents the argument to the function. Changing
574+ this attribute changes the < a href ="#data-property "> < i > data
575+ property</ i > </ a > being referred to.
694576
695577 < dt > < code > variableValue</ code > of type < code > any</ code > , readonly
696578
697- < dd > This attribute is used for the value of the variable.
579+ < dd > This attribute represents the value of the < a
580+ href ="#data-property "> < i > data property</ i > </ a > the function is
581+ referencing.
698582 </ dl >
699583 </ dl >
700584
701- < h2 id =grammar > < span class =secno > 5. </ span > The Grammar of Variables</ h2 >
702-
703- < p class =issue > I'm not sure if I've done this section correctly. For now,
704- I'll try my best to copypasta what Conditionals is doing, since dbaron
705- usually know what's what.
706-
707- < p > This specification extends the lexical scanner in the < a
708- href ="http://www.w3.org/TR/CSS21/grammar.html "> Grammar of CSS 2.1</ a > (< a
709- href ="#CSS21 " rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a > , Appendix G) by
710- adding:
711-
712- < pre >
713- @{V}{A}{R} {return VARIABLE_SYM;}
714- "$"name {return VARIABLE;}</ pre >
715-
716- < p > and the grammar by adding:
585+ < h2 id =conformance > < span class =secno > 5. </ span > Conformance</ h2 >
717586
718- < pre >
719- variable_rule
720- : VARIABLE_SYM S+ variable_name S+ expr ':';
721- ;</ pre >
722-
723- < p > and by amending:
724-
725- < pre >
726- stylesheet
727- : [ CHARSET_SYM STRING ';' ]?
728- [S|CDO|CDC]* [ import [ CDO S* | CDC S* ]* ]*
729- [ [ ruleset | media | page < ins > | variable_rule</ ins > ] [ CDO S* | CDC S* ]* ]*
730- ;
731- nested_statement
732- : ruleset | media | page | font_face_rule | keyframes-rule |
733- supports_rule | document_rule < ins > | variable_rule</ ins >
734- ;
735- term
736- : unary_operator?
737- [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
738- TIME S* | FREQ S* ]
739- | STRING S* | IDENT S* | URI S* | hexcolor | function < ins > | VARIABLE S*</ ins >
740- ;</ pre >
741-
742- < p class =issue > This uses the ‘< code
743- class =css > nested_statement</ code > ’ production from Conditionals.
744- That should make its way to a proper draft, like a new release of Syntax.
745-
746- < p class =issue > Should variables be usable elsewhere, like in the value of a
747- MQ?
748-
749- < h2 id =conformance > < span class =secno > 6. </ span > Conformance</ h2 >
750-
751- < h3 id =conventions > < span class =secno > 6.1. </ span > Document Conventions</ h3 >
587+ < h3 id =conventions > < span class =secno > 5.1. </ span > Document Conventions</ h3 >
752588
753589 < p > Conformance requirements are expressed with a combination of descriptive
754590 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
@@ -775,7 +611,7 @@ <h3 id=conventions><span class=secno>6.1. </span> Document Conventions</h3>
775611
776612 < p class =note > Note, this is an informative note.
777613
778- < h3 id =conformance-classes > < span class =secno > 6 .2. </ span > Conformance
614+ < h3 id =conformance-classes > < span class =secno > 5 .2. </ span > Conformance
779615 Classes</ h3 >
780616
781617 < p > Conformance to CSS Variables Module is defined for three conformance
@@ -819,7 +655,7 @@ <h3 id=conformance-classes><span class=secno>6.2. </span> Conformance
819655 meet all other conformance requirements of style sheets as described in
820656 this module.
821657
822- < h3 id =partial > < span class =secno > 6 .3. </ span > Partial Implementations</ h3 >
658+ < h3 id =partial > < span class =secno > 5 .3. </ span > Partial Implementations</ h3 >
823659
824660 < p > So that authors can exploit the forward-compatible parsing rules to
825661 assign fallback values, CSS renderers < strong > must</ strong > treat as
@@ -833,7 +669,7 @@ <h3 id=partial><span class=secno>6.3. </span> Partial Implementations</h3>
833669 unsupported values must be), CSS requires that the entire declaration be
834670 ignored.
835671
836- < h3 id =experimental > < span class =secno > 6 .4. </ span > Experimental
672+ < h3 id =experimental > < span class =secno > 5 .4. </ span > Experimental
837673 Implementations</ h3 >
838674
839675 < p > To avoid clashes with future CSS features, the CSS2.1 specification
@@ -847,7 +683,7 @@ <h3 id=experimental><span class=secno>6.4. </span> Experimental
847683 vendor-prefixed syntax for such features, including those in W3C Working
848684 Drafts. This avoids incompatibilities with future changes in the draft.
849685
850- < h3 id =testing > < span class =secno > 6 .5. </ span > Non-Experimental
686+ < h3 id =testing > < span class =secno > 5 .5. </ span > Non-Experimental
851687 Implementations</ h3 >
852688
853689 < p > Once a specification reaches the Candidate Recommendation stage,
@@ -869,7 +705,7 @@ <h3 id=testing><span class=secno>6.5. </span>Non-Experimental
869705 href ="http://lists.w3.org/Archives/Public/public-css-testsuite "> public-css-testsuite@w3.org</ a >
870706 mailing list.
871707
872- < h3 id =cr-exit-criteria > < span class =secno > 6 .6. </ span > CR Exit Criteria</ h3 >
708+ < h3 id =cr-exit-criteria > < span class =secno > 5 .6. </ span > CR Exit Criteria</ h3 >
873709
874710 < p class =issue > [Change or remove the following CR exit criteria if the spec
875711 is not a module, but, e.g., a Note or a profile. This text was < a
@@ -948,15 +784,6 @@ <h3 class=no-num id=normative-references>Normative references</h3>
948784 </ dd >
949785 <!---->
950786
951- < dt id =CSSOM > [CSSOM]
952-
953- < dd > Anne van Kesteren. < a
954- href ="http://www.w3.org/TR/2011/WD-cssom-20110712/ "> < cite > CSSOM.</ cite > </ a >
955- 12 July 2011. W3C Working Draft. (Work in progress.) URL: < a
956- href ="http://www.w3.org/TR/2011/WD-cssom-20110712/ "> http://www.w3.org/TR/2011/WD-cssom-20110712/</ a >
957- </ dd >
958- <!---->
959-
960787 < dt id =RFC2119 > [RFC2119]
961788
962789 < dd > S. Bradner. < a href ="http://www.ietf.org/rfc/rfc2119.txt "> < cite > Key
@@ -1002,7 +829,7 @@ <h2 class=no-num id=index>Index</h2>
1002829
1003830 < ul class =indexlist >
1004831 < li > authoring tool, < a href ="#authoring-tool "
1005- title ="authoring tool "> < strong > 6 .2.</ strong > </ a >
832+ title ="authoring tool "> < strong > 5 .2.</ strong > </ a >
1006833
1007834 < li > data properties, < a href ="#data-property "
1008835 title ="data properties "> < strong > 2.</ strong > </ a >
@@ -1020,21 +847,18 @@ <h2 class=no-num id=index>Index</h2>
1020847 < li > invalid variables, < a href ="#invalid-variable "
1021848 title ="invalid variables "> < strong > 3.1.</ strong > </ a >
1022849
1023- < li > renderer, < a href ="#renderer " title =renderer > < strong > 6 .2.</ strong > </ a >
850+ < li > renderer, < a href ="#renderer " title =renderer > < strong > 5 .2.</ strong > </ a >
1024851
1025852
1026853 < li > style sheet
1027854 < ul >
1028855 < li > as conformance class, < a href ="#style-sheet "
1029- title ="style sheet, as conformance class "> < strong > 6 .2.</ strong > </ a >
856+ title ="style sheet, as conformance class "> < strong > 5 .2.</ strong > </ a >
1030857 </ ul >
1031858
1032859 < li > variable, < a href ="#type-variable "
1033860 title =variable > < strong > 3.</ strong > </ a >
1034861
1035- < li > < a href ="#variablerule "> < code > VARIABLE_RULE</ code > </ a > , < a
1036- href ="#variablerule " title ="VARIABLE_RULE "> < strong > 4.2.1.</ strong > </ a >
1037-
1038862 < li > variables, < a href ="#type-variable "
1039863 title =variables > < strong > 3.</ strong > </ a >
1040864 </ ul >
0 commit comments