Skip to content

Commit 5345a4a

Browse files
committed
[css-syntax] Add parse a comma-separated list of component values.
--HG-- extra : rebase_source : f44e4cc91f9c4d4e24013221e114905fe9e00114
1 parent c24b230 commit 5345a4a

2 files changed

Lines changed: 55 additions & 9 deletions

File tree

css-syntax/Overview.bs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,28 @@ Parse a list of component values</h4>
22782278
Return the list.
22792279
</ol>
22802280

2281+
<h4 id="parse-a-comma-separated-list-of-component-values">
2282+
Parse a comma-separated list of component values</h4>
2283+
2284+
To <dfn export>parse a comma-separated list of component values</dfn>:
2285+
2286+
<ol>
2287+
<li>
2288+
Let <var>list of cvls</var> be an initially empty list of component value lists.
2289+
2290+
<li>
2291+
Repeatedly <a>consume a component value</a> until an <<EOF-token>> or <<comma-token>> is returned,
2292+
appending the returned values (except the final <<EOF-token>> or <<comma-token>>) into a list.
2293+
Append the list to <var>list of cvls</var>.
2294+
2295+
If it was a <<comma-token>> that was returned,
2296+
repeat this step.
2297+
2298+
<li>
2299+
Return <var>list of cvls</var>.
2300+
</ol>
2301+
2302+
22812303
<h3 id="parser-algorithms">
22822304
Parser Algorithms</h3>
22832305

css-syntax/Overview.html

Lines changed: 33 additions & 9 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=20140402>2 April 2014</span></span></span></h2>
61+
<span class=dt-updated><span class=value-title title=20140414>14 April 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>
@@ -155,7 +155,8 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
155155
<li><a href=#parse-a-declaration><span class=secno>5.3.4</span> Parse a declaration</a>
156156
<li><a href=#parse-a-list-of-declarations><span class=secno>5.3.5</span> Parse a list of declarations</a>
157157
<li><a href=#parse-a-component-value><span class=secno>5.3.6</span> Parse a component value</a>
158-
<li><a href=#parse-a-list-of-component-values><span class=secno>5.3.7</span> Parse a list of component values</a></ul>
158+
<li><a href=#parse-a-list-of-component-values><span class=secno>5.3.7</span> Parse a list of component values</a>
159+
<li><a href=#parse-a-comma-separated-list-of-component-values><span class=secno>5.3.8</span> Parse a comma-separated list of component values</a></ul>
159160
<li><a href=#parser-algorithms><span class=secno>5.4</span> Parser Algorithms</a>
160161
<ul class=toc>
161162
<li><a href=#consume-a-list-of-rules><span class=secno>5.4.1</span> Consume a list of rules</a>
@@ -176,7 +177,7 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
176177
<li><a href=#css-stylesheets><span class=secno>8</span> CSS stylesheets</a>
177178
<ul class=toc>
178179
<li><a href=#style-rules><span class=secno>8.1</span> Style rules</a>
179-
<li><a href=#charset-rule><span class=secno>8.2</span> The <span class=css data-link-type=maybe title=@charset>@charset</span> Rule</a></ul>
180+
<li><a href=#charset-rule><span class=secno>8.2</span> The <a class=css data-link-type=maybe href=#at-ruledef-charset title=@charset>@charset</a> Rule</a></ul>
180181
<li><a href=#serialization><span class=secno>9</span> Serialization</a>
181182
<ul class=toc>
182183
<li><a href=#serializing-anb><span class=secno>9.1</span> Serializing <var>&lt;an+b&gt;</var></a></ul>
@@ -260,7 +261,7 @@ <h2 class="heading settled heading" data-level=2 id=syntax-description><span cla
260261
<p> "<code>color: blue;</code>" is a declaration specifying that,
261262
for the elements that match the selector,
262263
their <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a> property should have the value <span class=css data-link-type=maybe title=blue>blue</span>.
263-
Similarly, their <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-decor-3/#text-decoration title=text-decoration>text-decoration</a> property should have the value <span class=css data-link-type=maybe title=underline>underline</span>.
264+
Similarly, their <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-decor-3/#propdef-text-decoration title=text-decoration>text-decoration</a> property should have the value <span class=css data-link-type=maybe title=underline>underline</span>.
264265
</div>
265266

