Skip to content

Commit c8a5684

Browse files
committed
[css-syntax] Fix an off-by-one-token bug in "Consume a simple block" and "Consume a function".
http://lists.w3.org/Archives/Public/www-style/2014Mar/0247.html
1 parent e4fe1f2 commit c8a5684

2 files changed

Lines changed: 30 additions & 21 deletions

File tree

css-syntax/Overview.bs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,6 @@ Consume an at-rule</h4>
23552355

23562356
<dt><a href="#tokendef-open-curly">&lt;{-token></a>
23572357
<dd>
2358-
<a>Reconsume the current input token</a>.
23592358
<a>Consume a simple block</a>
23602359
and assign it to the at-rule's block.
23612360
Return the at-rule.
@@ -2392,7 +2391,6 @@ Consume a qualified rule</h4>
23922391

23932392
<dt><a href="#tokendef-open-curly">&lt;{-token></a>
23942393
<dd>
2395-
<a>Reconsume the current input token</a>.
23962394
<a>Consume a simple block</a>
23972395
and assign it to the qualified rule's block.
23982396
Return the qualified rule.
@@ -2518,11 +2516,10 @@ Consume a component value</h4>
25182516
<h4 id="consume-a-simple-block">
25192517
Consume a simple block</h4>
25202518

2521-
Note: This algorithm assumes that the <a>next input token</a> has already been checked to be an <a href="#tokendef-open-curly">&lt;{-token></a>, <a href="#tokendef-open-square">&lt;[-token></a>, or <a href="#tokendef-open-paren">&lt;(-token></a>.
2519+
Note: This algorithm assumes that the <a>current input token</a> has already been checked to be an <a href="#tokendef-open-curly">&lt;{-token></a>, <a href="#tokendef-open-square">&lt;[-token></a>, or <a href="#tokendef-open-paren">&lt;(-token></a>.
25222520

25232521
To <dfn>consume a simple block</dfn>:
25242522

2525-
<a>Consume the next input token</a>.
25262523
The <dfn>ending token</dfn> is the mirror variant of the <a>current input token</a>.
25272524
(E.g. if it was called with <a href="#tokendef-open-square">&lt;[-token></a>, the <a>ending token</a> is <a href="#tokendef-close-square">&lt;]-token></a>.)
25282525

@@ -2548,11 +2545,10 @@ Consume a simple block</h4>
25482545
<h4 id="consume-a-function">
25492546
Consume a function</h4>
25502547

2551-
Note: This algorithm assumes that the <a>next input token</a> has already been checked to be a <<function-token>>.
2548+
Note: This algorithm assumes that the <a>current input token</a> has already been checked to be a <<function-token>>.
25522549

25532550
To <dfn>consume a function</dfn>:
25542551

2555-
<a>Consume the next input token</a>.
25562552
Create a function with a name equal to the value of the <a>current input token</a>,
25572553
and with a value which is initially an empty list.
25582554

@@ -3212,6 +3208,13 @@ Changes</h2>
32123208

32133209
<em>This section is non-normative.</em>
32143210

3211+
<h3 id="changes-CR-20140220">
3212+
Changes from the 20 February 2014 Candidate Recommendation</h3>
3213+
3214+
<ul>
3215+
<li>Fix several bugs in the tokenization and parsing algorithms.
3216+
</ul>
3217+
32153218
<h3 id="changes-WD-20131105">
32163219
Changes from the 5 November 2013 Last Call Working Draft</h3>
32173220

@@ -3401,6 +3404,7 @@ Acknowledgments</h2>
34013404
Anne van Kesteren,
34023405
David Baron,
34033406
Henri Sivonen,
3407+
Johannes Koch,
34043408
呂康豪 (Kang-Hao Lu),
34053409
Marc O'Morain,
34063410
Simon Pieter,

css-syntax/Overview.html

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</p>
5959
<h1 class="p-name no-ref" id=title>CSS Syntax Module Level 3</h1>
6060
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
61-
<span class=dt-updated><span class=value-title title=20140305>5 March 2014</span></span></span></h2>
61+
<span class=dt-updated><span class=value-title title=20140313>13 March 2014</span></span></span></h2>
6262
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-syntax/>http://dev.w3.org/csswg/css-syntax/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-syntax-3/>http://www.w3.org/TR/css-syntax-3/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-syntax/>http://dev.w3.org/csswg/css-syntax/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2014/CR-css-syntax-3-20140220/ rel=previous>http://www.w3.org/TR/2014/CR-css-syntax-3-20140220/</a><dd><a href=http://www.w3.org/TR/2013/WD-css-syntax-3-20131105/ rel=previous>http://www.w3.org/TR/2013/WD-css-syntax-3-20131105/</a><dd><a href=http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/ rel=previous>http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/</a>
6363
<dt>Feedback:</dt>
6464
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-syntax%5D%20feedback">www-style@w3.org</a>
@@ -181,9 +181,10 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
181181
<li><a href=#serializing-anb><span class=secno>9.1</span> Serializing <var>&lt;an+b&gt;</var></a></ul>
182182
<li><a href=#changes0><span class=secno>10</span> Changes</a>
183183
<ul class=toc>
184-
<li><a href=#changes-WD-20131105><span class=secno>10.1</span> Changes from the 5 November 2013 Last Call Working Draft</a>
185-
<li><a href=#changes-WD-20130919><span class=secno>10.2</span> Changes from the 19 September 2013 Working Draft</a>
186-
<li><a href=#changes-css21><span class=secno>10.3</span> Changes from CSS 2.1 and Selectors Level 3</a></ul>
184+
<li><a href=#changes-CR-20140220><span class=secno>10.1</span> Changes from the 20 February 2014 Candidate Recommendation</a>
185+
<li><a href=#changes-WD-20131105><span class=secno>10.2</span> Changes from the 5 November 2013 Last Call Working Draft</a>
186+
<li><a href=#changes-WD-20130919><span class=secno>10.3</span> Changes from the 19 September 2013 Working Draft</a>
187+
<li><a href=#changes-css21><span class=secno>10.4</span> Changes from CSS 2.1 and Selectors Level 3</a></ul>
187188
<li><a href=#acknowledgments><span class=secno></span> Acknowledgments</a>
188189
<li><a href=#changes><span class=secno></span> Changes Since the 20 Feb 2014 CR Publication</a>
189190
<li><a href=#conformance><span class=secno></span> Conformance</a>
@@ -3868,7 +3869,6 @@ <h4 class="heading settled heading" data-level=5.4.2 id=consume-an-at-rule><span
38683869

38693870
<dt><a href=#tokendef-open-curly>&lt;{-token&gt;</a>
38703871
<dd>
3871-
<a data-link-type=dfn href=#reconsume-the-current-input-token title="reconsume the current input token">Reconsume the current input token</a>.
38723872
<a data-link-type=dfn href=#consume-a-simple-block0 title="consume a simple block">Consume a simple block</a>
38733873
and assign it to the at-rule’s block.
38743874
Return the at-rule.
@@ -3905,7 +3905,6 @@ <h4 class="heading settled heading" data-level=5.4.3 id=consume-a-qualified-rule
39053905

39063906
<dt><a href=#tokendef-open-curly>&lt;{-token&gt;</a>
39073907
<dd>
3908-
<a data-link-type=dfn href=#reconsume-the-current-input-token title="reconsume the current input token">Reconsume the current input token</a>.
39093908
<a data-link-type=dfn href=#consume-a-simple-block0 title="consume a simple block">Consume a simple block</a>
39103909
and assign it to the qualified rule’s block.
39113910
Return the qualified rule.
@@ -4031,12 +4030,11 @@ <h4 class="heading settled heading" data-level=5.4.6 id=consume-a-component-valu
40314030
<h4 class="heading settled heading" data-level=5.4.7 id=consume-a-simple-block><span class=secno>5.4.7 </span><span class=content>
40324031
Consume a simple block</span><a class=self-link href=#consume-a-simple-block></a></h4>
40334032

4034-
<p class=note> Note: This algorithm assumes that the <a data-link-type=dfn href=#next-input-token title="next input token">next input token</a> has already been checked to be an <a href=#tokendef-open-curly>&lt;{-token&gt;</a>, <a href=#tokendef-open-square>&lt;[-token&gt;</a>, or <a href=#tokendef-open-paren>&lt;(-token&gt;</a>.
4033+
<p class=note> Note: This algorithm assumes that the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a> has already been checked to be an <a href=#tokendef-open-curly>&lt;{-token&gt;</a>, <a href=#tokendef-open-square>&lt;[-token&gt;</a>, or <a href=#tokendef-open-paren>&lt;(-token&gt;</a>.
40354034

40364035
<p> To <dfn data-dfn-type=dfn data-noexport="" id=consume-a-simple-block0>consume a simple block<a class=self-link href=#consume-a-simple-block0></a></dfn>:
40374036

4038-
<p> <a data-link-type=dfn href=#consume-the-next-input-token title="consume the next input token">Consume the next input token</a>.
4039-
The <dfn data-dfn-type=dfn data-noexport="" id=ending-token>ending token<a class=self-link href=#ending-token></a></dfn> is the mirror variant of the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a>.
4037+
<p> The <dfn data-dfn-type=dfn data-noexport="" id=ending-token>ending token<a class=self-link href=#ending-token></a></dfn> is the mirror variant of the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a>.
40404038
(E.g. if it was called with <a href=#tokendef-open-square>&lt;[-token&gt;</a>, the <a data-link-type=dfn href=#ending-token title="ending token">ending token</a> is <a href=#tokendef-close-square>&lt;]-token&gt;</a>.)
40414039

40424040
<p> Create a <a data-link-type=dfn href=#simple-block title="simple block">simple block</a> with its associated token set to the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a>
@@ -4061,12 +4059,11 @@ <h4 class="heading settled heading" data-level=5.4.7 id=consume-a-simple-block><
40614059
<h4 class="heading settled heading" data-level=5.4.8 id=consume-a-function><span class=secno>5.4.8 </span><span class=content>
40624060
Consume a function</span><a class=self-link href=#consume-a-function></a></h4>
40634061

4064-
<p class=note> Note: This algorithm assumes that the <a data-link-type=dfn href=#next-input-token title="next input token">next input token</a> has already been checked to be a <a class="production css-code" data-link-type=type href=#typedef-function-token title="<function-token>">&lt;function-token&gt;</a>.
4062+
<p class=note> Note: This algorithm assumes that the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a> has already been checked to be a <a class="production css-code" data-link-type=type href=#typedef-function-token title="<function-token>">&lt;function-token&gt;</a>.
40654063

40664064
<p> To <dfn data-dfn-type=dfn data-noexport="" id=consume-a-function0>consume a function<a class=self-link href=#consume-a-function0></a></dfn>:
40674065

4068-
<p> <a data-link-type=dfn href=#consume-the-next-input-token title="consume the next input token">Consume the next input token</a>.
4069-
Create a function with a name equal to the value of the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a>,
4066+
<p> Create a function with a name equal to the value of the <a data-link-type=dfn href=#current-input-token title="current input token">current input token</a>,
40704067
and with a value which is initially an empty list.
40714068

40724069
<p> Repeatedly consume the <a data-link-type=dfn href=#next-input-token title="next input token">next input token</a> and process it as follows:
@@ -4696,7 +4693,14 @@ <h2 class="heading settled heading" data-level=10 id=changes0><span class=secno>
46964693

46974694
<p> <em>This section is non-normative.</em>
46984695

4699-
<h3 class="heading settled heading" data-level=10.1 id=changes-WD-20131105><span class=secno>10.1 </span><span class=content>
4696+
<h3 class="heading settled heading" data-level=10.1 id=changes-CR-20140220><span class=secno>10.1 </span><span class=content>
4697+
Changes from the 20 February 2014 Candidate Recommendation</span><a class=self-link href=#changes-CR-20140220></a></h3>
4698+
4699+
<p> <ul>
4700+
<li>Fix several bugs in the tokenization and parsing algorithms.
4701+
</ul>
4702+
4703+
<h3 class="heading settled heading" data-level=10.2 id=changes-WD-20131105><span class=secno>10.2 </span><span class=content>
47004704
Changes from the 5 November 2013 Last Call Working Draft</span><a class=self-link href=#changes-WD-20131105></a></h3>
47014705

47024706
<p> <ul>
@@ -4719,7 +4723,7 @@ <h3 class="heading settled heading" data-level=10.1 id=changes-WD-20131105><span
47194723

47204724
<pre>@charset " <em>(lots of whitespace)</em> utf-8";</pre> </ul>
47214725

4722-
<h3 class="heading settled heading" data-level=10.2 id=changes-WD-20130919><span class=secno>10.2 </span><span class=content>
4726+
<h3 class="heading settled heading" data-level=10.3 id=changes-WD-20130919><span class=secno>10.3 </span><span class=content>
47234727
Changes from the 19 September 2013 Working Draft</span><a class=self-link href=#changes-WD-20130919></a></h3>
47244728

47254729
<p> <ul>
@@ -4729,7 +4733,7 @@ <h3 class="heading settled heading" data-level=10.2 id=changes-WD-20130919><span
47294733
but some of the definitions should be moved to the relevant specs.
47304734
</ul>
47314735

4732-
<h3 class="heading settled heading" data-level=10.3 id=changes-css21><span class=secno>10.3 </span><span class=content>
4736+
<h3 class="heading settled heading" data-level=10.4 id=changes-css21><span class=secno>10.4 </span><span class=content>
47334737
Changes from CSS 2.1 and Selectors Level 3</span><a class=self-link href=#changes-css21></a></h3>
47344738

47354739
<p class=note> Note: The point of this spec is to match reality;
@@ -4881,6 +4885,7 @@ <h2 class="no-num heading settled heading" id=acknowledgments><span class=conten
48814885
Anne van Kesteren,
48824886
David Baron,
48834887
Henri Sivonen,
4888+
Johannes Koch,
48844889
呂康豪 (Kang-Hao Lu),
48854890
Marc O’Morain,
48864891
Simon Pieter,

0 commit comments

Comments
 (0)