1717
1818 < h1 > CSS Conditional Rules Module Level 3</ h1 >
1919
20- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 17 July 2012</ h2 >
20+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 31 July 2012</ h2 >
2121
2222 < dl >
2323 < dt > This version:
2424
25- < dd > < a href ="http://www.w3.org/TR/2012/ED-css3-conditional-20120717 / ">
26- http://www.w3.org/TR/2012/ED-css3-conditional-20120717 /</ a >
25+ < dd > < a href ="http://www.w3.org/TR/2012/ED-css3-conditional-20120731 / ">
26+ http://www.w3.org/TR/2012/ED-css3-conditional-20120731 /</ a >
2727
2828 < dt > Latest version:
2929
@@ -201,6 +201,16 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
201201 the ‘< code class =css > @document</ code > ’ rule</ a >
202202
203203 < li > < a href ="#apis "> < span class =secno > 8. </ span > APIs</ a >
204+ < ul class =toc >
205+ < li > < a href ="#extentions-to-cssrule-interface "> < span class =secno > 8.1.
206+ </ span > Extensions to the < code > CSSRule</ code > interface</ a >
207+
208+ < li > < a href ="#the-csssupportsrule-interface "> < span class =secno > 8.2.
209+ </ span > The < code > CSSSupportsRule</ code > interface</ a >
210+
211+ < li > < a href ="#supports-property-api "> < span class =secno > 8.3.
212+ </ span > supportsProperty() function</ a >
213+ </ ul >
204214
205215 < li > < a href ="#conformance "> < span class =secno > 9. </ span > Conformance</ a >
206216 < ul class =toc >
@@ -428,8 +438,8 @@ <h2 id=contents-of><span class=secno>3. </span>Contents of conditional
428438 rel =biblioentry > [CSS3-FONTS]<!--{{!CSS3-FONTS}}--> </ a > ,
429439 < code > keyframes_rule</ code > defined in < a href ="#CSS3-ANIMATIONS "
430440 rel =biblioentry > [CSS3-ANIMATIONS]<!--{{!CSS3-ANIMATIONS}}--> </ a > , and
431- < code > media</ code > , < code > supports_rule</ code > and
432- < code > document_rule</ code > defined in this specification.
441+ < code > media</ code > , < a href =" #supportsrule " > < code > supports_rule</ code > </ a >
442+ and < code > document_rule</ code > defined in this specification.
433443
434444 < p > In general, future CSS specifications that add new @-rules that are not
435445 forbidden to occur after some other types of rules should modify this
@@ -549,32 +559,38 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the ‘<a
549559
550560 < p > and the grammar by adding
551561
552- < pre > supports_rule
562+ < pre > < dfn id = supportsrule > supports_rule</ dfn >
553563 : SUPPORTS_SYM S+ supports_condition group_rule_body
554564 ;
555565
556- supports_condition
566+ < dfn
567+ id =supportscondition > supports_condition</ dfn >
557568 : supports_negation | supports_conjunction | supports_disjunction |
558569 supports_condition_in_parens
559570 ;
560571
561- supports_condition_in_parens
572+ < dfn
573+ id =supportsconditioninparens > supports_condition_in_parens</ dfn >
562574 : ( '(' S* supports_condition ')' S* ) | supports_declaration_condition
563575 ;
564576
565- supports_negation
577+ < dfn
578+ id =supportsnegation > supports_negation</ dfn >
566579 : 'not' S* supports_condition_in_parens
567580 ;
568581
569- supports_conjunction
582+ < dfn
583+ id =supportsconjunction > supports_conjunction</ dfn >
570584 : supports_condition_in_parens ( 'and' S* supports_condition_in_parens )+
571585 ;
572586
573- supports_disjunction
587+ < dfn
588+ id =supportsdisjunction > supports_disjunction</ dfn >
574589 : supports_condition_in_parens ( 'or' S* supports_condition_in_parens )+
575590 ;
576591
577- supports_declaration_condition
592+ < dfn
593+ id =supportsdeclarationcondition > supports_declaration_condition</ dfn >
578594 : '(' S* core_declaration ')' S*
579595 ;</ pre >
580596
@@ -613,26 +629,28 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the ‘<a
613629
614630 < dt > supports_condition_in_parens
615631
616- < dd > The result is the result of the single
617- < code > supports_condition</ code > or
618- < code > supports_declaration_condition</ code > child term.
632+ < dd > The result is the result of the single < a
633+ href ="#supportscondition "> < code > supports_condition</ code > </ a > or < a
634+ href ="#supportsdeclarationcondition "> < code > supports_declaration_condition</ code > </ a >
635+ child term.
619636
620637 < dt > supports_negation
621638
622- < dd > The result is the < em > negation</ em > of the result of the
623- < code > supports_condition_in_parens</ code > child term.
639+ < dd > The result is the < em > negation</ em > of the result of the < a
640+ href ="#supportsconditioninparens "> < code > supports_condition_in_parens</ code > </ a >
641+ child term.
624642
625643 < dt > supports_conjunction
626644
627- < dd > The result is true if the result of < em > all</ em > of the
628- < code > supports_condition_in_parens</ code > child terms is true; otherwise
629- it is false.
645+ < dd > The result is true if the result of < em > all</ em > of the < a
646+ href =" #supportsconditioninparens " > < code > supports_condition_in_parens</ code > </ a >
647+ child terms is true; otherwise it is false.
630648
631649 < dt > supports_disjunction
632650
633- < dd > The result is true if the result of < em > any</ em > of the
634- < code > supports_condition_in_parens</ code > child terms is true; otherwise
635- it is false.
651+ < dd > The result is true if the result of < em > any</ em > of the < a
652+ href =" #supportsconditioninparens " > < code > supports_condition_in_parens</ code > </ a >
653+ child terms is true; otherwise it is false.
636654
637655 < dt > supports_declaration_condition
638656
@@ -641,9 +659,10 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the ‘<a
641659 </ dl >
642660
643661 < p > The condition of the ‘< a href ="#dfn-support "> < code
644- class =css > @supports</ code > </ a > ’ rule is the result of the
645- < code > supports_condition</ code > term that is a child of the
646- < code > supports_rule</ code > term.
662+ class =css > @supports</ code > </ a > ’ rule is the result of the < a
663+ href ="#supportscondition "> < code > supports_condition</ code > </ a > term that is
664+ a child of the < a href ="#supportsrule "> < code > supports_rule</ code > </ a >
665+ term.
647666
648667 < div class =example >
649668 < p > For example, the following rule</ p >
@@ -1025,15 +1044,89 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
10251044
10261045 < h2 id =apis > < span class =secno > 8. </ span > APIs</ h2 >
10271046
1028- < p class =issue > This specification needs to define the CSSOM interfaces for
1029- the new rule types. I've reserved new CSSRule constants on < a
1030- href ="http://wiki.csswg.org/spec/cssom-constants "> the wiki</ a > :
1031- SUPPORTS_RULE as 12 and DOCUMENT_RULE as 13.
1047+ < h3 id =extentions-to-cssrule-interface > < span class =secno > 8.1. </ span >
1048+ Extensions to the < code > CSSRule</ code > interface</ h3 >
1049+
1050+ < p > The < code > CSSRule</ code > interface is extended as follows:
1051+
1052+ < pre class =idl > partial interface CSSRule {
1053+ const unsigned short SUPPORTS_RULE = 12;
1054+ const unsigned short DOCUMENT_RULE = 13;
1055+ }</ pre >
1056+
1057+ < h3 id =the-csssupportsrule-interface > < span class =secno > 8.2. </ span > The
1058+ < code > CSSSupportsRule</ code > interface</ h3 >
1059+
1060+ < p > The < code > CSSSupportsRule</ code > interface represents a ‘< code
1061+ class =css > @media</ code > ’ rule.
1062+
1063+ < pre class =idl > interface CSSSupportsRule : CSSRule {
1064+ attribute DOMString supportsCondition;
1065+ readonly attribute CSSRuleList cssRules;
1066+ unsigned long insertRule (DOMString rule, unsigned long index);
1067+ void deleteRule (unsigned long index);
1068+ }</ pre >
1069+
1070+ < dl class =idl-attributes >
1071+ < dt > < a href ="#supportscondition "> < code > supportsCondition</ code > </ a > of
1072+ type < code > DOMString</ code > , readonly
1073+
1074+ < dd > The < ocde > supportsCondition attribute, on getting, must return the
1075+ result of serializing the associated support condition.
1076+ < p > On setting the < a
1077+ href ="#supportscondition "> < code > supportsCondition</ code > </ a > attribute
1078+ these steps must be run:
1079+
1080+ < ol >
1081+ < li > Trim the given value of white space.
1082+
1083+ < li > If the given value matches the grammar of the < a
1084+ href ="#supportscondition "> < code > supports_condition</ code > </ a >
1085+ production, replace the associated CSS support condition with the given
1086+ value.
1087+
1088+ < li > Otherwise, do nothing.
1089+ </ ol >
1090+
1091+ < p class =issue > This name sucks. Suggestions?
10321092
1033- < p class =issue > Should this specification also define APIs for querying
1034- @supports, like < code > matchMedium</ code > allows querying of media? See < a
1035- href ="http://lists.w3.org/Archives/Public/www-style/2011Oct/0323.html "> proposal
1036- on list</ a > , agreed in WG telecon 2011-10-12.
1093+ < dt > < code > cssRules</ code > of type < code > CSSRuleList</ code > , readonly
1094+
1095+ < dd > The < code > cssRules</ code > attribute must return a
1096+ < code > CSSRuleList</ code > object for the list of CSS rules specified with
1097+ the ‘< a href ="#dfn-support "> < code class =css > @supports</ code > </ a > ’
1098+ rule.
1099+ </ ocde >
1100+ </ dl >
1101+
1102+ < dl class =idl-methods >
1103+ < dt > < code > insertRule(DOMString rule, unsigned long index)</ code > , returns
1104+ < code > unsigned long</ code >
1105+
1106+ < dd > The < code > insertRule</ code > operation must insert a CSS rule
1107+ < var > rule</ var > into the CSS rule list returned by < code > cssRules</ code >
1108+ at < var > index</ var > .
1109+
1110+ < dt > < code > deleteRule (unsigned long index)</ code > , return
1111+ < code > void</ code >
1112+
1113+ < dd > The < code > deleteRule</ code > operation must remove a CSS rule from the
1114+ CSS rule list returned by < code > cssRules</ code > at < var > index</ var > .
1115+ </ dl >
1116+
1117+ < p class =issue > Define the CSSDocumentRule interface.
1118+
1119+ < h3 id =supports-property-api > < span class =secno > 8.3.
1120+ </ span > supportsProperty() function</ h3 >
1121+
1122+ < pre class =idl > partial interface Window {
1123+ boolean supportsProperty (DOMString property, DOMString value);
1124+ };</ pre >
1125+
1126+ < p > The < code > supportsProperty</ code > function must return < code > true</ code >
1127+ if the implementation < a href ="#dfn-support "> < i > supports</ i > </ a > the value
1128+ given by < var > value</ var > for the property given by < var > property</ var > ,
1129+ and < code > false</ code > otherwise.
10371130
10381131 < h2 id =conformance > < span class =secno > 9. </ span > Conformance</ h2 >
10391132
@@ -1385,10 +1478,32 @@ <h2 class=no-num id=index>Index</h2>
13851478 < li > support, < a href ="#dfn-support "
13861479 title =support > < strong > 6.1.</ strong > </ a >
13871480
1481+ < li > supports_condition, < a href ="#supportscondition "
1482+ title ="supports_condition "> < strong > 6.</ strong > </ a >
1483+
1484+ < li > supports_condition_in_parens, < a href ="#supportsconditioninparens "
1485+ title ="supports_condition_in_parens "> < strong > 6.</ strong > </ a >
1486+
1487+ < li > supports_conjunction, < a href ="#supportsconjunction "
1488+ title ="supports_conjunction "> < strong > 6.</ strong > </ a >
1489+
1490+ < li > supports_declaration_condition, < a
1491+ href ="#supportsdeclarationcondition "
1492+ title ="supports_declaration_condition "> < strong > 6.</ strong > </ a >
1493+
1494+ < li > supports_disjunction, < a href ="#supportsdisjunction "
1495+ title ="supports_disjunction "> < strong > 6.</ strong > </ a >
1496+
1497+ < li > supports_negation, < a href ="#supportsnegation "
1498+ title ="supports_negation "> < strong > 6.</ strong > </ a >
1499+
13881500 < li > ‘< a href ="#dfn-support "> < code class =css > @supports</ code > </ a > ’
13891501 rule, < a href ="#supports-rule "
13901502 title ="'@supports' rule "> < strong > 6.</ strong > </ a >
13911503
1504+ < li > supports_rule, < a href ="#supportsrule "
1505+ title ="supports_rule "> < strong > 6.</ strong > </ a >
1506+
13921507 < li > url(), < a href ="#url-exact " title ="url() "> < strong > 7.</ strong > </ a >
13931508
13941509 < li > URL matching functions, < a href ="#url-matching-functions "
0 commit comments