266267
<p> At-rules are all different, but they have a basic structure in common.
@@ -3638,7 +3639,7 @@ <h3 class="heading settled heading" data-level=5.3 id=parser-entry-points><span
36383639

36393640
<li>
36403641
"<a data-link-type=dfn href=#parse-a-component-value0 title="parse a component value">Parse a component value</a>" is for things that need to consume a single value,
3641-
like the parsing rules for <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-values-3/#attr title=attr()>attr()</a>.
3642+
like the parsing rules for <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-values-3/#funcdef-attr title=attr()>attr()</a>.
36423643

36433644
<li>
36443645
"<a data-link-type=dfn href=#parse-a-list-of-component-values0 title="parse a list of component values">Parse a list of component values</a>" is for the contents of presentational attributes,
@@ -3805,6 +3806,28 @@ <h4 class="heading settled heading" data-level=5.3.7 id=parse-a-list-of-componen
38053806
Return the list.
38063807
</ol>
38073808

3809+
<h4 class="heading settled heading" data-level=5.3.8 id=parse-a-comma-separated-list-of-component-values><span class=secno>5.3.8 </span><span class=content>
3810+
Parse a comma-separated list of component values</span><a class=self-link href=#parse-a-comma-separated-list-of-component-values></a></h4>
3811+
3812+
<p> To <dfn data-dfn-type=dfn data-export="" id=parse-a-comma-separated-list-of-component-values0>parse a comma-separated list of component values<a class=self-link href=#parse-a-comma-separated-list-of-component-values0></a></dfn>:
3813+
3814+
<ol>
3815+
<li>
3816+
Let <var>list of cvls</var> be an initially empty list of component value lists.
3817+
3818+
<li>
3819+
Repeatedly <a data-link-type=dfn href=#consume-a-component-value0 title="consume a component value">consume a component value</a> until an <a class="production css-code" data-link-type=type href=#typedef-eof-token title="<eof-token>">&lt;EOF-token&gt;</a> or <a class="production css-code" data-link-type=type href=#typedef-comma-token title="<comma-token>">&lt;comma-token&gt;</a> is returned,
3820+
appending the returned values (except the final <a class="production css-code" data-link-type=type href=#typedef-eof-token title="<eof-token>">&lt;EOF-token&gt;</a> or <a class="production css-code" data-link-type=type href=#typedef-comma-token title="<comma-token>">&lt;comma-token&gt;</a>) into a list.
3821+
Append the list to <var>list of cvls</var>.
3822+
3823+
<p> If it was a <a class="production css-code" data-link-type=type href=#typedef-comma-token title="<comma-token>">&lt;comma-token&gt;</a> that was returned,
3824+
repeat this step.
3825+
3826+
<li>
3827+
Return <var>list of cvls</var>.
3828+
</ol>
3829+
3830+
38083831
<h3 class="heading settled heading" data-level=5.4 id=parser-algorithms><span class=secno>5.4 </span><span class=content>
38093832
Parser Algorithms</span><a class=self-link href=#parser-algorithms></a></h3>
38103833

@@ -4415,7 +4438,7 @@ <h3 class="heading settled heading" data-level=7.1 id=declaration-rule-list><spa
44154438
<p> This is a complete and sufficient definition of the rule’s grammar.
44164439

44174440
<p> For another example,
4418-
<span class=css data-link-type=maybe title=@keyframes>@keyframes</span> rules are more complex,
4441+
<a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-animations-1/#at-ruledef-keyframes title=@keyframes>@keyframes</a> rules are more complex,
44194442
interpreting their prelude as a name and containing keyframes rules in their block
44204443
Their grammar is:
44214444

@@ -4449,15 +4472,15 @@ <h3 class="heading settled heading" data-level=7.1 id=declaration-rule-list><spa
44494472
and unrecognized rules must similarly be removed from the rule’s value.
44504473

44514474
<div class=example>
4452-
For example, the grammar for <span class=css data-link-type=maybe title=@keyframes>@keyframes</span> in the previous example must,
4475+
For example, the grammar for <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-animations-1/#at-ruledef-keyframes title=@keyframes>@keyframes</a> in the previous example must,
44534476
in addition to what is written there,
44544477
define that the only allowed rules are <a class="production css-code" data-link-type=type title="<keyframe-rule>">&lt;keyframe-rule&gt;</a>s,
44554478
which are defined as:
44564479

44574480
<pre><a class="production css-code" data-link-type=type title="<keyframe-rule>">&lt;keyframe-rule&gt;</a> = <a class="production css-code" data-link-type=type title="<keyframe-selector>">&lt;keyframe-selector&gt;</a> { <a class="production css-code" data-link-type=type href=#typedef-declaration-list title="<declaration-list>">&lt;declaration-list&gt;</a> }</pre>
44584481
<p> Keyframe rules, then,
44594482
must further define that they accept as declarations all animatable CSS properties,
4460-
plus the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-animations-1/#animation-timing-function title=animation-timing-function>animation-timing-function</a> property,
4483+
plus the <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-animations-1/#propdef-animation-timing-function title=animation-timing-function>animation-timing-function</a> property,
44614484
but that they do not interact with the cascade.
44624485
</div>
44634486

@@ -4522,7 +4545,7 @@ <h3 class="heading settled heading" data-level=8.1 id=style-rules><span class=se
45224545

45234546
<p class=example>
45244547
For example, qualified rules inside <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-conditional-3/#at-ruledef-media title=@media>@media</a> rules <a data-biblio-type=informative data-link-type=biblio href=#css3-conditional title=css3-conditional>[CSS3-CONDITIONAL]</a> are style rules,
4525-
but qualified rules inside <span class=css data-link-type=maybe title=@keyframes>@keyframes</span> rules are not <a data-biblio-type=informative data-link-type=biblio href=#css3-animations title=css3-animations>[CSS3-ANIMATIONS]</a>.
4548+
but qualified rules inside <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-animations-1/#at-ruledef-keyframes title=@keyframes>@keyframes</a> rules are not <a data-biblio-type=informative data-link-type=biblio href=#css3-animations title=css3-animations>[CSS3-ANIMATIONS]</a>.
45264549

45274550
<h3 class="heading settled heading" data-level=8.2 id=charset-rule><span class=secno>8.2 </span><span class=content>
45284551
The <a class=css data-link-type=maybe href=#at-ruledef-charset title=@charset>@charset</a> Rule</span><a class=self-link href=#charset-rule></a></h3>
@@ -5156,6 +5179,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
51565179
<li>non-ASCII code point, <a href=#non-ascii-code-point title="section 4.2">4.2</a>
51575180
<li>non-printable code point, <a href=#non-printable-code-point title="section 4.2">4.2</a>
51585181
<li>&lt;number-token&gt;, <a href=#typedef-number-token title="section 4">4</a>
5182+
<li>parse a comma-separated list of component values, <a href=#parse-a-comma-separated-list-of-component-values0 title="section 5.3.8">5.3.8</a>
51595183
<li>parse a component value, <a href=#parse-a-component-value0 title="section 5.3.6">5.3.6</a>
51605184
<li>parse a CSS stylesheet, <a href=#parse-a-css-stylesheet title="section 8">8</a>
51615185
<li>parse a declaration, <a href=#parse-a-declaration0 title="section 5.3.4">5.3.4</a>

0 commit comments

Comments
 (0)