Skip to content

Commit 0e1fbab

Browse files
committed
Define parsing of @supports better to address Björn's comment in http://lists.w3.org/Archives/Public/www-style/2011Apr/0439.html
1 parent 5042398 commit 0e1fbab

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

css3-conditional/Overview.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,33 @@ <h2 id=at-supports><span class=secno>6. </span>Feature queries: the
569569
;
570570

571571
supports_declaration_condition
572-
: '(' S* declaration ')' S*
572+
: '(' S* core_declaration ')' S*
573573
;</pre>
574574

575+
<p>in which <code>core_declaration</code> is the production
576+
<code>declaration</code> in the core syntax of CSS defined in <a
577+
href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">section 4.1.1
578+
(Tokenization)</a> of <a href="#CSS21"
579+
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
580+
581+
<p>Any &lsquo;<code class=css>@supports</code>&rsquo; rule that does not
582+
parse according to the grammar above is invalid. Style sheets <strong>must
583+
not</strong> use such a rule and processors <strong>must</strong> ignore
584+
such a rule.
585+
586+
<p class=note>Note that this means that declarations that meet the
587+
forward-compatible syntax for declarations are permitted (and support for
588+
them is then tested by the &lsquo;<code class=css>@supports</code>&rsquo;
589+
rule), but declarations that do not meet the forward-compatible syntax for
590+
declarations cause the entire &lsquo;<code
591+
class=css>@supports</code>&rsquo; rule to be ignored.
592+
593+
<p class=issue>Is any further allowance for forward-compatible parsing
594+
needed, for example, to allow additional features (such as, say, selector
595+
tests) to be added to the &lsquo;<code class=css>@supports</code>&rsquo;
596+
rule? Or are these forward-compatible parsing rules the best solution for
597+
such future expansion anyway?
598+
575599
<p>Each of these grammar terms is associated with a boolean result, as
576600
follows:
577601

css3-conditional/Overview.src.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,28 @@ <h2 id="at-supports">Feature queries: the '@supports' rule</h2>
385385
;
386386

387387
supports_declaration_condition
388-
: '(' S* declaration ')' S*
388+
: '(' S* core_declaration ')' S*
389389
;</pre>
390+
<p>in which <code>core_declaration</code> is the production
391+
<code>declaration</code> in the core syntax of CSS defined in <a
392+
href="http://www.w3.org/TR/CSS21/syndata.html#tokenization">section
393+
4.1.1 (Tokenization)</a> of [[!CSS21]].</p>
394+
395+
<p>Any ''@supports'' rule that does not parse according to the grammar
396+
above is invalid. Style sheets <strong>must not</strong> use such a
397+
rule and processors <strong>must</strong> ignore such a rule.</p>
398+
399+
<p class="note">Note that this means that declarations that meet the
400+
forward-compatible syntax for declarations are permitted (and support
401+
for them is then tested by the ''@supports'' rule), but declarations
402+
that do not meet the forward-compatible syntax for declarations cause
403+
the entire ''@supports'' rule to be ignored.</p>
404+
405+
<p class="issue">Is any further allowance for forward-compatible parsing
406+
needed, for example, to allow additional features (such as, say,
407+
selector tests) to be added to the ''@supports'' rule? Or are these
408+
forward-compatible parsing rules the best solution for such future
409+
expansion anyway?</p>
390410

391411
<p>Each of these grammar terms is associated with a boolean result, as
392412
follows:</p>

0 commit comments

Comments
 (0)