Skip to content

Commit d465dce

Browse files
committed
[css-values] Add some reasonable things to the grammar definitions.
1 parent 3f9ce00 commit d465dce

File tree

2 files changed

+66
-58
lines changed

2 files changed

+66
-58
lines changed

css-values/Overview.html

+33-30
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
rel=dcterms.rights>
1212
<meta content="CSS Values and Units Module Level 3" name=dcterms.title>
1313
<meta content=text name=dcterms.type>
14-
<meta content=2013-08-30 name=dcterms.date>
14+
<meta content=2013-10-08 name=dcterms.date>
1515
<meta content="Håkon Wium Lie" name=dcterms.creator>
1616
<meta content="Tab Atkins" name=dcterms.creator>
1717
<meta content="Elika J. Etemad" name=dcterms.creator>
1818
<meta content=W3C name=dcterms.publisher>
19-
<meta content="http://www.w3.org/TR/2013/CR-css3-values-20130830/"
19+
<meta content="http://www.w3.org/TR/2013/CR-css3-values-20131008/"
2020
name=dcterms.identifier>
2121
<style type="text/css">
2222
code, small { white-space: nowrap }
@@ -41,15 +41,15 @@
4141

4242
<h1 class=p-name>CSS Values and Units Module Level 3</h1>
4343

44-
<h2 class="no-num no-toc" id=longstatus-date>W3C Candidate Recommendation
45-
<span class=dt-updated><span class=value title=20130830>30 August
44+
<h2 class="no-num no-toc">W3C Candidate Recommendation <span
45+
class=dt-updated><span class=value title=20131008> 8 October
4646
2013</span></span></h2>
4747

4848
<dl>
4949
<dt>This version:
5050

5151
<dd><a class=u-url
52-
href="http://www.w3.org/TR/2013/CR-css3-values-20130830/">http://www.w3.org/TR/2013/CR-css3-values-20130830/</a>
52+
href="http://www.w3.org/TR/2013/CR-css3-values-20131008/">http://www.w3.org/TR/2013/CR-css3-values-20131008/</a>
5353

5454
<dt>Latest version:
5555

@@ -428,20 +428,24 @@ <h3 id=component-types><span class=secno>2.1. </span> Component value types</h3>
428428
class=property>border-width</code>></var>: the latter is defined as
429429
the value of the ‘<code class=property>border-width</code>’ property,
430430
the former requires an explicit expansion elsewhere. The definition of a
431-
non-terminal is located near its first appearance in the specification.
431+
non-terminal is typically located near its first appearance in the
432+
specification.
432433
</ol>
433434

434-
<p>Some property value definitions also include the slash (/) and/or the
435-
comma (,) as literals. These represent their corresponding tokens.
435+
<p> Some property value definitions also include the slash (/), the comma
436+
(,), and/or parentheses as literals. These represent their corresponding
437+
tokens. Other non-keyword literal characters that may appear in a
438+
component value, such as “+”, must be written enclosed in single
439+
quotes.
436440

437-
<p>All CSS properties also accept the <a href="#common-keywords">CSS-wide
441+
<p> All CSS properties also accept the <a href="#common-keywords">CSS-wide
438442
keyword values</a> as the sole component of their property value. For
439443
readability these are not listed explicitly in the property value syntax
440444
definitions. For example, the full value definition of <a
441445
href="http://www.w3.org/TR/css3-background/#border-color"><code
442-
class=property>border-color</code></a> is ‘<code class=css>[
443-
&lt;color>{1,4} ] | inherit | initial</code>’ (even though it is listed
444-
as ‘<code class=css>&lt;color>{1,4}</code>’).
446+
class=property>border-color</code></a> is ‘<code
447+
class=css>&lt;color>{1,4} | inherit | initial | unset</code>’ (even
448+
though it is listed as ‘<code class=css>&lt;color>{1,4}</code>’).
445449

446450
<p class=note> Note: This implies that, in general, combining these
447451
keywords with other component values in the same declaration results in an
@@ -476,10 +480,6 @@ <h3 id=component-combinators><span class=secno>2.2. </span> Component value
476480
<pre>
477481
<!----> a b | c || d && e f
478482
<!---->[ a b ] | [ c || [ d && [ e f ]]]</pre>
479-
<!--
480-
<p>
481-
White space is allowed, but optional, between components of a combination.
482-
-->
483483

