@@ -281,8 +281,8 @@ <h2 class="no-num no-toc" id=contents> Table of contents</h2>
281281 < li > < a href ="#at-rule-mode "> < span class =secno > 3.6.4. </ span > At-rule
282282 mode</ a >
283283
284- < li > < a href ="#at- rule-block- mode "> < span class =secno > 3.6.5. </ span >
285- At-rule-block mode</ a >
284+ < li > < a href ="#rule-mode "> < span class =secno > 3.6.5. </ span > Rule
285+ mode</ a >
286286
287287 < li > < a href ="#style-rule-mode "> < span class =secno > 3.6.6. </ span >
288288 Style-rule mode</ a >
@@ -2101,6 +2101,23 @@ <h4 id=definitions0><span class=secno>3.6.2. </span> Definitions</h4>
21012101
21022102 < dd > The declaration currently being built. There may or may not be a
21032103 current declaration at any given time, but there is never more than one.
2104+
2105+ < dt > < dfn id =rule-filled > rule-filled</ dfn >
2106+
2107+ < dd > An at-rule that takes a block, and within that block accepts at-rules
2108+ and/or style rules (or a close variant of style rules, like a keyframe
2109+ rule), is called < a href ="#rule-filled "> < i > rule-filled</ i > </ a > . Examples
2110+ of < a href ="#rule-filled "> < i > rule-filled</ i > </ a > at-rules are ‘< code
2111+ class =css > @media</ code > ’ and ‘< code class =css > @keyframes</ code > ’.
2112+
2113+ < dt > < dfn id =declaration-filled > declaration-filled</ dfn >
2114+
2115+ < dd > An at-rule that takes a block, and within that block accepts at-rules
2116+ and/or declarations, is called < a
2117+ href ="#declaration-filled "> < i > declaration-filled</ i > </ a > . Examples of < a
2118+ href ="#declaration-filled "> < i > declaration-filled</ i > </ a > at-rules are
2119+ ‘< code class =css > @font-face</ code > ’ and ‘< code
2120+ class =css > @page</ code > ’.
21042121 </ dl >
21052122
21062123 < h4 id =top-level-mode- > < span class =secno > 3.6.3. </ span > < dfn
@@ -2119,7 +2136,7 @@ <h4 id=top-level-mode-><span class=secno>3.6.3. </span> <dfn
21192136
21202137 < dt > at-keyword token
21212138
2122- < dd > < i > Create an at-rule</ i > with its name set to the value of the < a
2139+ < dd > Create an at-rule with its name set to the value of the < a
21232140 href ="#current-input-token "> < i > current input token</ i > </ a > and push it
21242141 onto the < a href ="#stack-of-open-rules "> < i > stack of open rules</ i > </ a > .
21252142 Switch to the < a href ="#at-rule-mode0 "> < i > at-rule mode</ i > </ a > .
@@ -2155,8 +2172,15 @@ <h4 id=at-rule-mode><span class=secno>3.6.4. </span> <dfn
21552172
21562173 < dt > < span class =temp > {</ span > token
21572174
2158- < dd > Switch to the < a href ="#at-rule-block-mode0 "> < i > at-rule-block
2159- mode</ i > </ a > .
2175+ < dd > If the < a href ="#current-rule "> < i > current rule</ i > </ a > is < a
2176+ href ="#rule-filled "> < i > rule-filled</ i > </ a > , switch to the < a
2177+ href ="#rule-mode0 "> < i > rule mode</ i > </ a > .
2178+ < p > Otherwise, if the < a href ="#current-rule "> < i > current rule</ i > </ a > is
2179+ < a href ="#declaration-filled "> < i > declaration-filled</ i > </ a > , switch to
2180+ the < a href ="#declaration-mode0 "> < i > declaration mode</ i > </ a > .
2181+
2182+ < p > Otherwise, this is a < i > parse error</ i > . Switch to the
2183+ < i > next-statement error mode</ i > .
21602184
21612185 < dt > < span class =temp > [</ span > token
21622186
@@ -2181,23 +2205,18 @@ <h4 id=at-rule-mode><span class=secno>3.6.4. </span> <dfn
21812205 rule</ i > </ a > and remain in this mode.
21822206 </ dl >
21832207
2184- < h4 id =at- rule-block- mode> < span class =secno > 3.6.5. </ span > < dfn
2185- id = at-rule-block-mode0 > At-rule-block mode</ dfn > </ h4 >
2208+ < h4 id =rule-mode > < span class =secno > 3.6.5. </ span > < dfn id = rule-mode0 > Rule
2209+ mode</ dfn > </ h4 >
21862210
21872211 < p > Consume the < a href ="#next-input-token "> < i > next input token</ i > </ a > .
21882212
21892213 < dl >
2190- < dt > cdo token
2191-
2192- < dt > cdc token
2193-
21942214 < dt > bad-string token
21952215
21962216 < dt > bad-url token
21972217
21982218 < dd > This is a < i > parse error</ i > . Switch to the < a
2199- href ="#next-block-or-statement-error-mode0 "> < i > next-block-or-statement
2200- error mode</ i > </ a > .
2219+ href ="#next-block-error-mode0 "> < i > next-block error mode</ i > </ a > .
22012220
22022221 < dt > < span class =temp > }</ span > token
22032222
@@ -2210,18 +2229,18 @@ <h4 id=at-rule-block-mode><span class=secno>3.6.5. </span> <dfn
22102229
22112230 < dt > at-keyword token
22122231
2213- < dd > < i > Create an at-rule</ i > with its name set to the value of the < a
2232+ < dd > Create an at-rule with its name set to the value of the < a
22142233 href ="#current-input-token "> < i > current input token</ i > </ a > and push it
22152234 onto the < a href ="#stack-of-open-rules "> < i > stack of open rules</ i > </ a > .
22162235 Switch to the < a href ="#at-rule-mode0 "> < i > at-rule mode</ i > </ a > .
2217- </ dl >
22182236
2219- < p class =issue > Not done yet. Every at-rule allows more at-rules in its
2220- body, but must choose whether it allows declarations or "style rules" in
2221- its body (things with a selector). Need to decide whether I should just
2222- specialize on that, or if I should fully specialize on the at-keyword
2223- name, so that, for example, @keyframes goes down a special parser rule
2224- that ends up accepting only keyframes.
2237+ < dt > anything else
2238+
2239+ < dd > < i > Create a style rule</ i > and push it onto the < a
2240+ href ="#stack-of-open-rules "> < i > stack of open rules</ i > </ a > . Switch to the
2241+ < a href ="#style-rule-mode0 "> < i > style-rule mode</ i > </ a > . Reprocess the < a
2242+ href ="#current-input-token "> < i > current input token</ i > </ a > .
2243+ </ dl >
22252244
22262245 < h4 id =style-rule-mode > < span class =secno > 3.6.6. </ span > < dfn
22272246 id =style-rule-mode0 > Style-rule mode</ dfn > </ h4 >
@@ -2277,6 +2296,13 @@ <h4 id=declaration-mode><span class=secno>3.6.7. </span> <dfn
22772296 href ="#switch-to-the-current-rules-content-mode0 "> < i > Switch to the
22782297 current rule's content mode</ i > </ a > .
22792298
2299+ < dt > at-rule token
2300+
2301+ < dd > Create an at-rule with its name set to the value of the < a
2302+ href ="#current-input-token "> < i > current input token</ i > </ a > and push it
2303+ onto the < a href ="#stack-of-open-rules "> < i > stack of open rules</ i > </ a > .
2304+ Switch to the < a href ="#at-rule-mode0 "> < i > at-rule mode</ i > </ a > .
2305+
22802306 < dt > ident token
22812307
22822308 < dd > Create a declaration with its name set to the value of the < a
@@ -2598,12 +2624,13 @@ <h4 id=switch-to-the-current-rules-content-mode><span class=secno>3.6.15.
25982624 rule's content mode</ i > </ a > . It is invoked whenever a declaration or rule
25992625 has been successfully completed, or when an error has finished recovery.
26002626
2601- < p > If the < a href ="#current-rule "> < i > current rule</ i > </ a > is a style rule,
2627+ < p > If the < a href ="#current-rule "> < i > current rule</ i > </ a > is a style rule
2628+ or a < a href ="#declaration-filled "> < i > declaration-filled</ i > </ a > at-rule,
26022629 switch to the < a href ="#declaration-mode0 "> < i > declaration mode</ i > </ a > .
26032630
2604- < p > If the < a href ="#current-rule "> < i > current rule</ i > </ a > is an at-rule,
2605- switch to the < a href ="#at- rule-block-mode0 "> < i > at-rule-block
2606- mode</ i > </ a > .
2631+ < p > If the < a href ="#current-rule "> < i > current rule</ i > </ a > is a < a
2632+ href ="#rule-filled "> < i > rule-filled </ i > </ a > at-rule, switch to the < a
2633+ href =" #rule-mode0 " > < i > rule mode</ i > </ a > .
26072634
26082635 < p > If the < a href ="#current-rule "> < i > current rule</ i > </ a > is a stylesheet,
26092636 switch to the < a href ="#top-level-mode "> < i > top-level mode</ i > </ a > .
@@ -2892,9 +2919,6 @@ <h2 class=no-num id=index> Index</h2>
28922919
28932920 < li > at-rule, < a href ="#at-rules " title =at-rule > < strong > 2.</ strong > </ a >
28942921
2895- < li > At-rule-block mode, < a href ="#at-rule-block-mode0 "
2896- title ="At-rule-block mode "> < strong > 3.6.5.</ strong > </ a >
2897-
28982922 < li > At-rule mode, < a href ="#at-rule-mode0 "
28992923 title ="At-rule mode "> < strong > 3.6.4.</ strong > </ a >
29002924
@@ -2934,6 +2958,9 @@ <h2 class=no-num id=index> Index</h2>
29342958 < li > Declaration-end mode, < a href ="#declaration-end-mode0 "
29352959 title ="Declaration-end mode "> < strong > 3.6.10.</ strong > </ a >
29362960
2961+ < li > declaration-filled, < a href ="#declaration-filled "
2962+ title =declaration-filled > < strong > 3.6.2.</ strong > </ a >
2963+
29372964 < li > Declaration mode, < a href ="#declaration-mode0 "
29382965 title ="Declaration mode "> < strong > 3.6.7.</ strong > </ a >
29392966
@@ -3021,6 +3048,12 @@ <h2 class=no-num id=index> Index</h2>
30213048
30223049 < li > rule, < a href ="#rule " title =rule > < strong > 2.</ strong > </ a >
30233050
3051+ < li > rule-filled, < a href ="#rule-filled "
3052+ title =rule-filled > < strong > 3.6.2.</ strong > </ a >
3053+
3054+ < li > Rule mode, < a href ="#rule-mode0 "
3055+ title ="Rule mode "> < strong > 3.6.5.</ strong > </ a >
3056+
30243057 < li > Sci-notation state, < a href ="#sci-notation-state0 "
30253058 title ="Sci-notation state "> < strong > 3.4.18.</ strong > </ a >
30263059
0 commit comments