Skip to content

Commit e68a914

Browse files
committed
[css-syntax] Not all qualifed rules contain declarations.
Similarly to at-rules, the block of qualified rules is now just a block, and is not parsed as a declarations list at the Syntax level. CSS already has qualified rules that are not style rules inside @Keyframes, even though they still contain declarations. With this change, a future CSS spec can use the qualified rule syntax without the declaration syntax, without having to change this spec. Parsers for existing qualified rules conceptually just need to call "Parse a list of declarations" on the rule’s block.
1 parent 558f9d3 commit e68a914

2 files changed

Lines changed: 16 additions & 21 deletions

File tree

css-syntax/Overview.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</a></p>
1414
<h1 class="p-name no-ref" id="title">CSS Syntax Module Level 3</h1>
1515
<h2 class="no-num no-toc no-ref" id="subtitle">Editor's Draft,
16-
<span class="dt-updated"><span class="value-title" title="20130626">26 June 2013</span></span></h2>
16+
<span class="dt-updated"><span class="value-title" title="20130627">27 June 2013</span></span></h2>
1717
<div data-fill-with="spec-metadata"><dl><dt>This version:</dt><dd><a href="http://dev.w3.org/csswg/css-syntax" class="u-url">http://dev.w3.org/csswg/css-syntax</a></dd><dt>Editor's Draft:</dt><dd><a href="http://dev.w3.org/csswg/css-syntax">http://dev.w3.org/csswg/css-syntax</a>
1818
</dd><dt>Feedback:</dt>
1919
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-syntax%5D%20feedback">www-style@w3.org</a>
@@ -1661,10 +1661,11 @@ <h4 id="set-the-unicode-ranges-range" data-level="4.3.15"><span class="secno">4.
16611661
</dt><dd>
16621662
A qualified rule has
16631663
a prelude consisting of a list of component values,
1664-
and a value consisting of a list of at-rules or declarations.
1664+
and a block consisting of a simple {} block.
16651665

16661666
<p class="note"> Note: Most qualified rules will be style rules,
1667-
where the prelude is a selector.
1667+
where the prelude is a selector <a data-autolink="biblio" data-biblio-type="informative" title="SELECT" href="#select">[SELECT]</a>
1668+
and the block a <a title="parse a list of declarations" data-autolink="link" href="#parse-a-list-of-declarations0">list of declarations</a>.
16681669

16691670
</p></dd><dt><dfn id="declaration">declaration</dfn>
16701671
</dt><dd>
@@ -2158,17 +2159,13 @@ <h4 id="consume-a-qualified-rule" data-level="5.4.3"><span class="secno">5.4.3 <
21582159

21592160
</dd><dt>&#9001;{&#9002;
21602161
</dt><dd>
2161-
<a data-autolink="link" href="#consume-a-simple-block0">Consume a simple block</a>.
2162-
<a data-autolink="link" href="#consume-a-list-of-declarations0">Consume a list of declarations</a> from the block's value.
2163-
If anything was returned,
2164-
assign it to the qualified rule's value.
2162+
<a data-autolink="link" href="#consume-a-simple-block0">Consume a simple block</a>
2163+
and assign it to the qualified rule's block.
21652164
Return the qualified rule.
21662165

21672166
</dd><dt><a data-autolink="link" href="#simple-block">simple block</a> with an associated token of &#9001;{&#9002;
21682167
</dt><dd>
2169-
<a data-autolink="link" href="#consume-a-list-of-declarations0">Consume a list of declarations</a> from the block's value.
2170-
If anything was returned,
2171-
assign it to the qualified rule's value.
2168+
Assign the block to the qualified rule's block.
21722169
Return the qualified rule.
21732170

