Skip to content

Commit 72dc874

Browse files
committed
[css-syntax] Markup fixes.
--HG-- extra : rebase_source : 47b0b1ff9b6612f76a87728984614b200e2def42
1 parent ac34bec commit 72dc874

2 files changed

Lines changed: 63 additions & 48 deletions

File tree

css-syntax/Overview.html

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ <h2 class="no-num no-toc no-ref" id=contents><span class=content>Table of conten
115115
Informal Syntax Description</a><li><a href=#the-anb-type><span class=secno>6.2</span>
116116
The <code>&lt;an+b&gt;</code> type</a></ul><li><a href=#rule-defs><span class=secno>7</span>
117117
Defining Grammars for Rules and Other Values</a><ul class=toc><li><a href=#declaration-rule-list><span class=secno>7.1</span>
118-
Defining Block Contents: the <var>&lt;declaration-list&gt;</var>, <var>&lt;rule-list&gt;</var>, and <var>&lt;stylesheet&gt;</var> productions</a></ul><li><a href=#css-stylesheets><span class=secno>8</span>CSS stylesheets</a><ul class=toc><li><a href=#style-rules><span class=secno>8.1</span>Style rules</a><li><a href=#charset-rules><span class=secno>8.2</span><span class=css data-autolink=maybe>@charset</span> rules</a><li><a href=#other-at-rules-rules><span class=secno>8.3</span>Other at-rules rules</a></ul><li><a href=#serialization><span class=secno>9</span>Serialization</a><ul class=toc><li><a href=#serializing-anb><span class=secno>9.1</span>
118+
Defining Block Contents: the <span class=production data-autolink=link><var>&lt;declaration-list&gt;</var></span>, <span class=production data-autolink=link><var>&lt;rule-list&gt;</var></span>, and <span class=production data-autolink=link><var>&lt;stylesheet&gt;</var></span> productions</a></ul><li><a href=#css-stylesheets><span class=secno>8</span>
119+
CSS stylesheets</a><ul class=toc><li><a href=#style-rules><span class=secno>8.1</span>
120+
Style rules</a><li><a href=#charset-rules><span class=secno>8.2</span>
121+
<span class=css data-autolink=maybe>@charset</span> rules</a><li><a href=#other-at-rules-rules><span class=secno>8.3</span>
122+
Other at-rules rules</a></ul><li><a href=#serialization><span class=secno>9</span>
123+
Serialization</a><ul class=toc><li><a href=#serializing-anb><span class=secno>9.1</span>
119124
Serializing <var>&lt;an+b&gt;</var></a></ul><li><a href=#changes><span class=secno>10</span>Changes from CSS 2.1 and Selectors Level 3</a><li><a href=#acknowledgments><span class=secno></span>
120125
Acknowledgments</a><li><a href=#conformance><span class=secno></span>
121126
Conformance</a><ul class=toc><li><a href=#conventions><span class=secno></span>
@@ -2584,7 +2589,7 @@ <h2 data-level=7 id=rule-defs><span class=secno>7 </span><span class=content>
25842589
<div class=example>
25852590
For example, the syntax of the <span class=css data-autolink=maybe>translateX()</span> function is:
25862591

2587-
<pre>translateX( &lt;translation-value&gt; )</pre>
2592+
<pre>translateX( <a class=production data-autolink=link><var>&lt;translation-value&gt;</var></a> )</pre>
25882593
<p> However, the stylesheet may end with the function unclosed, like:
25892594

