Skip to content

Commit 4fce824

Browse files
committed
[css-syntax] Preprocessor fixes.
1 parent c11572d commit 4fce824

2 files changed

Lines changed: 22 additions & 28 deletions

File tree

css-syntax/Overview.html

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</a></p>
1313
<h1 class="p-name no-ref" id=title>CSS Syntax Module Level 3</h1>
1414
<h2 class="no-num no-toc no-ref" id=subtitle><span class=content>Editor's Draft,
15-
<span class=dt-updated><span class=value-title title=20130812>12 August 2013</span></span></span></h2>
15+
<span class=dt-updated><span class=value-title title=20130813>13 August 2013</span></span></span></h2>
1616
<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>Editor's Draft:<dd><a href=http://dev.w3.org/csswg/css-syntax>http://dev.w3.org/csswg/css-syntax</a>
1717
<dt>Feedback:</dt>
1818
<dd><a href="mailto:www-style@w3.org?subject=%5Bcss-syntax%5D%20feedback">www-style@w3.org</a>
@@ -116,7 +116,7 @@ <h2 class="no-num no-toc no-ref" id=contents><span class=content>Table of conten
116116
Informal Syntax Description</a><li><a href=#the-anb-type><span class=secno>6.2</span>
117117
The <code>&lt;an+b&gt;</code> type</a></ul><li><a href=#rule-defs><span class=secno>7</span>
118118
Defining Grammars for Rules and Other Values</a><ul class=toc><li><a href=#declaration-rule-list><span class=secno>7.1</span>
119-
Defining Block Contents: the <span class=production data-link-type=type><var>&lt;declaration-list&gt;</var></span>, <span class=production data-link-type=type><var>&lt;rule-list&gt;</var></span>, and <span class=production data-link-type=type><var>&lt;stylesheet&gt;</var></span> productions</a></ul><li><a href=#css-stylesheets><span class=secno>8</span>
119+
Defining Block Contents: the <span class=production data-link-type=type>&lt;declaration-list&gt;</span>, <span class=production data-link-type=type>&lt;rule-list&gt;</span>, and <span class=production data-link-type=type>&lt;stylesheet&gt;</span> productions</a></ul><li><a href=#css-stylesheets><span class=secno>8</span>
120120
CSS stylesheets</a><ul class=toc><li><a href=#style-rules><span class=secno>8.1</span>
121121
Style rules</a><li><a href=#the-charset-rule><span class=secno>8.2</span>
122122
The <span class=css data-link-type=maybe>@charset</span> Rule</a></ul><li><a href=#serialization><span class=secno>9</span>
@@ -193,8 +193,8 @@ <h2 data-level=2 id=syntax-description><span class=secno>2 </span><span class=co
193193

194194
<p> "<code>color: blue;</code>" is a declaration specifying that,
195195
for the elements that match the selector,
196-
their <a class=property data-link-type=propdesc href=http://www.w3.org/TR/CSS21/colors.html#propdef-color title=color>color</a> property should have the value <span class=css data-link-type=maybe>blue</span>.
197-
Similiarly, their <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-4/#text-decoration0 title=text-decoration>text-decoration</a> property should have the value <span class=css data-link-type=maybe>underline</span>.
196+
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>blue</span>.
197+
Similiarly, 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>underline</span>.
198198
</div>
199199

200200
<p> At-rules are all different, but they have a basic structure in common.
@@ -1914,7 +1914,7 @@ <h3 data-level=5.3 id=parser-entry-points><span class=secno>5.3 </span><span cla
19141914

19151915
<li>
19161916
"<a href=#parse-a-component-value0>Parse a component value</a>" is for things that need to consume a single value,
1917-
like the parsing rules for <span class=css data-link-type=maybe>attr()</span>.
1917+
like the parsing rules for <a class=css data-link-type=maybe href=http://dev.w3.org/csswg/css-values-3/#attr>attr()</a>.
19181918

19191919
<li>
19201920
"<a href=#parse-a-list-of-component-values0>Parse a list of component values</a>" is for the contents of presentational attributes,
@@ -2642,7 +2642,7 @@ <h2 data-level=7 id=rule-defs><span class=secno>7 </span><span class=content>
26422642
<div class=example>
26432643
For example, the syntax of the <span class=css data-link-type=maybe>translateX()</span> function is:
26442644

