Skip to content

Commit 10baf2c

Browse files
committed
[css-syntax] Add a 'top-level' flag to 'consume a list of rules', so stylesheets can ignore cdo/cdc but other uses will pay attention to them.
1 parent d25bda5 commit 10baf2c

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

css-syntax/Overview.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,7 +3467,8 @@ <h4 id=parse-a-stylesheet><span class=secno>5.4.1. </span> <dfn
34673467
<li> Create a new stylesheet.
34683468

34693469
<li> <a href="#consume-a-list-of-rules0"><i>Consume a list of
3470-
rules</i></a> from the stream of tokens.
3470+
rules</i></a> from the stream of tokens, with the <var>top-level
3471+
flag</var> set.
34713472

34723473
<li> Assign the returned value to the stylesheet's value.
34733474

@@ -3714,10 +3715,6 @@ <h4 id=consume-a-list-of-rules><span class=secno>5.5.1. </span> <dfn
37143715
token</i></a>:
37153716

37163717
<dl>
3717-
<dt>cdo token
3718-
3719-
<dt>cdc token
3720-
37213718
<dt>whitespace token
37223719

37233720
<dd> Do nothing.
@@ -3726,6 +3723,16 @@ <h4 id=consume-a-list-of-rules><span class=secno>5.5.1. </span> <dfn
37263723

37273724
<dd> Return the list of rules.
37283725

3726+
<dt>cdo token
3727+
3728+
<dt>cdc token
3729+
3730+
<dd> If the <var>top-level flag</var> is set, do nothing.
3731+
<p> Otherwise, <a href="#reconsume-the-current-input-token"><i>reconsume
3732+
the current input token</i></a>. <a
3733+
href="#consume-a-qualified-rule0"><i>Consume a qualified rule</i></a>.
3734+
If anything is returned, append it to the list of rules.
3735+
37293736
<dt>at-keyword token
37303737

37313738
<dd> <a href="#reconsume-the-current-input-token"><i>Reconsume the current

css-syntax/Overview.src.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ <h4>
23742374
Create a new stylesheet.
23752375

23762376
<li>
2377-
<i>Consume a list of rules</i> from the stream of tokens.
2377+
<i>Consume a list of rules</i> from the stream of tokens, with the <var>top-level flag</var> set.
23782378

23792379
<li>
23802380
Assign the returned value to the stylesheet's value.
@@ -2682,8 +2682,6 @@ <h4>
26822682
Repeatedly consume the <i>next input token</i>:
26832683

26842684
<dl>
2685-
<dt>cdo token
2686-
<dt>cdc token
26872685
<dt>whitespace token
26882686
<dd>
26892687
Do nothing.
@@ -2692,6 +2690,19 @@ <h4>
26922690
<dd>
26932691
Return the list of rules.
26942692

2693+
<dt>cdo token
2694+
<dt>cdc token
2695+
<dd>
2696+
If the <var>top-level flag</var> is set,
2697+
do nothing.
2698+
2699+
<p>
2700+
Otherwise,
2701+
<i>reconsume the current input token</i>.
2702+
<i>Consume a qualified rule</i>.
2703+
If anything is returned,
2704+
append it to the list of rules.
2705+
26952706
<dt>at-keyword token
26962707
<dd>
26972708
<i>Reconsume the current input token</i>.

0 commit comments

Comments
 (0)