Skip to content

Commit 0b200ed

Browse files
committed
[css-values] Move over to dfn-type=grammar for the grammar symbols.
1 parent 09509c7 commit 0b200ed

2 files changed

Lines changed: 30 additions & 29 deletions

File tree

css-values/Overview.bs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Component value types</h3>
100100
such as “+”,
101101
must be written enclosed in single quotes.
102102

103-
Commas specified in the grammar are <strong>implicitly omittable</strong> in some circumstances,
103+
<dfn title="," id='comb-comma' export grammar>Commas</dfn> specified in the grammar are <strong>implicitly omittable</strong> in some circumstances,
104104
when used to separate optional terms in the grammar.
105105
Within a top-level list in a property or other CSS value,
106106
or a function's argument list,
@@ -159,7 +159,7 @@ Component value combinators</h3>
159159

160160
Component values can be arranged into property values as follows:
161161

162-
<ul export>
162+
<ul export dfn-type="grammar">
163163
<li>Juxtaposing components means that
164164
all of them must occur, in the given order.
165165
<li>A double ampersand (<dfn id='comb-all'>&&</dfn>) separates two or more components,
@@ -196,7 +196,7 @@ Component value multipliers</h3>
196196
Every type, keyword, or bracketed group may be followed by one of
197197
the following modifiers:
198198

199-
<ul export>
199+
<ul export dfn-type="grammar">
200200
<li>An asterisk (<dfn id='mult-zero-plus'>*</dfn>) indicates that the preceding type, word, or
201201
group occurs zero or more times.
202202

css-values/Overview.html

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ <h3 class="heading settled heading" data-level=2.1 id=component-types><span clas
259259
such as “+”,
260260
must be written enclosed in single quotes.</p>
261261

262-
<p>Commas specified in the grammar are <strong>implicitly omittable</strong> in some circumstances,
262+
<p><dfn data-dfn-type=grammar data-export="" id=comb-comma title=,>Commas<a class=self-link href=#comb-comma></a></dfn> specified in the grammar are <strong>implicitly omittable</strong> in some circumstances,
263263
when used to separate optional terms in the grammar.
264264
Within a top-level list in a property or other CSS value,
265265
or a function’s argument list,
@@ -282,7 +282,7 @@ <h3 class="heading settled heading" data-level=2.1 id=component-types><span clas
282282
but all of them are optional,
283283
the grammar can be written like:
284284