21742171
</dd><dt>anything else
@@ -2912,6 +2909,7 @@ <h2 id="serialization" data-level="8"><span class="secno">8 </span>Serialization
29122909
(when they appear as part of the unit of a &#9001;dimension&#9002; or &#9001;ident&#9002;).
29132910
</li></ul>
29142911
</li></ul>
2912+
29152913
<h2 class="no-ref no-num" id="conformance">
29162914
Conformance</h2>
29172915

@@ -3041,7 +3039,7 @@ <h3 id="normative" class="no-num no-ref">
30413039

30423040
<h3 id="informative" class="no-num no-ref">
30433041
Informative References</h3>
3044-
<div data-fill-with="informative-references"><dl><dt id="select" title="SELECT">[SELECT]</dt><dd>Tantek &#199;elik; et al. <a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/">Selectors Level 3</a>. 29 September 2011. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/">http://www.w3.org/TR/2011/REC-css3-selectors-20110929/</a></dd><dt id="css3-conditional" title="CSS3-CONDITIONAL">[CSS3-CONDITIONAL]</dt><dd>L. David Baron. <a href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">CSS Conditional Rules Module Level 3</a>. 13 December 2012. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">http://www.w3.org/TR/2012/WD-css3-conditional-20121213/</a></dd><dt id="mediaq" title="MEDIAQ">[MEDIAQ]</dt><dd>Florian Rivoal. <a href="http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/">Media Queries</a>. 19 June 2012. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/">http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/</a></dd></dl></div>
3042+
<div data-fill-with="informative-references"><dl><dt id="css3-conditional" title="CSS3-CONDITIONAL">[CSS3-CONDITIONAL]</dt><dd>L. David Baron. <a href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">CSS Conditional Rules Module Level 3</a>. 13 December 2012. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">http://www.w3.org/TR/2012/WD-css3-conditional-20121213/</a></dd><dt id="mediaq" title="MEDIAQ">[MEDIAQ]</dt><dd>Florian Rivoal. <a href="http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/">Media Queries</a>. 19 June 2012. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/">http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/</a></dd><dt id="select" title="SELECT">[SELECT]</dt><dd>Tantek &#199;elik; et al. <a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/">Selectors Level 3</a>. 29 September 2011. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/">http://www.w3.org/TR/2011/REC-css3-selectors-20110929/</a></dd></dl></div>
30453043

30463044
<h2 id="index" class="no-num no-ref">
30473045
Index</h2>

css-syntax/Overview.src.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,10 +1548,11 @@ <h2>
15481548
<dd>
15491549
A qualified rule has
15501550
a prelude consisting of a list of component values,
1551-
and a value consisting of a list of at-rules or declarations.
1551+
and a block consisting of a simple {} block.
15521552

15531553
Note: Most qualified rules will be style rules,
1554-
where the prelude is a selector.
1554+
where the prelude is a selector [[SELECT]]
1555+
and the block a <i title="parse a list of declarations">list of declarations</i>.
15551556

15561557
<dt><dfn>declaration</dfn>
15571558
<dd>
@@ -2045,17 +2046,13 @@ <h4>
20452046

20462047
<dt>〈{〉
20472048
<dd>
2048-
<a>Consume a simple block</a>.
2049-
<a>Consume a list of declarations</a> from the block's value.
2050-
If anything was returned,
2051-
assign it to the qualified rule's value.
2049+
<a>Consume a simple block</a>
2050+
and assign it to the qualified rule's block.
20522051
Return the qualified rule.
20532052

20542053
<dt><a>simple block</a> with an associated token of 〈{〉
20552054
<dd>
2056-
<a>Consume a list of declarations</a> from the block's value.
2057-
If anything was returned,
2058-
assign it to the qualified rule's value.
2055+
Assign the block to the qualified rule's block.
20592056
Return the qualified rule.
20602057

20612058
<dt>anything else
@@ -2802,4 +2799,4 @@ <h2 id="changes">Changes from CSS 2.1 and Selectors Level 3</h2>
28022799
In some cases, "-" characters or digits can be escaped
28032800
(when they appear as part of the unit of a 〈dimension〉 or 〈ident〉).
28042801
</ul>
2805-
</ul>
2802+
</ul>

0 commit comments

Comments
 (0)