Skip to content

Commit c72da5a

Browse files
committed
[css-cascade] Clarify @import to not mess with relative-ordering features, and let features explicitly not work for imported sheets.
1 parent 085ca08 commit c72da5a

File tree

3 files changed

+22
-1798
lines changed

3 files changed

+22
-1798
lines changed

css-cascade-3/Overview.bs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ Importing Style Sheets: the ''@import'' rule</h2>
4545

4646
The <dfn>@import</dfn> rule allows users to import style rules from other style sheets.
4747
If an ''@import'' rule refers to a valid stylesheet,
48-
user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule.
48+
user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule,
49+
with two exceptions:
50+
51+
* If a feature <em>explicitly</em> defines that it only applies to a particular stylesheet,
52+
and not any imported ones
53+
(such as the ''@namespace'' rule),
54+
then it doesn't apply to the imported stylesheet.
55+
* If a feature relies on the relative position of two or more constructs in a stylesheet
56+
(such as the requirement that an ''@else'' rule follow another <a>conditional group rule</a>,
57+
or the requirement that ''@charset'' must not have any other content preceding it),
58+
it only applies between constructs in the same stylesheet.
4959

5060
<p class='example'>
5161
For example, declarations in style rules from imported stylesheets interact with the cascade

css-cascade/Overview.bs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,17 @@ Importing Style Sheets: the ''@import'' rule</h2>
5858

5959
The <dfn>@import</dfn> rule allows users to import style rules from other style sheets.
6060
If an ''@import'' rule refers to a valid stylesheet,
61-
user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule.
61+
user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule,
62+
with two exceptions:
63+
64+
* If a feature <em>explicitly</em> defines that it only applies to a particular stylesheet,
65+
and not any imported ones
66+
(such as the ''@namespace'' rule),
67+
then it doesn't apply to the imported stylesheet.
68+
* If a feature relies on the relative position of two or more constructs in a stylesheet
69+
(such as the requirement that an ''@else'' rule follow another <a>conditional group rule</a>,
70+
or the requirement that ''@charset'' must not have any other content preceding it),
71+
it only applies between constructs in the same stylesheet.
6272

6373
<p class='example'>
6474
For example, declarations in style rules from imported stylesheets interact with the cascade

0 commit comments

Comments
 (0)