25902595
<pre>.foo { transform: translate(50px</pre>
@@ -2598,23 +2603,23 @@ <h2 data-level=7 id=rule-defs><span class=secno>7 </span><span class=content>
25982603
</div>
25992604

26002605
<h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span class=content>
2601-
Defining Block Contents: the <var>&lt;declaration-list&gt;</var>, <var>&lt;rule-list&gt;</var>, and <var>&lt;stylesheet&gt;</var> productions</span><a class=section-link href=#declaration-rule-list>§</a></h3>
2606+
Defining Block Contents: the <a class=production data-autolink=link href=#declaration-list><var>&lt;declaration-list&gt;</var></a>, <a class=production data-autolink=link href=#rule-list><var>&lt;rule-list&gt;</var></a>, and <a class=production data-autolink=link href=#stylesheet><var>&lt;stylesheet&gt;</var></a> productions</span><a class=section-link href=#declaration-rule-list>§</a></h3>
26022607

26032608
<p> The CSS parser is agnostic as to the contents of blocks,
26042609
such as those that come at the end of some at-rules.
26052610
Defining the generic grammar of the blocks in terms of tokens is non-trivial,
26062611
but there are dedicated and unambiguous algorithms defined for parsing this.
26072612

2608-
<p> The <dfn data-dfn-type=production id=declaration-list><var>&lt;declaration-list&gt;</var></dfn> production represents a list of declarations.
2613+
<p> The <dfn data-dfn-type=production id=declaration-list>&lt;declaration-list&gt;</dfn> production represents a list of declarations.
26092614
It may only be used in grammars as the sole value in a block,
26102615
and represents that the contents of the block must be parsed using the <a href=#consume-a-list-of-declarations0>consume a list of declarations</a> algorithm.
26112616

2612-
<p> Similarly, the <dfn data-dfn-type=production id=rule-list><var>&lt;rule-list&gt;</var></dfn> production represents a list of rules,
2617+
<p> Similarly, the <dfn data-dfn-type=production id=rule-list>&lt;rule-list&gt;</dfn> production represents a list of rules,
26132618
and may only be used in grammars as the sole value in a block.
26142619
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.
26152620

2616-
<p> Finally, the <dfn data-dfn-type=production id=stylesheet><var>&lt;stylesheet&gt;</var></dfn> production represents a list of rules.
2617-
It is identical to <var>&lt;rule-list&gt;</var>,
2621+
<p> Finally, the <dfn data-dfn-type=production id=stylesheet>&lt;stylesheet&gt;</dfn> production represents a list of rules.
2622+
It is identical to <a class=production data-autolink=link href=#rule-list><var>&lt;rule-list&gt;</var></a>,
26182623
except that blocks using it default to accepting all rules
26192624
that aren't otherwise limited to a particular context.
26202625

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

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

26292634
<p> For another example,
26302635
<span class=css data-autolink=maybe>@keyframes</span> rules are more complex,
26312636
interpreting their prelude as a name and containing keyframes rules in their block
26322637
Their grammar is:
26332638

2634-
<pre>@keyframes &lt;keyframes-name&gt; { &lt;rule-list&gt; }</pre> </div>
2639+
<pre>@keyframes <a class=production data-autolink=link><var>&lt;keyframes-name&gt;</var></a> { <a class=production data-autolink=link href=#rule-list><var>&lt;rule-list&gt;</var></a> }</pre> </div>
26352640

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

2643-
<p> Within a <var>&lt;declaration-list&gt;</var>,
2648+
<p> Within a <a class=production data-autolink=link href=#declaration-list><var>&lt;declaration-list&gt;</var></a>,
26442649
<code>!important</code> is automatically invalid on any descriptors.
26452650
If the rule accepts properties,
26462651
the spec for the rule must define whether the properties interact with the cascade,
@@ -2655,25 +2660,25 @@ <h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span c
26552660
define that the allowed declarations are the descriptors defined in the Fonts spec.
26562661
</div>
26572662

2658-
<p> For rules that use <var>&lt;rule-list&gt;</var>,
2663+
<p> For rules that use <a class=production data-autolink=link href=#rule-list><var>&lt;rule-list&gt;</var></a>,
26592664
the spec for the rule must define what types of rules are valid inside the rule,
2660-
same as <var>&lt;declaration-list&gt;</var>,
2665+
same as <a class=production data-autolink=link href=#declaration-list><var>&lt;declaration-list&gt;</var></a>,
26612666
and unrecognized rules must similarly be removed from the rule's value.
26622667

26632668
<div class=example>
26642669
For example, the grammar for <span class=css data-autolink=maybe>@keyframes</span> in the previous example must,
26652670
in addition to what is written there,
2666-
define that the only allowed rules are <var>&lt;keyframe-rule&gt;</var>s,
2671+
define that the only allowed rules are <a class=production data-autolink=link><var>&lt;keyframe-rule&gt;</var></a>s,
26672672
which are defined as:
26682673

2669-
<pre>&lt;keyframe-rule&gt; = &lt;keyframe-selector&gt; { &lt;declaration-list&gt; }</pre>
2674+
<pre><a class=production data-autolink=link><var>&lt;keyframe-rule&gt;</var></a> = <a class=production data-autolink=link><var>&lt;keyframe-selector&gt;</var></a> { <a class=production data-autolink=link href=#declaration-list><var>&lt;declaration-list&gt;</var></a> }</pre>
26702675
<p> Keyframe rules, then,
26712676
must further define that they accept as declarations all animatable CSS properties,
26722677
plus the <a class=property data-autolink=property title=animation-timing-function>animation-timing-function</a> property,
26732678
but that they do not interact with the cascade.
26742679
</div>
26752680

2676-
<p> For rules that use <var>&lt;stylesheet&gt;</var>,
2681+
<p> For rules that use <a class=production data-autolink=link href=#stylesheet><var>&lt;stylesheet&gt;</var></a>,
26772682
all rules are allowed by default,
26782683
but the spec for the rule may define what types of rules are <em>invalid</em> inside the rule.
26792684

@@ -2682,24 +2687,26 @@ <h3 data-level=7.1 id=declaration-rule-list><span class=secno>7.1 </span><span c
26822687
except more <span class=css data-autolink=maybe>@media</span> rules.
26832688
As such, its grammar is:
26842689

2685-
<pre>@media &lt;media-query-list&gt; { &lt;stylesheet&gt; }</pre>
2686-
<p> It additionally defines a restriction that the <var>&lt;stylesheet&gt;</var> can not contain <span class=css data-autolink=maybe>@media</span> rules,
2690+
<pre>@media <a class=production data-autolink=link><var>&lt;media-query-list&gt;</var></a> { <a class=production data-autolink=link href=#stylesheet><var>&lt;stylesheet&gt;</var></a> }</pre>
2691+
<p> It additionally defines a restriction that the <a class=production data-autolink=link href=#stylesheet><var>&lt;stylesheet&gt;</var></a> can not contain <span class=css data-autolink=maybe>@media</span> rules,
26872692
which causes them to be dropped from the outer rule's value if they appear.
26882693
</div>
26892694

26902695

2691-
<h2 data-level=8 id=css-stylesheets><span class=secno>8 </span><span class=content>CSS stylesheets</span><a class=section-link href=#css-stylesheets>§</a></h2>
2696+
<h2 data-level=8 id=css-stylesheets><span class=secno>8 </span><span class=content>
2697+
CSS stylesheets</span><a class=section-link href=#css-stylesheets>§</a></h2>
26922698

26932699
<p> A CSS stylesheet is parsed with <a href=#parse-a-stylesheet0>Parse a stylesheet</a>,
26942700
interpreting the resulting <a href=#qualified-rule>qualified rules</a> and <a href=#at-rule>at-rules</a> as follows.
26952701
Each of these is either transformed into a <a href=#style-rules0>style rule</a> or another type of rule,
26962702
or is found invalid. Invalid rules are ignored with a <a href=#parse-errors>parse errors</a>.
26972703

26982704

2699-
<h3 data-level=8.1 id=style-rules><span class=secno>8.1 </span><span class=content>Style rules</span><a class=section-link href=#style-rules>§</a></h3>
2705+
<h3 data-level=8.1 id=style-rules><span class=secno>8.1 </span><span class=content>
2706+
Style rules</span><a class=section-link href=#style-rules>§</a></h3>
27002707

27012708
<p>
2702-
<dfn data-dfn-type=link id=style-rules0 title="style rule|style rules">Style rules</dfn> are <a href=#qualified-rule>qualified rules</a>
2709+
<dfn data-dfn-type=link id=style-rules0 title="style rule">Style rules</dfn> are <a href=#qualified-rule>qualified rules</a>
27032710
that associate a <a href=http://dev.w3.org/csswg/selectors4/#selector-list>selector list</a> <a data-autolink=biblio data-biblio-type=normative href=#select title=SELECT>[SELECT]</a>
27042711
with a list of property declarations.
27052712
They are also called
@@ -2735,7 +2742,8 @@ <h3 data-level=8.1 id=style-rules><span class=secno>8.1 </span><span class=conte
27352742
but not they’re not inside <span class=css data-autolink=maybe>@keyframes</span> rules <a data-autolink=biblio data-biblio-type=informative href=#css3-animations title=CSS3-ANIMATIONS>[CSS3-ANIMATIONS]</a>.
27362743

27372744

2738-
<h3 data-level=8.2 id=charset-rules><span class=secno>8.2 </span><span class=content><span class=css data-autolink=maybe>@charset</span> rules</span><a class=section-link href=#charset-rules>§</a></h3>
2745+
<h3 data-level=8.2 id=charset-rules><span class=secno>8.2 </span><span class=content>
2746+
<span class=css data-autolink=maybe>@charset</span> rules</span><a class=section-link href=#charset-rules>§</a></h3>
27392747

27402748
<p>
27412749
<dfn data-dfn-type=at-rule id=charset-rules0><span class=css data-autolink=maybe>@charset</span> rules</dfn> are <a href=#at-rule>at-rules</a> whose name is an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for "charset".
@@ -2774,7 +2782,8 @@ <h3 data-level=8.2 id=charset-rules><span class=secno>8.2 </span><span class=con
27742782
of a stylesheet parse from bytes,
27752783
but they don’t have any other effect.
27762784

2777-
<h3 data-level=8.3 id=other-at-rules-rules><span class=secno>8.3 </span><span class=content>Other at-rules rules</span><a class=section-link href=#other-at-rules-rules>§</a></h3>
2785+
<h3 data-level=8.3 id=other-at-rules-rules><span class=secno>8.3 </span><span class=content>
2786+
Other at-rules rules</span><a class=section-link href=#other-at-rules-rules>§</a></h3>
27782787

27792788
<p>
27802789
Other specifications may define specific types of at-rules based on their name.
@@ -2789,7 +2798,8 @@ <h3 data-level=8.3 id=other-at-rules-rules><span class=secno>8.3 </span><span cl
27892798
Margin rules <a data-autolink=biblio data-biblio-type=informative href=#css3page title=CSS3PAGE>[CSS3PAGE]</a> must be directly inside a <span class=css data-autolink=maybe>@page</span> rule.
27902799

27912800

2792-
<h2 data-level=9 id=serialization><span class=secno>9 </span><span class=content>Serialization</span><a class=section-link href=#serialization>§</a></h2>
2801+
<h2 data-level=9 id=serialization><span class=secno>9 </span><span class=content>
2802+
Serialization</span><a class=section-link href=#serialization>§</a></h2>
27932803

27942804
<p> This specification does not define how to serialize CSS in general,
27952805
leaving that task to the CSSOM and individual feature specifications.
@@ -3240,7 +3250,6 @@ <h2 class="no-num no-ref" id=index><span class=content>
32403250
<li>start with an identifier, <a href=#check-if-three-characters-would-start-an-identifier0 title="section 4.3.9">4.3.9</a>
32413251
<li>start with a number, <a href=#check-if-three-characters-would-start-a-number0 title="section 4.3.10">4.3.10</a>
32423252
<li>style rule, <a href=#style-rules0 title="section 8.1">8.1</a>
3243-
<li>style rules, <a href=#style-rules0 title="section 8.1">8.1</a>
32443253
<li>&lt;stylesheet&gt;, <a href=#stylesheet title="section 7.1">7.1</a>
32453254
<li>top-level flag, <a href=#top-level-flag title="section 5.4.1">5.4.1</a>
32463255
<li>uppercase letter, <a href=#uppercase-letter title="section 4.2">4.2</a>

0 commit comments

Comments
 (0)