Skip to content

Commit c7e48fb

Browse files
committed
Clean up @supports definition and define support better.
1 parent ee09174 commit c7e48fb

2 files changed

Lines changed: 113 additions & 35 deletions

File tree

css3-conditional/Overview.html

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
<h1>CSS Conditional Rules Module Level 3</h1>
1919

20-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 13 June 2011</h2>
20+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 14 June 2011</h2>
2121

2222
<dl>
2323
<dt>This version:
2424

25-
<dd><a href="http://www.w3.org/TR/2011/ED-css3-conditional-20110613/">
26-
http://www.w3.org/TR/2011/ED-css3-conditional-20110613</a>
25+
<dd><a href="http://www.w3.org/TR/2011/ED-css3-conditional-20110614/">
26+
http://www.w3.org/TR/2011/ED-css3-conditional-20110614</a>
2727

2828
<dt>Latest version:
2929

@@ -178,6 +178,13 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
178178

179179
<li><a href="#at-supports"><span class=secno>6. </span>Feature queries:
180180
the &lsquo;<code class=css>@supports</code>&rsquo; rule</a>
181+
<ul class=toc>
182+
<li><a href="#support-definition"><span class=secno>6.1.
183+
</span>Definition of support</a>
184+
185+
<li><a href="#partial-implementations"><span class=secno>6.2.
186+
</span>Partial implementations</a>
187+
</ul>
181188

182189
<li><a href="#at-document"><span class=secno>7. </span>Document queries:
183190
the &lsquo;<code class=css>@document</code>&rsquo; rule</a>
@@ -562,45 +569,46 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
562569
: '(' S* declaration ')' S*
563570
;</pre>
564571

565-
<p>The rules for evaluating the condition in each of the above grammar
566-
terms are:
572+
<p>Each of these grammar terms is associated with a boolean result, as
573+
follows:
567574

568575
<dl>
569576
<dt>supports_condition
570577

571-
<dd> evaluate the single child term
578+
<dd> The result is the result of the single child term.
572579

573580
<dt>supports_negation
574581

575-
<dd> negate the result of evaluating the single child term
582+
<dd> The result is the <em>negation</em> of the result of the
583+
<code>supports_condition_in_parens</code> child term.
576584

577585
<dt>supports_conjunction
578586

579-
<dd> true if all of the (non-&lsquo;<code class=css>and</code>&rsquo;)
580-
child terms are true, otherwise false
587+
<dd> The result is true if the result of <em>all</em> of the
588+
<code>supports_condition_in_parens</code> child terms is true; otherwise
589+
it is false.
581590

582591
<dt>supports_disjunction
583592

584-
<dd> true if any of the (non-&lsquo;<code class=css>or</code>&rsquo;)
585-
child terms are true, otherwise false
593+
<dd> The result is true if the result of <em>any</em> of the
594+
<code>supports_condition_in_parens</code> child terms is true; otherwise
595+
it is false.
586596

587597
<dt>supports_condition_in_parens
588598

589-
<dd> evaluate the single (non-&lsquo;<code class=css>(</code>&rsquo; and
590-
non-&lsquo;<code class=css>)</code>&rsquo;) child term
599+
<dd> The result is the result of the single
600+
<code>supports_condition</code> or
601+
<code>supports_declaration_condition</code> child term.
591602

592603
<dt>supports_declaration_condition
593604

594-
<dd> true if the user agent supports the declaration (which is the same as
595-
the rule for whether the user agent parses the declaration), otherwise
596-
false <span class=issue>Need more normative prose here; probably some in
597-
the snapshot which we (unfortunately) need to copy rather than
598-
cite.</span>
605+
<dd> The result is whether the CSS processor <a
606+
href="#support-definition">supports</a> the declaration.
599607
</dl>
600608

601-
<p>and the condition of the &lsquo;<code class=css>@supports</code>&rsquo;
602-
rule is the condition thus described for the <code>supports_rule</code>
603-
term.
609+
<p>The condition of the &lsquo;<code class=css>@supports</code>&rsquo; rule
610+
is the result of the <code>supports_condition</code> term that is a child
611+
of the <code>supports_rule</code> term.
604612

605613
<div class=example>
606614
<p>For example, the following rule</p>
@@ -691,6 +699,41 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
691699
}</pre>
692700
</div>
693701

702+
<h3 id=support-definition><span class=secno>6.1. </span>Definition of
703+
support</h3>
704+
705+
<p>A CSS processor is considered to <dfn id=dfn-support>support</dfn> a
706+
declaration (consisting of a property and value) if it implements the
707+
given value of the given property.
708+
709+
<h3 id=partial-implementations><span class=secno>6.2. </span>Partial
710+
implementations</h3>
711+
712+
<p>For forward-compatibility, <a
713+
href="http://www.w3.org/TR/CSS21/syndata.html#declaration">section 4.1.8
714+
(Declarations and properties)</a> of <a href="#CSS21"
715+
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> defines rules for handling
716+
invalid properties and values. CSS processors that partially implement a
717+
specification <strong>must</strong> treat any part of a value that they:
718+
719+
<ul>
720+
<li>do not implement, or
721+
722+
<li>do not have a usable level of support for,
723+
</ul>
724+
725+
<p>as invalid according to this rule, and <strong>must not</strong> accept
726+
or support a declaration containing such a value. This allows authors to
727+
use fallback (either in the <a href="#CSS1"
728+
rel=biblioentry>[CSS1]<!--{{CSS1}}--></a> sense of declarations that are
729+
overridden by later declarations or with the new capabilities provided by
730+
the &lsquo;<code class=css>@supports</code>&rsquo; rule in this
731+
specification) that works correctly for the features implemented. This
732+
applies especially to compound values; implementations must implement all
733+
parts of the value in order to consider the declaration supported, either
734+
inside a ruleset or in the declaration condition of an &lsquo;<code
735+
class=css>@supports</code>&rsquo; rule.
736+
694737
<h2 id=at-document><span class=secno>7. </span>Document queries: the
695738
&lsquo;<code class=css>@document</code>&rsquo; rule</h2>
696739

