Skip to content

Commit f00491e

Browse files
committed
[css-syntax] Fix up some markup and add definitions for 'invalid' and 'ignore'
1 parent 82d032d commit f00491e

1 file changed

Lines changed: 22 additions & 15 deletions

File tree

css-syntax/Overview.bs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ Description of CSS's Syntax</h2>
4545

4646
<em>This section is not normative.</em>
4747

48-
A CSS document is a series of <a>qualified rules</a>,
49-
which are usually style rules that apply CSS properties to elements,
50-
and <a>at-rules</a>,
48+
A CSS document is a series of <a>style rules</a>--
49+
which are <a>qualified rules</a> that apply styles to elements in a document--
50+
and <a>at-rules</a>--
5151
which define special processing rules or values for the CSS document.
5252

53-
A qualified rule starts with a prelude
53+
A <a>qualified rule</a> starts with a prelude
5454
then has a {}-wrapped block containing a sequence of declarations.
55-
The meaning of the prelude varies based on the context that the rule appears in -
56-
for style rules, it's a selector which specifies what elements the declarations will apply to.
55+
The meaning of the prelude varies based on the context that the rule appears in--
56+
for <a>style rules</a>, it's a selector which specifies what elements the declarations will apply to.
5757
Each declaration has a name,
5858
followed by a colon and the declaration value.
5959
Declarations are separated by semicolons.
@@ -79,8 +79,8 @@ Description of CSS's Syntax</h2>
7979
Similarly, their 'text-decoration' property should have the value ''underline''.
8080
</div>
8181

82-
At-rules are all different, but they have a basic structure in common.
83-
They start with an "@" <a>code point</a> followed by their name.
82+
<a>At-rules</a> are all different, but they have a basic structure in common.
83+
They start with an "@" <a>code point</a> followed by their name as a CSS keyword.
8484
Some <a>at-rules</a> are simple statements,
8585
with their name followed by more CSS values to specify their behavior,
8686
and finally ended by a semicolon.
@@ -174,13 +174,13 @@ Error Handling</h3>
174174
the parser attempts to recover gracefully,
175175
throwing away only the minimum amount of content
176176
before returning to parsing as normal.
177-
This is because errors aren't always mistakes -
177+
This is because errors aren't always mistakes--
178178
new syntax looks like an error to an old parser,
179179
and it's useful to be able to add new syntax to the language
180180
without worrying about stylesheets that include it being completely broken in older UAs.
181181

182182
The precise error-recovery behavior is detailed in the parser itself,
183-
but it's simple enough that a short description is fairly accurate:
183+
but it's simple enough that a short description is fairly accurate.
184184

185185
<ul>
186186
<li>
@@ -189,7 +189,7 @@ Error Handling</h3>
189189
Anything else starts a qualified rule,
190190
and is included in the rule's prelude.
191191
This may produce an invalid selector,
192-
but that's not the concern of the CSS parser &mdash;
192+
but that's not the concern of the CSS parser--
193193
at worst, it means the selector will match nothing.
194194

195195
<li>
@@ -224,6 +224,13 @@ Error Handling</h3>
224224
and thus thrown away when they are verified against their grammar.
225225
</ul>
226226

227+
After each construct (declaration, style rule, at-rule) is parsed,
228+
the user agent checks it against its expected grammar.
229+
If it does not match the grammar,
230+
it's <dfn export for=css>invalid</dfn>,
231+
and gets <dfn export for=css>ignored</dfn> by the UA,
232+
which treats it as if it wasn't there at all.
233+
227234
<!--
228235
████████ ███████ ██ ██ ████████ ██ ██ ████ ████████ ████ ██ ██ ██████
229236
██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ███ ██ ██ ██
@@ -3189,7 +3196,7 @@ CSS stylesheets</h2>
31893196
first <i>parse a stylesheet</i>.
31903197
Interpret all of the resulting top-level <i>qualified rules</i> as <i>style rules</i>, defined below.
31913198

3192-
If any style rule is invalid,
3199+
If any style rule is <a>invalid</a>,
31933200
or any at-rule is not recognized or is invalid according to its grammar or context,
31943201
it's a <i>parse error</i>.
31953202
Discard that rule.
@@ -3207,15 +3214,15 @@ Style rules</h3>
32073214
The prelude of the qualified rule is parsed as a
32083215
<a href="http://dev.w3.org/csswg/selectors4/#selector-list">selector list</a>.
32093216
If this results in an <a href="http://dev.w3.org/csswg/selectors4/#invalid">invalid selector list</a>,
3210-
the entire style rule is invalid.
3217+
the entire style rule is <a>invalid</a>.
32113218

32123219
The content of the qualified rule’s block is parsed as a
32133220
<a lt="parse a list of declarations">list of declarations</a>.
32143221
Unless defined otherwise by another specification or a future level of this specification,
3215-
at-rules in that list are invalid
3222+
at-rules in that list are <a>invalid</a>
32163223
and must be ignored.
32173224
Declaration for an unknown CSS property
3218-
or whose value does not match the syntax defined by the property are invalid
3225+
or whose value does not match the syntax defined by the property are <a>invalid</a>
32193226
and must be ignored.
32203227
The validity of the style rule’s contents have no effect on the validity of the style rule itself.
32213228
Unless otherwise specified, property names are <a>ASCII case-insensitive</a>.

0 commit comments

Comments
 (0)