Skip to content

Commit 1bed7f9

Browse files
committed
[css-syntax-3] Update to the new Nesting model.
1 parent 10573c9 commit 1bed7f9

File tree

1 file changed

+36
-23
lines changed

1 file changed

+36
-23
lines changed

css-syntax-3/Overview.bs

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,12 +2549,13 @@ Consume a qualified rule</h4>
25492549

25502550
Create a new qualified rule
25512551
with its prelude initially set to an empty [=list=],
2552-
and its value initially set to nothing.
2552+
and its block initially set to nothing.
25532553

25542554
Repeatedly consume the <a>next input token</a>:
25552555

25562556
<dl>
25572557
<dt><<EOF-token>>
2558+
<dt><<semicolon-token>>
25582559
<dd>
25592560
This is a <a>parse error</a>.
25602561
Return nothing.
@@ -2605,28 +2606,23 @@ Consume a style block's contents</h4>
26052606
and append the result to |rules|.
26062607

26072608
<dt><<ident-token>>
2609+
<dt><<function-token>>
2610+
<dt><<function>>
26082611
<dd>
2609-
Initialize a temporary list initially filled with the <a>current input token</a>.
2612+
<a>Reconsume the current input token</a>.
2613+
Initialize a temporary list, initially empty.
26102614
As long as the <a>next input token</a> is anything other than a <<semicolon-token>> or <<EOF-token>>,
26112615
<a>consume a component value</a> and append it to the temporary list.
26122616
<a>Consume a declaration</a> from the temporary list.
26132617
If anything was returned,
26142618
append it to |decls|.
26152619

2616-
<dt><<delim-token>> with a value of "&" (U+0026 AMPERSAND)
2620+
<dt>anything else</dd>
26172621
<dd>
26182622
[=Reconsume the current input token=].
26192623
[=Consume a qualified rule=].
26202624
If anything was returned,
26212625
append it to |rules|.
2622-
2623-
<dt>anything else</dd>
2624-
<dd>
2625-
This is a <a>parse error</a>.
2626-
<a>Reconsume the current input token</a>.
2627-
As long as the <a>next input token</a> is anything other than a <<semicolon-token>> or <<EOF-token>>,
2628-
<a>consume a component value</a>
2629-
and throw away the returned value.
26302626
</dl>
26312627

26322628

@@ -2677,16 +2673,33 @@ Consume a list of declarations</h4>
26772673
<h4 id="consume-declaration">
26782674
Consume a declaration</h4>
26792675

2680-
Note: This algorithm assumes that the <a>next input token</a> has already been checked to be an <<ident-token>>.
2681-
26822676
To <dfn>consume a declaration</dfn>:
26832677

2684-
<a>Consume the next input token</a>.
2685-
Create a new declaration
2686-
with its name set to the value of the <a>current input token</a>
2687-
and its value initially set to an empty [=list=].
2688-
2678+
Let |decl| be a new declaration,
2679+
with an initially empty name
2680+
and a value set to an empty [=list=].
26892681
<ol>
2682+
<li>
2683+
<a>Consume a component value</a>.
2684+
2685+
<dl class=switch>
2686+
: <<ident-token>>
2687+
::
2688+
Set |decl|'s name to the value of the <<ident-token>>.
2689+
2690+
: anything else
2691+
::
2692+
This is a [=parse error=].
2693+
2694+
While the [=next input token=]
2695+
is anything but a <<semicolon-token>>
2696+
or <<eof-token>>,
2697+
[=consume a component value=]
2698+
and throw it away.
2699+
2700+
Return nothing.
2701+
</dl>
2702+
26902703
<li>
26912704
While the <a>next input token</a> is a <<whitespace-token>>,
26922705
<a>consume the next input token</a>.
@@ -2705,21 +2718,21 @@ Consume a declaration</h4>
27052718
<li>
27062719
As long as the <a>next input token</a> is anything other than an <<EOF-token>>,
27072720
<a>consume a component value</a>
2708-
and append it to the declaration's value.
2721+
and append it to |decl|'s value.
27092722

27102723
<li>
27112724
If the last two non-<<whitespace-token>>s in the declaration's value are
27122725
a <<delim-token>> with the value "!"
27132726
followed by an <<ident-token>> with a value that is an <a>ASCII case-insensitive</a> match for "important",
2714-
remove them from the declaration's value
2715-
and set the declaration's <var>important</var> flag to true.
2727+
remove them from |decl|'s value
2728+
and set |decl|'s <var>important</var> flag to true.
27162729

27172730
<li>
2718-
While the last token in the declaration's value is a <<whitespace-token>>,
2731+
While the last token in |decl|'s value is a <<whitespace-token>>,
27192732
[=list/remove=] that token.
27202733

27212734
<li>
2722-
Return the declaration.
2735+
Return |decl|.
27232736
</ol>
27242737

27252738

0 commit comments

Comments
 (0)