@@ -1174,6 +1217,9 @@ <h2 class=no-num id=index>Index</h2>
11741217
<li>regexp(), <a href="#url-regexp"
11751218
title="regexp()"><strong>7.</strong></a>
11761219

1220+
<li>support, <a href="#dfn-support"
1221+
title=support><strong>6.1.</strong></a>
1222+
11771223
<li>&lsquo;<code class=css>@supports</code>&rsquo; rule, <a
11781224
href="#supports-rule" title="'@supports' rule"><strong>6.</strong></a>
11791225

css3-conditional/Overview.src.html

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -388,46 +388,50 @@ <h2 id="at-supports">Feature queries: the '@supports' rule</h2>
388388
: '(' S* declaration ')' S*
389389
;</pre>
390390

391-
<p>The rules for evaluating the condition in each of the above grammar
392-
terms are:</p>
391+
<p>Each of these grammar terms is associated with a boolean result, as
392+
follows:</p>
393393
<dl>
394394
<dt>supports_condition</dt>
395395
<dd>
396-
evaluate the single child term
396+
The result is the result of the single child term.
397397
</dd>
398398

399399
<dt>supports_negation</dt>
400400
<dd>
401-
negate the result of evaluating the single child term
401+
The result is the <em>negation</em> of the result of the
402+
<code>supports_condition_in_parens</code> child term.
402403
</dd>
403404

404405
<dt>supports_conjunction</dt>
405406
<dd>
406-
true if all of the (non-''and'') child terms are true, otherwise false
407+
The result is true if the result of <em>all</em> of the
408+
<code>supports_condition_in_parens</code> child terms is true;
409+
otherwise it is false.
407410
</dd>
408411

409412
<dt>supports_disjunction</dt>
410413
<dd>
411-
true if any of the (non-''or'') child terms are true, otherwise false
414+
The result is true if the result of <em>any</em> of the
415+
<code>supports_condition_in_parens</code> child terms is true;
416+
otherwise it is false.
412417
</dd>
413418

414419
<dt>supports_condition_in_parens</dt>
415420
<dd>
416-
evaluate the single (non-''('' and non-'')'') child term
421+
The result is the result of the single <code>supports_condition</code>
422+
or <code>supports_declaration_condition</code> child term.
417423
</dd>
418424

419425
<dt>supports_declaration_condition</dt>
420426
<dd>
421-
true if the user agent supports the declaration (which is the same
422-
as the rule for whether the user agent parses the declaration),
423-
otherwise false
424-
<span class="issue">Need more normative prose here; probably some in the
425-
snapshot which we (unfortunately) need to copy rather than cite.</span>
427+
The result is whether the CSS processor <a
428+
href="#support-definition">supports</a> the declaration.
426429
</dd>
427430
</dl>
428431

429-
<p>and the condition of the '@supports' rule is the
430-
condition thus described for the <code>supports_rule</code> term.</p>
432+
<p>The condition of the '@supports' rule is the result of the
433+
<code>supports_condition</code> term that is a child of the
434+
<code>supports_rule</code> term.</p>
431435

432436
<div class="example">
433437
<p>For example, the following rule</p>
@@ -499,6 +503,34 @@ <h2 id="at-supports">Feature queries: the '@supports' rule</h2>
499503
}</pre>
500504
</div>
501505

506+
<h3 id="support-definition">Definition of support</h3>
507+
508+
<p>A CSS processor is considered to <dfn id="dfn-support">support</dfn>
509+
a declaration (consisting of a property and value) if it implements the
510+
given value of the given property.</p>
511+
512+
<h3 id="partial-implementations">Partial implementations</h3>
513+
514+
<p>For forward-compatibility, <a
515+
href="http://www.w3.org/TR/CSS21/syndata.html#declaration">section 4.1.8
516+
(Declarations and properties)</a> of [[!CSS21]] defines rules for
517+
handling invalid properties and values. CSS processors that partially
518+
implement a specification <strong>must</strong> treat any part of a
519+
value that they:</p>
520+
<ul>
521+
<li>do not implement, or</li>
522+
<li>do not have a usable level of support for,</li>
523+
</ul>
524+
<p>as invalid according to this rule, and <strong>must not</strong>
525+
accept or support a declaration containing such a value. This allows
526+
authors to use fallback (either in the [[CSS1]] sense of declarations
527+
that are overridden by later declarations or with the new capabilities
528+
provided by the ''@supports'' rule in this specification) that works
529+
correctly for the features implemented. This applies especially to
530+
compound values; implementations must implement all parts of the value
531+
in order to consider the declaration supported, either inside a ruleset
532+
or in the declaration condition of an ''@supports'' rule.</p>
533+
502534
<h2 id="at-document">Document queries: the '@document' rule</h2>
503535

504536
<p>The <dfn>'@document' rule</dfn> is a conditional group

0 commit comments

Comments
 (0)