484484
<h3 id=component-multipliers><span class=secno>2.3. </span> Component value
485485
multipliers</h3>
@@ -495,20 +495,23 @@ <h3 id=component-multipliers><span class=secno>2.3. </span> Component value
495495
one or more times.
496496

497497
<li>A question mark (?) indicates that the preceding type, word, or group
498-
is optional.
498+
is optional (occurs zero or one times).
499+
500+
<li>A single number in curly braces ({<var>A</var>}) indicates that the
501+
preceding type, word, or group occurs <var>A</var> times.
499502

500-
<li>A pair of numbers in curly braces ({<var>A</var>,<var>B</var>})
501-
indicates that the preceding type, word, or group occurs at least
502-
<var>A</var> and at most <var>B</var> times.
503+
<li>A comma-separated pair of numbers in curly braces
504+
({<var>A</var>,<var>B</var>}) indicates that the preceding type, word, or
505+
group occurs at least <var>A</var> and at most <var>B</var> times. The
506+
<var>B</var> may be omitted ({<var>A</var>,}) to indicate that there must
507+
be at least <var>A</var> repetitions, with no upper bound on the number
508+
of repetitions.
503509

504510
<li>A hash mark (#) indicates that the preceding type, word, or group
505-
occurs one or more times, separated by comma tokens.
511+
occurs one or more times, separated by comma tokens. It may optionally be
512+
followed by the curly brace forms, above, to indicate precisely how many
513+
times the repetition occurs.
506514
</ul>
507-
<!--
508-
<p>
509-
White space is allowed, but optional, between repetitions
510-
and around the comma separator of ''#''-multiplied lists.
511-
-->
512515

513516
<p>For repeated component values (indicated by ‘<code
514517
class=css>*</code>’, ‘<code class=css>+</code>’, or ‘<code
@@ -2362,10 +2365,10 @@ <h3 class=no-num id=normative-references>Normative references</h3>
23622365
<dt id=CSS21>[CSS21]
23632366

23642367
<dd>Bert Bos; et al. <a
2365-
href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
2368+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/"><cite>Cascading Style
23662369
Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
23672370
2011. W3C Recommendation. URL: <a
2368-
href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
2371+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a>
23692372
</dd>
23702373
<!---->
23712374

@@ -2402,9 +2405,9 @@ <h3 class=no-num id=normative-references>Normative references</h3>
24022405
<dt id=CSS3COLOR>[CSS3COLOR]
24032406

24042407
<dd>Tantek Çelik; Chris Lilley; L. David Baron. <a
2405-
href="http://www.w3.org/TR/2011/REC-css3-color-20110607"><cite>CSS Color
2408+
href="http://www.w3.org/TR/2011/REC-css3-color-20110607/"><cite>CSS Color
24062409
Module Level 3.</cite></a> 7 June 2011. W3C Recommendation. URL: <a
2407-
href="http://www.w3.org/TR/2011/REC-css3-color-20110607">http://www.w3.org/TR/2011/REC-css3-color-20110607</a>
2410+
href="http://www.w3.org/TR/2011/REC-css3-color-20110607/">http://www.w3.org/TR/2011/REC-css3-color-20110607/</a>
24082411
</dd>
24092412
<!---->
24102413

css-values/Overview.src.html

+33-28
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,33 @@ <h3 id="component-types">
153153
<var>&lt;border-width></var> and <var>&lt;'border-width'></var>:
154154
the latter is defined as the value of the 'border-width' property,
155155
the former requires an explicit expansion elsewhere.
156-
The definition of a non-terminal is located near its first appearance
156+
The definition of a non-terminal is typically located near its first appearance
157157
in the specification.
158158
</ol>
159159

160-
<p>Some property value definitions also include the slash (/) and/or the
161-
comma (,) as literals. These represent their corresponding tokens.
160+
<p>
161+
Some property value definitions also include the slash (/),
162+
the comma (,),
163+
and/or parentheses as literals.
164+
These represent their corresponding tokens.
165+
Other non-keyword literal characters that may appear in a component value,
166+
such as “+”,
167+
must be written enclosed in single quotes.
168+
169+
<p>
170+
All CSS properties also accept the <a href="#common-keywords">CSS-wide keyword values</a>
171+
as the sole component of their property value.
172+
For readability these are not listed explicitly in the property value syntax definitions.
173+
For example, the full value definition of <a href="http://www.w3.org/TR/css3-background/#border-color">'border-color'</a>
174+
is ''&lt;color>{1,4} | inherit | initial | unset''
175+
(even though it is listed as ''&lt;color>{1,4}'').
162176

163-
<p>All CSS properties also accept the <a href="#common-keywords">CSS-wide keyword values</a>
164-
as the sole component of their property value.
165-
For readability these are not listed explicitly in the property value syntax definitions.
166-
For example, the full value definition of <a href="http://www.w3.org/TR/css3-background/#border-color">'border-color'</a>
167-
is ''[ &lt;color>{1,4} ] | inherit | initial''
168-
(even though it is listed as ''&lt;color>{1,4}'').
169177
<p class="note">
170178
Note: This implies that, in general,
171179
combining these keywords with other component values in the same declaration
172180
results in an invalid declaration.
173181
For example,
174-
''background: url(corner.png) no-repeat, inherit;'' is invalid.
182+
''background: url(corner.png) no-repeat, inherit;'' is invalid.
175183

176184
<h3 id="component-combinators">
177185
Component value combinators</h3>
@@ -197,11 +205,6 @@ <h3 id="component-combinators">
197205
<!----> a b | c || d && e f
198206
<!---->[ a b ] | [ c || [ d && [ e f ]]]</pre>
199207

200-
<!--
201-
<p>
202-
White space is allowed, but optional, between components of a combination.
203-
-->
204-
205208
<h3 id="component-multipliers">
206209
Component value multipliers</h3>
207210

@@ -210,28 +213,30 @@ <h3 id="component-multipliers">
210213

211214
<ul>
212215
<li>An asterisk (*) indicates that the preceding type, word, or
213-
group occurs zero or more times.
216+
group occurs zero or more times.
214217

215218
<li>A plus (+) indicates that the preceding type, word, or group
216-
occurs one or more times.
219+
occurs one or more times.
217220

218221
<li>A question mark (?) indicates that the preceding type, word, or
219-
group is optional.
222+
group is optional (occurs zero or one times).
223+
224+
<li>A single number in curly braces ({<var>A</var>})
225+
indicates that the preceding type, word, or group occurs <var>A</var> times.
220226

221-
<li>A pair of numbers in curly braces ({<var>A</var>,<var>B</var>})
222-
indicates that the preceding type, word, or group occurs at least
223-
<var>A</var> and at most <var>B</var> times.
227+
<li>A comma-separated pair of numbers in curly braces ({<var>A</var>,<var>B</var>})
228+
indicates that the preceding type, word, or group occurs at least
229+
<var>A</var> and at most <var>B</var> times.
230+
The <var>B</var> may be omitted ({<var>A</var>,})
231+
to indicate that there must be at least <var>A</var> repetitions,
232+
with no upper bound on the number of repetitions.
224233

225234
<li>A hash mark (#) indicates that the preceding type, word, or
226-
group occurs one or more times, separated by comma tokens.
235+
group occurs one or more times, separated by comma tokens.
236+
It may optionally be followed by the curly brace forms, above,
237+
to indicate precisely how many times the repetition occurs.
227238
</ul>
228239

229-
<!--
230-
<p>
231-
White space is allowed, but optional, between repetitions
232-
and around the comma separator of ''#''-multiplied lists.
233-
-->
234-
235240
<p>For repeated component values (indicated by ''*'', ''+'', or ''#''), UAs must support at least 20 repetitions of the component. If a property value contains more than the supported number of repetitions, the declaration must be ignored as if it were invalid.</p>
236241

237242
<h3 id="component-whitespace">

0 commit comments

Comments
 (0)