1717
1818 < h1 > CSS Conditional Rules Module Level 3</ h1 >
1919
20- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 30 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-20120730 / ">
26- http://www.w3.org/TR/2012/ED-css3-conditional-20120730 /</ 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
@@ -200,6 +200,16 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
200200 the ‘< code class =css > @document</ code > ’ rule</ a >
201201
202202 < li > < a href ="#apis "> < span class =secno > 8. </ span > APIs</ a >
203+ < ul class =toc >
204+ < li > < a href ="#extentions-to-cssrule-interface "> < span class =secno > 8.1.
205+ </ span > Extensions to the < code > CSSRule</ code > interface</ a >
206+
207+ < li > < a href ="#the-csssupportsrule-interface "> < span class =secno > 8.2.
208+ </ span > The < code > CSSSupportsRule</ code > interface</ a >
209+
210+ < li > < a href ="#supports-property-api "> < span class =secno > 8.3.
211+ </ span > supportsProperty() function</ a >
212+ </ ul >
203213
204214 < li > < a href ="#conformance "> < span class =secno > 9. </ span > Conformance</ a >
205215 < ul class =toc >
@@ -427,8 +437,8 @@ <h2 id=contents-of><span class=secno>3. </span>Contents of conditional
427437 rel =biblioentry > [CSS3-FONTS]<!--{{!CSS3-FONTS}}--> </ a > ,
428438 < code > keyframes_rule</ code > defined in < a href ="#CSS3-ANIMATIONS "
429439 rel =biblioentry > [CSS3-ANIMATIONS]<!--{{!CSS3-ANIMATIONS}}--> </ a > , and
430- < code > media</ code > , < code > supports_rule</ code > and
431- < code > document_rule</ code > defined in this specification.
440+ < code > media</ code > , < a href =" #supportsrule " > < code > supports_rule</ code > </ a >
441+ and < code > document_rule</ code > defined in this specification.
432442
433443 < p > In general, future CSS specifications that add new @-rules that are not
434444 forbidden to occur after some other types of rules should modify this
@@ -548,32 +558,38 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the ‘<a
548558
549559 < p > and the grammar by adding
550560
551- < pre > supports_rule
561+ < pre > < dfn id = supportsrule > supports_rule</ dfn >
552562 : SUPPORTS_SYM S+ supports_condition group_rule_body
553563 ;
554564
555- supports_condition
565+ < dfn
566+ id =supportscondition > supports_condition</ dfn >
556567 : supports_negation | supports_conjunction | supports_disjunction |
557568 supports_condition_in_parens
558569 ;
559570
560- supports_condition_in_parens
571+ < dfn
572+ id =supportsconditioninparens > supports_condition_in_parens</ dfn >
561573 : ( '(' S* supports_condition ')' S* ) | supports_declaration_condition
562574 ;
563575
564- supports_negation
576+ < dfn
577+ id =supportsnegation > supports_negation</ dfn >
565578 : 'not' S* supports_condition_in_parens
566579 ;
567580
568- supports_conjunction
581+ < dfn
582+ id =supportsconjunction > supports_conjunction</ dfn >
569583 : supports_condition_in_parens ( 'and' S* supports_condition_in_parens )+
570584 ;
571585
572- supports_disjunction
586+ < dfn
587+ id =supportsdisjunction > supports_disjunction</ dfn >
573588 : supports_condition_in_parens ( 'or' S* supports_condition_in_parens )+
574589 ;
575590
576- supports_declaration_condition
591+ < dfn
592+ id =supportsdeclarationcondition > supports_declaration_condition</ dfn >
577593 : '(' S* core_declaration ')' S*
578594 ;</ pre >
579595
@@ -612,26 +628,28 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the ‘<a
612628
613629 < dt > supports_condition_in_parens
614630
615- < dd > The result is the result of the single
616- < code > supports_condition</ code > or
617- < code > supports_declaration_condition</ code > child term.
631+ < dd > The result is the result of the single < a
632+ href ="#supportscondition "> < code > supports_condition</ code > </ a > or < a
633+ href ="#supportsdeclarationcondition "> < code > supports_declaration_condition</ code > </ a >
634+ child term.
618635
619636 < dt > supports_negation
620637
621- < dd > The result is the < em > negation</ em > of the result of the
622- < code > supports_condition_in_parens</ code > child term.
638+ < dd > The result is the < em > negation</ em > of the result of the < a
639+ href ="#supportsconditioninparens "> < code > supports_condition_in_parens</ code > </ a >
640+ child term.
623641
624642 < dt > supports_conjunction
625643
626- < dd > The result is true if the result of < em > all</ em > of the
627- < code > supports_condition_in_parens</ code > child terms is true; otherwise
628- it is false.
644+ < dd > The result is true if the result of < em > all</ em > of the < a
645+ href =" #supportsconditioninparens " > < code > supports_condition_in_parens</ code > </ a >
646+ child terms is true; otherwise it is false.
629647
630648 < dt > supports_disjunction
631649
632- < dd > The result is true if the result of < em > any</ em > of the
633- < code > supports_condition_in_parens</ code > child terms is true; otherwise
634- it is false.
650+ < dd > The result is true if the result of < em > any</ em > of the < a
651+ href =" #supportsconditioninparens " > < code > supports_condition_in_parens</ code > </ a >
652+ child terms is true; otherwise it is false.
635653
636654 < dt > supports_declaration_condition
637655
@@ -640,9 +658,10 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the ‘<a
640658 </ dl >
641659
642660 < p > The condition of the ‘< a href ="#dfn-support "> < code
643- class =css > @supports</ code > </ a > ’ rule is the result of the
644- < code > supports_condition</ code > term that is a child of the
645- < code > supports_rule</ code > term.
661+ class =css > @supports</ code > </ a > ’ rule is the result of the < a
662+ href ="#supportscondition "> < code > supports_condition</ code > </ a > term that is
663+ a child of the < a href ="#supportsrule "> < code > supports_rule</ code > </ a >
664+ term.
646665
647666 < div class =example >
648667 < p > For example, the following rule</ p >
@@ -1026,15 +1045,89 @@ <h2 id=at-document><span class=secno>7. </span>Document queries: the
10261045
10271046 < h2 id =apis > < span class =secno > 8. </ span > APIs</ h2 >
10281047
1029- < p class =issue > This specification needs to define the CSSOM interfaces for
1030- the new rule types. I've reserved new CSSRule constants on < a
1031- href ="http://wiki.csswg.org/spec/cssom-constants "> the wiki</ a > :
1032- SUPPORTS_RULE as 12 and DOCUMENT_RULE as 13.
1048+ < h3 id =extentions-to-cssrule-interface > < span class =secno > 8.1. </ span >
1049+ Extensions to the < code > CSSRule</ code > interface</ h3 >
1050+
1051+ < p > The < code > CSSRule</ code > interface is extended as follows:
1052+
1053+ < pre class =idl > partial interface CSSRule {
1054+ const unsigned short SUPPORTS_RULE = 12;
1055+ const unsigned short DOCUMENT_RULE = 13;
1056+ }</ pre >
1057+
1058+ < h3 id =the-csssupportsrule-interface > < span class =secno > 8.2. </ span > The
1059+ < code > CSSSupportsRule</ code > interface</ h3 >
1060+
1061+ < p > The < code > CSSSupportsRule</ code > interface represents a ‘< code
1062+ class =css > @media</ code > ’ rule.
1063+
1064+ < pre class =idl > interface CSSSupportsRule : CSSRule {
1065+ attribute DOMString supportsCondition;
1066+ readonly attribute CSSRuleList cssRules;
1067+ unsigned long insertRule (DOMString rule, unsigned long index);
1068+ void deleteRule (unsigned long index);
1069+ }</ pre >
1070+
1071+ < dl class =idl-attributes >
1072+ < dt > < a href ="#supportscondition "> < code > supportsCondition</ code > </ a > of
1073+ type < code > DOMString</ code > , readonly
1074+
1075+ < dd > The < ocde > supportsCondition attribute, on getting, must return the
1076+ result of serializing the associated support condition.
1077+ < p > On setting the < a
1078+ href ="#supportscondition "> < code > supportsCondition</ code > </ a > attribute
1079+ these steps must be run:
1080+
1081+ < ol >
1082+ < li > Trim the given value of white space.
1083+
1084+ < li > If the given value matches the grammar of the < a
1085+ href ="#supportscondition "> < code > supports_condition</ code > </ a >
1086+ production, replace the associated CSS support condition with the given
1087+ value.
1088+
1089+ < li > Otherwise, do nothing.
1090+ </ ol >
1091+
1092+ < p class =issue > This name sucks. Suggestions?
10331093
1034- < p class =issue > Should this specification also define APIs for querying
1035- @supports, like < code > matchMedium</ code > allows querying of media? See < a
1036- href ="http://lists.w3.org/Archives/Public/www-style/2011Oct/0323.html "> proposal
1037- on list</ a > , agreed in WG telecon 2011-10-12.
1094+ < dt > < code > cssRules</ code > of type < code > CSSRuleList</ code > , readonly
1095+
1096+ < dd > The < code > cssRules</ code > attribute must return a
1097+ < code > CSSRuleList</ code > object for the list of CSS rules specified with
1098+ the ‘< a href ="#dfn-support "> < code class =css > @supports</ code > </ a > ’
1099+ rule.
1100+ </ ocde >
1101+ </ dl >
1102+
1103+ < dl class =idl-methods >
1104+ < dt > < code > insertRule(DOMString rule, unsigned long index)</ code > , returns
1105+ < code > unsigned long</ code >
1106+
1107+ < dd > The < code > insertRule</ code > operation must insert a CSS rule
1108+ < var > rule</ var > into the CSS rule list returned by < code > cssRules</ code >
1109+ at < var > index</ var > .
1110+
1111+ < dt > < code > deleteRule (unsigned long index)</ code > , return
1112+ < code > void</ code >
1113+
1114+ < dd > The < code > deleteRule</ code > operation must remove a CSS rule from the
1115+ CSS rule list returned by < code > cssRules</ code > at < var > index</ var > .
1116+ </ dl >
1117+
1118+ < p class =issue > Define the CSSDocumentRule interface.
1119+
1120+ < h3 id =supports-property-api > < span class =secno > 8.3.
1121+ </ span > supportsProperty() function</ h3 >
1122+
1123+ < pre class =idl > partial interface Window {
1124+ boolean supportsProperty (DOMString property, DOMString value);
1125+ };</ pre >
1126+
1127+ < p > The < code > supportsProperty</ code > function must return < code > true</ code >
1128+ if the implementation < a href ="#dfn-support "> < i > supports</ i > </ a > the value
1129+ given by < var > value</ var > for the property given by < var > property</ var > ,
1130+ and < code > false</ code > otherwise.
10381131
10391132 < h2 id =conformance > < span class =secno > 9. </ span > Conformance</ h2 >
10401133
@@ -1386,10 +1479,32 @@ <h2 class=no-num id=index>Index</h2>
13861479 < li > support, < a href ="#dfn-support "
13871480 title =support > < strong > 6.1.</ strong > </ a >
13881481
1482+ < li > supports_condition, < a href ="#supportscondition "
1483+ title ="supports_condition "> < strong > 6.</ strong > </ a >
1484+
1485+ < li > supports_condition_in_parens, < a href ="#supportsconditioninparens "
1486+ title ="supports_condition_in_parens "> < strong > 6.</ strong > </ a >
1487+
1488+ < li > supports_conjunction, < a href ="#supportsconjunction "
1489+ title ="supports_conjunction "> < strong > 6.</ strong > </ a >
1490+
1491+ < li > supports_declaration_condition, < a
1492+ href ="#supportsdeclarationcondition "
1493+ title ="supports_declaration_condition "> < strong > 6.</ strong > </ a >
1494+
1495+ < li > supports_disjunction, < a href ="#supportsdisjunction "
1496+ title ="supports_disjunction "> < strong > 6.</ strong > </ a >
1497+
1498+ < li > supports_negation, < a href ="#supportsnegation "
1499+ title ="supports_negation "> < strong > 6.</ strong > </ a >
1500+
13891501 < li > ‘< a href ="#dfn-support "> < code class =css > @supports</ code > </ a > ’
13901502 rule, < a href ="#supports-rule "
13911503 title ="'@supports' rule "> < strong > 6.</ strong > </ a >
13921504
1505+ < li > supports_rule, < a href ="#supportsrule "
1506+ title ="supports_rule "> < strong > 6.</ strong > </ a >
1507+
13931508 < li > url(), < a href ="#url-exact " title ="url() "> < strong > 7.</ strong > </ a >
13941509
13951510 < li > URL matching functions, < a href ="#url-matching-functions "
0 commit comments