285-
<pre class=prod>example( first? , second? , third? )
285+
<pre class=prod>example( first<a class=prod-punc data-link-type=grammar href=#mult-opt title=?>?</a> <a class=prod-punc data-link-type=grammar href=#comb-comma title=,>,</a> second<a class=prod-punc data-link-type=grammar href=#mult-opt title=?>?</a> <a class=prod-punc data-link-type=grammar href=#comb-comma title=,>,</a> third<a class=prod-punc data-link-type=grammar href=#mult-opt title=?>?</a> )
286286
</pre>
287287

288288
<p>Given this grammar,
@@ -317,14 +317,14 @@ <h3 class="heading settled heading" data-level=2.2 id=component-combinators><spa
317317

318318
<p>Component values can be arranged into property values as follows:</p>
319319

320-
<ul data-export="">
320+
<ul data-dfn-type=grammar data-export="">
321321
<li>Juxtaposing components means that
322322
all of them must occur, in the given order.
323-
<li>A double ampersand (<dfn data-dfn-type=dfn data-export="" id=comb-all>&amp;&amp;<a class=self-link href=#comb-all></a></dfn>) separates two or more components,
323+
<li>A double ampersand (<dfn data-dfn-type=grammar data-export="" id=comb-all>&amp;&amp;<a class=self-link href=#comb-all></a></dfn>) separates two or more components,
324324
all of which must occur, in any order.
325-
<li>A double bar (<dfn data-dfn-type=dfn data-export="" id=comb-any>||<a class=self-link href=#comb-any></a></dfn>) separates two or more options:
325+
<li>A double bar (<dfn data-dfn-type=grammar data-export="" id=comb-any>||<a class=self-link href=#comb-any></a></dfn>) separates two or more options:
326326
one or more of them must occur, in any order.
327-
<li>A bar (<dfn data-dfn-type=dfn data-export="" id=comb-one>|<a class=self-link href=#comb-one></a></dfn>) separates two or more alternatives:
327+
<li>A bar (<dfn data-dfn-type=grammar data-export="" id=comb-one>|<a class=self-link href=#comb-one></a></dfn>) separates two or more alternatives:
328328
exactly one of them must occur.
329329
<li>Brackets ([ ]) are for grouping.
330330
</ul>
@@ -352,40 +352,40 @@ <h3 class="heading settled heading" data-level=2.3 id=component-multipliers><spa
352352
<p>Every type, keyword, or bracketed group may be followed by one of
353353
the following modifiers:</p>
354354

355-
<ul data-export="">
356-
<li>An asterisk (<dfn data-dfn-type=dfn data-export="" id=mult-zero-plus>*<a class=self-link href=#mult-zero-plus></a></dfn>) indicates that the preceding type, word, or
355+
<ul data-dfn-type=grammar data-export="">
356+
<li>An asterisk (<dfn data-dfn-type=grammar data-export="" id=mult-zero-plus>*<a class=self-link href=#mult-zero-plus></a></dfn>) indicates that the preceding type, word, or
357357
group occurs zero or more times.
358358

359-
<li>A plus (<dfn data-dfn-type=dfn data-export="" id=mult-one-plus>+<a class=self-link href=#mult-one-plus></a></dfn>) indicates that the preceding type, word, or group
359+
<li>A plus (<dfn data-dfn-type=grammar data-export="" id=mult-one-plus>+<a class=self-link href=#mult-one-plus></a></dfn>) indicates that the preceding type, word, or group
360360
occurs one or more times.
361361

362-
<li>A question mark (<dfn data-dfn-type=dfn data-export="" id=mult-opt>?<a class=self-link href=#mult-opt></a></dfn>) indicates that the preceding type, word, or
362+
<li>A question mark (<dfn data-dfn-type=grammar data-export="" id=mult-opt>?<a class=self-link href=#mult-opt></a></dfn>) indicates that the preceding type, word, or
363363
group is optional (occurs zero or one times).
364364

365-
<li>A single number in curly braces (<dfn data-dfn-type=dfn data-export="" id=mult-num>{<var>A</var>}<a class=self-link href=#mult-num></a></dfn>)
365+
<li>A single number in curly braces (<dfn data-dfn-type=grammar data-export="" id=mult-num>{<var>A</var>}<a class=self-link href=#mult-num></a></dfn>)
366366
indicates that the preceding type, word, or group occurs <var>A</var> times.
367367

368-
<li>A comma-separated pair of numbers in curly braces (<dfn data-dfn-type=dfn data-export="" id=mult-num-range>{<var>A</var>,<var>B</var>}<a class=self-link href=#mult-num-range></a></dfn>)
368+
<li>A comma-separated pair of numbers in curly braces (<dfn data-dfn-type=grammar data-export="" id=mult-num-range>{<var>A</var>,<var>B</var>}<a class=self-link href=#mult-num-range></a></dfn>)
369369
indicates that the preceding type, word, or group occurs at least
370370
<var>A</var> and at most <var>B</var> times.
371371
The <var>B</var> may be omitted ({<var>A</var>,})
372372
to indicate that there must be at least <var>A</var> repetitions,
373373
with no upper bound on the number of repetitions.
374374

375-
<li>A hash mark (<dfn data-dfn-type=dfn data-export="" id=mult-comma>#<a class=self-link href=#mult-comma></a></dfn>) indicates that the preceding type, word, or
375+
<li>A hash mark (<dfn data-dfn-type=grammar data-export="" id=mult-comma>#<a class=self-link href=#mult-comma></a></dfn>) indicates that the preceding type, word, or
376376
group occurs one or more times, separated by comma tokens
377377
(which may optionally be surrounded by white space and/or comments).
378378
It may optionally be followed by the curly brace forms, above,
379379
to indicate precisely how many times the repetition occurs,
380380
like <span class=css data-link-type=maybe title="<length>#{1,4}">&lt;length&gt;#{1,4}</span>.
381381

382-
<li>An exclamation point (<dfn data-dfn-type=dfn data-export="" id=mult-req>!<a class=self-link href=#mult-req></a></dfn>) after a group indicates that the group is required
382+
<li>An exclamation point (<dfn data-dfn-type=grammar data-export="" id=mult-req>!<a class=self-link href=#mult-req></a></dfn>) after a group indicates that the group is required
383383
and must produce at least one value;
384384
even if the grammar of the items within the group would otherwise allow the entire contents to be omitted,
385385
at least one component value must not be omitted.
386386
</ul>
387387

388-
<p>For repeated component values (indicated by <a class=css data-link-type=maybe href=#mult-zero-plus title=*>*</a>, <a class=css data-link-type=maybe href=#mult-one-plus title=+>+</a>, or <a class=css data-link-type=maybe href=#mult-comma title=#>#</a>),
388+
<p>For repeated component values (indicated by <span class=css data-link-type=maybe title=*>*</span>, <span class=css data-link-type=maybe title=+>+</span>, or <span class=css data-link-type=maybe title=#>#</span>),
389389
UAs must support at least 20 repetitions of the component.
390390
If a property value contains more than the supported number of repetitions,
391391
the declaration must be ignored as if it were invalid.</p>
@@ -684,7 +684,7 @@ <h3 class="heading settled heading" data-level=4.1 id=integers><span class=secno
684684
An <dfn data-dfn-type=dfn data-noexport="" id=integer>integer<a class=self-link href=#integer></a></dfn> is one or more decimal digits <span class=css data-link-type=maybe title=0>0</span> through <span class=css data-link-type=maybe title=9>9</span>
685685
and corresponds to a subset of the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-syntax-3/#typedef-number-token title="<number-token>">&lt;number-token&gt;</a> production
686686
in the <a href=http://www.w3.org/TR/css-syntax/>CSS Syntax Module</a> <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3syn title=biblio-css3syn>[CSS3SYN]</a>.
687-
The first digit of an integer may be immediately preceded by <span class=css data-link-type=maybe title=->-</span> or <a class=css data-link-type=maybe href=#mult-one-plus title=+>+</a>
687+
The first digit of an integer may be immediately preceded by <span class=css data-link-type=maybe title=->-</span> or <span class=css data-link-type=maybe title=+>+</span>
688688
to indicate the integer’s sign.</p>
689689

690690
<h3 class="heading settled heading" data-level=4.2 id=numbers><span class=secno>4.2 </span><span class=content>
@@ -695,7 +695,7 @@ <h3 class="heading settled heading" data-level=4.2 id=numbers><span class=secno>
695695
or zero or more decimal digits followed by a dot (.) followed by one or more decimal digits.
696696
It corresponds to the <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-syntax-3/#typedef-number-token title="<number-token>">&lt;number-token&gt;</a> production
697697
in the <a href=http://www.w3.org/TR/css-syntax/>CSS Syntax Module</a> <a data-biblio-type=normative data-link-type=biblio href=#biblio-css3syn title=biblio-css3syn>[CSS3SYN]</a>.
698-
As with integers, the first character of a number may be immediately preceded by <span class=css data-link-type=maybe title=->-</span> or <a class=css data-link-type=maybe href=#mult-one-plus title=+>+</a>
698+
As with integers, the first character of a number may be immediately preceded by <span class=css data-link-type=maybe title=->-</span> or <span class=css data-link-type=maybe title=+>+</span>
699699
to indicate the number’s sign.</p>
700700

701701
<h3 class="heading settled heading" data-level=4.3 id=percentages><span class=secno>4.3 </span><span class=content>
@@ -1168,7 +1168,7 @@ <h3 class="heading settled heading" data-level=8.1 id=calc-notation><span class=
11681168
Mathematical Expressions: <a class=css data-link-type=maybe href=#funcdef-calc title=calc()>calc()</a></span><a class=self-link href=#calc-notation></a></h3>
11691169

11701170
<p>The <dfn class=css-code data-dfn-type=function data-export="" id=funcdef-calc>calc()<a class=self-link href=#funcdef-calc></a></dfn> function allows mathematical expressions
1171-
with addition (<a class=css data-link-type=maybe href=#mult-one-plus title=+>+</a>), subtraction (<span class=css data-link-type=maybe title=->-</span>), multiplication (<a class=css data-link-type=maybe href=#mult-zero-plus title=*>*</a>), and division (<span class=css data-link-type=maybe title=/>/</span>)
1171+
with addition (<span class=css data-link-type=maybe title=+>+</span>), subtraction (<span class=css data-link-type=maybe title=->-</span>), multiplication (<span class=css data-link-type=maybe title=*>*</span>), and division (<span class=css data-link-type=maybe title=/>/</span>)
11721172
to be used as component values.
11731173
The <a class=css data-link-type=maybe href=#funcdef-calc title=calc()>calc()</a> expression represents the result of the mathematical calculation it contains,
11741174
using standard operator precedence rules.
@@ -1244,15 +1244,15 @@ <h4 class="heading settled heading" data-level=8.1.1 id=calc-syntax><span class=
12441244
<p>The syntax of a <a class=css data-link-type=maybe href=#funcdef-calc title=calc()>calc()</a> function is:</p>
12451245

12461246
<pre class=prod><a class="production css-code" data-link-type=function href=#funcdef-calc title=calc()>&lt;calc()&gt;</a> = calc( <a class="production css-code" data-link-type=type href=#typedef-calc-sum title="<calc-sum>">&lt;calc-sum&gt;</a> )
1247-
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-calc-sum>&lt;calc-sum&gt;<a class=self-link href=#typedef-calc-sum></a></dfn> = <a class="production css-code" data-link-type=type href=#typedef-calc-product title="<calc-product>">&lt;calc-product&gt;</a> [ [ '+' | '-' ] <a class="production css-code" data-link-type=type href=#typedef-calc-product title="<calc-product>">&lt;calc-product&gt;</a> ]*
1248-
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-calc-product>&lt;calc-product&gt;<a class=self-link href=#typedef-calc-product></a></dfn> = <a class="production css-code" data-link-type=type href=#typedef-calc-value title="<calc-value>">&lt;calc-value&gt;</a> [ '*' <a class="production css-code" data-link-type=type href=#typedef-calc-value title="<calc-value>">&lt;calc-value&gt;</a> | '/' <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a> ]*
1249-
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-calc-value>&lt;calc-value&gt;<a class=self-link href=#typedef-calc-value></a></dfn> = <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a> | <a class="production css-code" data-link-type=type href=#typedef-dimension title="<dimension>">&lt;dimension&gt;</a> | <a class="production css-code" data-link-type=type href=#percentage-value title="<percentage>">&lt;percentage&gt;</a> | ( <a class="production css-code" data-link-type=type href=#typedef-calc-sum title="<calc-sum>">&lt;calc-sum&gt;</a> )
1247+
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-calc-sum>&lt;calc-sum&gt;<a class=self-link href=#typedef-calc-sum></a></dfn> = <a class="production css-code" data-link-type=type href=#typedef-calc-product title="<calc-product>">&lt;calc-product&gt;</a> [ [ '<a class=prod-punc data-link-type=grammar href=#mult-one-plus title=+>+</a>' <a class=prod-punc data-link-type=grammar href=#comb-one title=|>|</a> '-' ] <a class="production css-code" data-link-type=type href=#typedef-calc-product title="<calc-product>">&lt;calc-product&gt;</a> ]<a class=prod-punc data-link-type=grammar href=#mult-zero-plus title=*>*</a>
1248+
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-calc-product>&lt;calc-product&gt;<a class=self-link href=#typedef-calc-product></a></dfn> = <a class="production css-code" data-link-type=type href=#typedef-calc-value title="<calc-value>">&lt;calc-value&gt;</a> [ '<a class=prod-punc data-link-type=grammar href=#mult-zero-plus title=*>*</a>' <a class="production css-code" data-link-type=type href=#typedef-calc-value title="<calc-value>">&lt;calc-value&gt;</a> <a class=prod-punc data-link-type=grammar href=#comb-one title=|>|</a> '/' <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a> ]<a class=prod-punc data-link-type=grammar href=#mult-zero-plus title=*>*</a>
1249+
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-calc-value>&lt;calc-value&gt;<a class=self-link href=#typedef-calc-value></a></dfn> = <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a> <a class=prod-punc data-link-type=grammar href=#comb-one title=|>|</a> <a class="production css-code" data-link-type=type href=#typedef-dimension title="<dimension>">&lt;dimension&gt;</a> <a class=prod-punc data-link-type=grammar href=#comb-one title=|>|</a> <a class="production css-code" data-link-type=type href=#percentage-value title="<percentage>">&lt;percentage&gt;</a> <a class=prod-punc data-link-type=grammar href=#comb-one title=|>|</a> ( <a class="production css-code" data-link-type=type href=#typedef-calc-sum title="<calc-sum>">&lt;calc-sum&gt;</a> )
12501250
</pre>
12511251

12521252
<p data-noexport="">Where a <dfn class=css-code data-dfn-type=type data-noexport="" id=typedef-dimension>&lt;dimension&gt;<a class=self-link href=#typedef-dimension></a></dfn> is a <a data-link-type=dfn href=#dimension title=dimension>dimension</a>.
12531253

1254-
<p>In addition, whitespace is required on both sides of the <a class=css data-link-type=maybe href=#mult-one-plus title=+>+</a> and <span class=css data-link-type=maybe title=->-</span> operators.
1255-
(The <a class=css data-link-type=maybe href=#mult-zero-plus title=*>*</a> and <span class=css data-link-type=maybe title=/>/</span> operaters can be used without whitespace around them.)</p>
1254+
<p>In addition, whitespace is required on both sides of the <span class=css data-link-type=maybe title=+>+</span> and <span class=css data-link-type=maybe title=->-</span> operators.
1255+
(The <span class=css data-link-type=maybe title=*>*</span> and <span class=css data-link-type=maybe title=/>/</span> operaters can be used without whitespace around them.)</p>
12561256

12571257
<p>UAs must support <a class=css data-link-type=maybe href=#funcdef-calc title=calc()>calc()</a> expressions of at least 20 terms,
12581258
where each <code>NUMBER</code>, <code>DIMENSION</code>, or <code>PERCENTAGE</code> is a term.
@@ -1292,7 +1292,7 @@ <h4 class="heading settled heading" data-level=8.1.2 id=calc-type-checking><span
12921292

12931293
<ul>
12941294
<li>
1295-
At <a class=css data-link-type=maybe href=#mult-one-plus title=+>+</a> or <span class=css data-link-type=maybe title=->-</span>,
1295+
At <span class=css data-link-type=maybe title=+>+</span> or <span class=css data-link-type=maybe title=->-</span>,
12961296
check that both sides have the same type,
12971297
or that one side is a <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a> and the other is an <a class="production css-code" data-link-type=type href=#integer-value title="<integer>">&lt;integer&gt;</a>.
12981298
If both sides are the same type,
@@ -1301,7 +1301,7 @@ <h4 class="heading settled heading" data-level=8.1.2 id=calc-type-checking><span
13011301
resolve to <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a>.
13021302

13031303
<li>
1304-
At <a class=css data-link-type=maybe href=#mult-zero-plus title=*>*</a>,
1304+
At <span class=css data-link-type=maybe title=*>*</span>,
13051305
check that at least one side is <a class="production css-code" data-link-type=type href=#number-value title="<number>">&lt;number&gt;</a>.
13061306
If both sides are <a class="production css-code" data-link-type=type href=#integer-value title="<integer>">&lt;integer&gt;</a>,
13071307
resolve to <a class="production css-code" data-link-type=type href=#integer-value title="<integer>">&lt;integer&gt;</a>.
@@ -1803,7 +1803,7 @@ <h2 class="no-num heading settled heading" id=changes><span class=content>
18031803
<li>Clarified relative URL resolution for embedded style sheets.
18041804
<li>Clarified {<var>A</var>} variant of {<var>A</var>,<var>B</var>} notation.
18051805
<li>Added notation for restricting the length of comma-separated lists
1806-
specified with the <a class=css data-link-type=maybe href=#mult-comma title=#>#</a> notation.
1806+
specified with the <span class=css data-link-type=maybe title=#>#</span> notation.
18071807
<li>Clarified handling of <a class=css data-link-type=maybe href=#funcdef-toggle title=toggle()>toggle()</a> when used in shorthand declarations.
18081808
<li>Clarified that stringing together re-orderable combinations allows interleaving.
18091809
<li>Changed syntax references from the 2.1 grammar to the Syntax spec.
@@ -1986,6 +1986,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
19861986
<li>#, <a href=#mult-comma title="section 2.3">2.3</a>
19871987
<li>+, <a href=#mult-one-plus title="section 2.3">2.3</a>
19881988
<li>*, <a href=#mult-zero-plus title="section 2.3">2.3</a>
1989+
<li>,, <a href=#comb-comma title="section 2.1">2.1</a>
19891990
<li>?, <a href=#mult-opt title="section 2.3">2.3</a>
19901991
<li>&amp;&amp;, <a href=#comb-all title="section 2.2">2.2</a>
19911992
<li>|, <a href=#comb-one title="section 2.2">2.2</a>

0 commit comments

Comments
 (0)