2645-
<pre>translateX( <a class=production data-link-type=type><var>&lt;translation-value&gt;</var></a> )</pre>
2645+
<pre>translateX( <a class=production data-link-type=type>&lt;translation-value&gt;</a> )</pre>
26462646
<p> However, the stylesheet may end with the function unclosed, like:
26472647

26482648
<pre>.foo { transform: translate(50px</pre>
@@ -2656,7 +2656,7 @@ <h2 data-level=7 id=rule-defs><span class=secno>7 </span><span class=content>
26562656
</div>
26572657

26582658
<h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span class=content>
2659-
Defining Block Contents: the <a class=production data-link-type=type href=#typedef-declaration-list><var>&lt;declaration-list&gt;</var></a>, <a class=production data-link-type=type href=#typedef-rule-list><var>&lt;rule-list&gt;</var></a>, and <a class=production data-link-type=type href=#typedef-stylesheet><var>&lt;stylesheet&gt;</var></a> productions</span><a class=section-link href=#declaration-rule-list>§</a></h3>
2659+
Defining Block Contents: the <a class=production data-link-type=type href=#typedef-declaration-list>&lt;declaration-list&gt;</a>, <a class=production data-link-type=type href=#typedef-rule-list>&lt;rule-list&gt;</a>, and <a class=production data-link-type=type href=#typedef-stylesheet>&lt;stylesheet&gt;</a> productions</span><a class=section-link href=#declaration-rule-list>§</a></h3>
26602660

26612661
<p> The CSS parser is agnostic as to the contents of blocks,
26622662
such as those that come at the end of some at-rules.
@@ -2672,7 +2672,7 @@ <h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span c
26722672
It represents that the contents of the block must be parsed using the <a href=#consume-a-list-of-rules0>consume a list of rules</a> algorithm.
26732673

26742674
<p> Finally, the <dfn data-dfn-type=type id=typedef-stylesheet>&lt;stylesheet&gt;</dfn> production represents a list of rules.
2675-
It is identical to <a class=production data-link-type=type href=#typedef-rule-list><var>&lt;rule-list&gt;</var></a>,
2675+
It is identical to <a class=production data-link-type=type href=#typedef-rule-list>&lt;rule-list&gt;</a>,
26762676
except that blocks using it default to accepting all rules
26772677
that aren't otherwise limited to a particular context.
26782678

@@ -2681,24 +2681,24 @@ <h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span c
26812681
and to contain a list of declarations.
26822682
This is expressed with the following grammar:
26832683

2684-
<pre>@font-face { <a class=production data-link-type=type href=#typedef-declaration-list><var>&lt;declaration-list&gt;</var></a> }</pre>
2684+
<pre>@font-face { <a class=production data-link-type=type href=#typedef-declaration-list>&lt;declaration-list&gt;</a> }</pre>
26852685
<p> This is a complete and sufficient definition of the rule's grammar.
26862686

26872687
<p> For another example,
26882688
<span class=css data-link-type=maybe>@keyframes</span> rules are more complex,
26892689
interpreting their prelude as a name and containing keyframes rules in their block
26902690
Their grammar is:
26912691

2692-
<pre>@keyframes <a class=production data-link-type=type><var>&lt;keyframes-name&gt;</var></a> { <a class=production data-link-type=type href=#typedef-rule-list><var>&lt;rule-list&gt;</var></a> }</pre> </div>
2692+
<pre>@keyframes <a class=production data-link-type=type>&lt;keyframes-name&gt;</a> { <a class=production data-link-type=type href=#typedef-rule-list>&lt;rule-list&gt;</a> }</pre> </div>
26932693

2694-
<p> For rules that use <a class=production data-link-type=type href=#typedef-declaration-list><var>&lt;declaration-list&gt;</var></a>,
2694+
<p> For rules that use <a class=production data-link-type=type href=#typedef-declaration-list>&lt;declaration-list&gt;</a>,
26952695
the spec for the rule must define which properties, descriptors, and/or at-rules are valid inside the rule;
26962696
this may be as simple as saying "The @foo rule accepts the properties/descriptors defined in this specification/section.",
26972697
and extension specs may simply say "The @foo rule additionally accepts the following properties/descriptors.".
26982698
Any declarations or at-rules found inside the block that are not defined as valid
26992699
must be removed from the rule's value.
27002700

2701-
<p> Within a <a class=production data-link-type=type href=#typedef-declaration-list><var>&lt;declaration-list&gt;</var></a>,
2701+
<p> Within a <a class=production data-link-type=type href=#typedef-declaration-list>&lt;declaration-list&gt;</a>,
27022702
<code>!important</code> is automatically invalid on any descriptors.
27032703
If the rule accepts properties,
27042704
the spec for the rule must define whether the properties interact with the cascade,
@@ -2713,25 +2713,25 @@ <h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span c
27132713
define that the allowed declarations are the descriptors defined in the Fonts spec.
27142714
</div>
27152715

2716-
<p> For rules that use <a class=production data-link-type=type href=#typedef-rule-list><var>&lt;rule-list&gt;</var></a>,
2716+
<p> For rules that use <a class=production data-link-type=type href=#typedef-rule-list>&lt;rule-list&gt;</a>,
27172717
the spec for the rule must define what types of rules are valid inside the rule,
2718-
same as <a class=production data-link-type=type href=#typedef-declaration-list><var>&lt;declaration-list&gt;</var></a>,
2718+
same as <a class=production data-link-type=type href=#typedef-declaration-list>&lt;declaration-list&gt;</a>,
27192719
and unrecognized rules must similarly be removed from the rule's value.
27202720

27212721
<div class=example>
27222722
For example, the grammar for <span class=css data-link-type=maybe>@keyframes</span> in the previous example must,
27232723
in addition to what is written there,
2724-
define that the only allowed rules are <a class=production data-link-type=type><var>&lt;keyframe-rule&gt;</var></a>s,
2724+
define that the only allowed rules are <a class=production data-link-type=type>&lt;keyframe-rule&gt;</a>s,
27252725
which are defined as:
27262726

2727-
<pre><a class=production data-link-type=type><var>&lt;keyframe-rule&gt;</var></a> = <a class=production data-link-type=type><var>&lt;keyframe-selector&gt;</var></a> { <a class=production data-link-type=type href=#typedef-declaration-list><var>&lt;declaration-list&gt;</var></a> }</pre>
2727+
<pre><a class=production data-link-type=type>&lt;keyframe-rule&gt;</a> = <a class=production data-link-type=type>&lt;keyframe-selector&gt;</a> { <a class=production data-link-type=type href=#typedef-declaration-list>&lt;declaration-list&gt;</a> }</pre>
27282728
<p> Keyframe rules, then,
27292729
must further define that they accept as declarations all animatable CSS properties,
27302730
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,
27312731
but that they do not interact with the cascade.
27322732
</div>
27332733

2734-
<p> For rules that use <a class=production data-link-type=type href=#typedef-stylesheet><var>&lt;stylesheet&gt;</var></a>,
2734+
<p> For rules that use <a class=production data-link-type=type href=#typedef-stylesheet>&lt;stylesheet&gt;</a>,
27352735
all rules are allowed by default,
27362736
but the spec for the rule may define what types of rules are <em>invalid</em> inside the rule.
27372737

@@ -2740,8 +2740,8 @@ <h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span c
27402740
except more <span class=css data-link-type=maybe>@media</span> rules.
27412741
As such, its grammar is:
27422742

2743-
<pre>@media <a class=production data-link-type=type><var>&lt;media-query-list&gt;</var></a> { <a class=production data-link-type=type href=#typedef-stylesheet><var>&lt;stylesheet&gt;</var></a> }</pre>
2744-
<p> It additionally defines a restriction that the <a class=production data-link-type=type href=#typedef-stylesheet><var>&lt;stylesheet&gt;</var></a> can not contain <span class=css data-link-type=maybe>@media</span> rules,
2743+
<pre>@media <a class=production data-link-type=type>&lt;media-query-list&gt;</a> { <a class=production data-link-type=type href=#typedef-stylesheet>&lt;stylesheet&gt;</a> }</pre>
2744+
<p> It additionally defines a restriction that the <a class=production data-link-type=type href=#typedef-stylesheet>&lt;stylesheet&gt;</a> can not contain <span class=css data-link-type=maybe>@media</span> rules,
27452745
which causes them to be dropped from the outer rule's value if they appear.
27462746
</div>
27472747

@@ -2784,9 +2784,6 @@ <h3 data-level=8.1 id=style-rules><span class=secno>8.1 </span><span class=conte
27842784
The validity of the style rule’s contents have no effect on the validity of the style rule itself.
27852785
Unless otherwise specified, property names are <a href=#ascii-case-insensitive>ASCII case-insensitive</a>.
27862786

2787-
<p> If a <a href=#style-rule>style rule</a> contains multiple declarations with the same name,
2788-
all but the last such declaration are discarded.
2789-
27902787
<p class=note> Note: The names of Custom Properties <a data-biblio-type=informative data-link-type=biblio href=#css-variables title=CSS-VARIABLES>[CSS-VARIABLES]</a> are case-sensitive.
27912788

27922789
<p> <a href=#qualified-rule>Qualified rules</a> at the top-level of a CSS stylesheet are style rules.
@@ -2803,12 +2800,12 @@ <h3 data-level=8.2 id=the-charset-rule><span class=secno>8.2 </span><span class=
28032800
<p> The <dfn data-dfn-type=at-rule id=at-ruledef-charset><a class=css data-link-type=maybe href=#at-ruledef-charset>@charset</a></dfn> rule is a very special <a href=#at-rule>at-rule</a> associated with determining the character encoding of the stylesheet.
28042801
In general, its grammar is:
28052802

2806-
<pre class=prod><dfn data-dfn-type=type id=typedef-at-charset-rule>&lt;at-charset-rule&gt;</dfn> = @charset <a class=production data-link-type=type><var>&lt;string&gt;</var></a>;</pre>
2803+
<pre class=prod><dfn data-dfn-type=type id=typedef-at-charset-rule>&lt;at-charset-rule&gt;</dfn> = @charset <a class=production data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#string-value>&lt;string&gt;</a>;</pre>
28072804
<p> Additionally, an <a class=css data-link-type=maybe href=#at-ruledef-charset>@charset</a> rule is invalid if it is not at the top-level of a stylesheet,
28082805
or if it is not the very first rule of a stylesheet.
28092806

28102807
<p> <a class=css data-link-type=maybe href=#at-ruledef-charset>@charset</a> rules have an <dfn data-dfn-type=dfn id=encoding>encoding</dfn>,
2811-
given by the value of the <a class=production data-link-type=type><var>&lt;string&gt;</var></a>.
2808+
given by the value of the <a class=production data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#string-value>&lt;string&gt;</a>.
28122809

28132810
<p> The <a class=css data-link-type=maybe href=#at-ruledef-charset>@charset</a> rule has <strong>no effect on a stylesheet</strong>.
28142811

css-syntax/Overview.src.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1>CSS Syntax Module Level 3</h1>
99
Editor: Simon Sapin, Mozilla, http://exyr.org/about/
1010
Abstract: This module describes, in general terms, the basic structure and syntax of CSS stylesheets. It defines, in detail, the syntax and parsing of CSS - how to turn a stream of bytes into a meaningful stylesheet.
1111
Ignored Properties: color, animation-timing-function, text-decoration
12-
Ignored Terms: <keyframes-name>, <keyframe-rule>, <keyframe-selector>, <translation-value>, <media-query-list>, <string>
12+
Ignored Terms: <keyframes-name>, <keyframe-rule>, <keyframe-selector>, <translation-value>, <media-query-list>
1313
</pre>
1414

1515
<link href="railroad-diagrams.css" rel="stylesheet" type="text/css">
@@ -2671,9 +2671,6 @@ <h3>
26712671
The validity of the style rule’s contents have no effect on the validity of the style rule itself.
26722672
Unless otherwise specified, property names are <i>ASCII case-insensitive</i>.
26732673

2674-
If a <i>style rule</i> contains multiple declarations with the same name,
2675-
all but the last such declaration are discarded.
2676-
26772674
Note: The names of Custom Properties [[CSS-VARIABLES]] are case-sensitive.
26782675

26792676
<i>Qualified rules</i> at the top-level of a CSS stylesheet are style rules.

0 commit comments

Comments
 (0)