css3-conditional/Overview.src.html

changeset 6618
7aa15649c232
parent 6617
349a7ea1e24c
child 6619
3e2cd7f0e196
     1.1 --- a/css3-conditional/Overview.src.html	Fri Aug 31 11:57:12 2012 -0700
     1.2 +++ b/css3-conditional/Overview.src.html	Fri Aug 31 12:31:28 2012 -0700
     1.3 @@ -797,16 +797,13 @@
     1.4  }</pre>
     1.5  
     1.6  
     1.7 -<h3 id="the-csssupportsrule-interface">
     1.8 -The <code>CSSSupportsRule</code> interface</h3>
     1.9 +<h3 id="the-cssconditionrule-interface">
    1.10 +The <code>CSSConditionRule</code> interface</h3>
    1.11  
    1.12 -<p class="issue">Should there be an interface containing the methods
    1.13 -common to CSSMediaRule, CSSSupportsRule, and CSSDocumentRule, from which
    1.14 -they all derive?  Should it be called CSSGroupRule?  CSSConditionalRule?</p>
    1.15 +<p>The <dfn><code>CSSConditionRule</code></dfn> interface represents all the "conditional" rules,
    1.16 +  which consist of a condition and other rules nested inside of it.
    1.17  
    1.18 -<p>The <code>CSSSupportsRule</code> interface represents a ''@supports'' rule.</p>
    1.19 -
    1.20 -<pre class='idl'>interface CSSSupportsRule : CSSRule {
    1.21 +<pre class='idl'>interface CSSConditionRule : CSSRule {
    1.22      attribute DOMString conditionText;
    1.23      readonly attribute CSSRuleList cssRules;
    1.24      unsigned long insertRule (DOMString rule, unsigned long index);
    1.25 @@ -816,7 +813,7 @@
    1.26  <dl class='idl-attributes'>
    1.27    <dt><code>conditionText</code> of type <code>DOMString</code>, readonly
    1.28    <dd>The <code>conditionText</code> attribute, on getting, must return
    1.29 -    the result of serializing the associated support condition.
    1.30 +    the result of serializing the associated condition.
    1.31  
    1.32      <p>On setting the <code>conditionText</code> attribute these steps
    1.33        must be run:
    1.34 @@ -824,17 +821,14 @@
    1.35      <ol>
    1.36        <li>Trim the given value of white space.
    1.37        <li>If the given value matches the grammar of the 
    1.38 -        <code>supports_condition</code> production, replace the associated 
    1.39 -        CSS support condition with the given value.
    1.40 +        appropriate condition production for the given rule, 
    1.41 +        replace the associated CSS condition with the given value.
    1.42        <li>Otherwise, do nothing.
    1.43      </ol>
    1.44  
    1.45 -    <p class="issue">Should this be called <code>conditionText</code> or
    1.46 -    <code>supportsText</code>?</p>
    1.47 -
    1.48    <dt><code>cssRules</code> of type <code>CSSRuleList</code>, readonly
    1.49    <dd>The <code>cssRules</code> attribute must return a <code>CSSRuleList</code>
    1.50 -    object for the list of CSS rules specified with the ''@supports'' rule.
    1.51 +    object for the list of CSS rules nested inside the condition rule.
    1.52  </dl>
    1.53  
    1.54  <dl class='idl-methods'>
    1.55 @@ -848,7 +842,55 @@
    1.56      CSS rule list returned by <code>cssRules</code> at <var>index</var>.
    1.57  </dl>
    1.58  
    1.59 -<p class='issue'>Define the CSSDocumentRule interface.
    1.60 +
    1.61 +<h3 id="the-cssmediarule-interface">
    1.62 +The <code>CSSMediaRule</code> interface</h3>
    1.63 +
    1.64 +<p>The <dfn><code>CSSMediaRule</code></dfn> interface represents a ''@media'' rule:
    1.65 +
    1.66 +<pre class='idl'>interface CSSMediaRule : CSSConditionRule {
    1.67 +    readonly attribute MediaList media;
    1.68 +}</pre>
    1.69 +
    1.70 +<dl class='idl-attributes'>
    1.71 +  <dt><code>media</code> of type <code>MediaList</code>, readonly
    1.72 +  <dd>The <code>media</code> attribute must return a <code>MediaList</code> object
    1.73 +    for the list of media queries specified with the ''@media'' rule.
    1.74 +
    1.75 +  <dt><code>conditionText</code> of type <code>DOMString</code>, readonly
    1.76 +  <dd>The <code>conditionText</code> attribute (defined on the <code>CSSConditionRule</code> parent rule),
    1.77 +    on getting, must return the value of <code>media.mediaText</code> on the rule.
    1.78 +
    1.79 +    <p>On setting the <code>conditionText</code> attribute these steps must be run:
    1.80 +
    1.81 +    <ol>
    1.82 +      <li>Trim the given value of white space.
    1.83 +      <li>If the given value matches the grammar of the 
    1.84 +        appropriate condition production for the given rule, 
    1.85 +        replace the associated CSS condition with the given value.
    1.86 +        Also, construct a new <code>MediaList</code> object,
    1.87 +        passing the given value as the constructor's sole argument,
    1.88 +        and replace the rule's <code>media</code> attribute with it.
    1.89 +      <li>Otherwise, do nothing.
    1.90 +    </ol>
    1.91 +
    1.92 +
    1.93 +<h3 id="the-csssupportsrule-interface">
    1.94 +The <code>CSSSupportsRule</code> interface</h3>
    1.95 +
    1.96 +<p>The <dfn><code>CSSSupportsRule</code></dfn> interface represents a ''@supports'' rule.</p>
    1.97 +
    1.98 +<pre class='idl'>interface CSSSupportsRule : CSSRule {
    1.99 +}</pre>
   1.100 +
   1.101 +
   1.102 +<h3 id="the-cssdocumentrule-interface">
   1.103 +The <code>CSSDocumentRule</code> interface</h3>
   1.104 +
   1.105 +<p>The <dfn><code>CSSDocumentRule</code></dfn> interface represents a ''@document'' rule.</p>
   1.106 +
   1.107 +<pre class='idl'>interface CSSDocumentRule : CSSRule {
   1.108 +}</pre>
   1.109  
   1.110  
   1.111  <h3 id="window-api">supportsCSS() function</h3>

mercurial