Skip to content

Commit 3e291e6

Browse files
author
Andreu Botella
authored
[css-cascade] Clarify how @import behaves with invalid rules w3c#5358
This change also modifies the mention of @charset as an example of an at-rule with restrictions on its relative ordering to replace it with @namespace, since @charset is no longer considered an at-rule.
1 parent a411825 commit 3e291e6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

css-cascade-3/Overview.bs

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ Importing Style Sheets: the ''@import'' rule</h2>
8383
then it doesn't apply to the imported stylesheet.
8484

8585
* If a feature relies on the relative ordering of two or more constructs in a stylesheet
86-
(such as the requirement that ''@charset'' must not have any other content preceding it),
86+
(such as the requirement that ''@namespace'' rules must not have any other rules other than
87+
''@import'' preceding it),
8788
it only applies between constructs in the same stylesheet.
8889

8990
<p class='example'>
9091
For example, declarations in style rules from imported stylesheets interact with the cascade
9192
as if they were written literally into the stylesheet at the point of the ''@import''.
9293

93-
Any ''@import'' rules must precede all other at-rules and style rules in a style sheet
94-
(besides ''@charset'', which must be the first thing in the style sheet if it exists),
95-
or else the ''@import'' rule is invalid.
94+
Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
95+
(with ''@charset'' counting as an invalid rule), or else the ''@import'' rule is invalid.
9696
The syntax of ''@import'' is:
9797

9898
<pre class='prod'>@import [ <<url>> | <<string>> ] <<media-query-list>>? ;</pre>

css-cascade-4/Overview.bs

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ Importing Style Sheets: the ''@import'' rule</h2>
8989
then it doesn't apply to the imported stylesheet.
9090

9191
* If a feature relies on the relative ordering of two or more constructs in a stylesheet
92-
(such as the requirement that ''@charset'' must not have any other content preceding it),
92+
(such as the requirement that ''@namespace'' rules must not have any other rules other than
93+
''@import'' preceding it),
9394
it only applies between constructs in the same stylesheet.
9495

9596
<p class='example'>
9697
For example, declarations in style rules from imported stylesheets interact with the cascade
9798
as if they were written literally into the stylesheet at the point of the ''@import''.
9899

99-
Any ''@import'' rules must precede all other at-rules and style rules in a style sheet
100-
(besides ''@charset'', which must be the first thing in the style sheet if it exists),
101-
or else the ''@import'' rule is invalid.
100+
Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
101+
(with ''@charset'' counting as an invalid rule), or else the ''@import'' rule is invalid.
102102
The syntax of ''@import'' is:
103103

104104
<pre class='prod'>

0 commit comments

Comments
 (0)