Skip to content

Commit 985be24

Browse files
committed
[css-cascade] Make it clearer exactly what origins are being compared for @import in a quirks-mode document. Fixes #4838.
1 parent 8564d14 commit 985be24

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

css-cascade-4/Overview.bs

+9-6
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,15 @@ Processing Stylesheet Imports</h3>
228228
<h3 id='content-type'>
229229
Content-Type of CSS Style Sheets</h3>
230230

231-
The processing of imported style sheets depends on the actual type of the linked resource.
232-
If the resource does not have <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#content-type">Content-Type metadata</a>,
233-
or the host document is in <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#quirks-mode">quirks mode</a>
234-
and has the <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">same origin</a> as the imported style sheet,
235-
the type of the linked resource is <code>text/css</code>.
236-
Otherwise, the type is determined from its <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#content-type">Content-Type metadata</a>.
231+
The processing of imported style sheets depends on the actual type of the linked resource:
232+
233+
* If the resource does not have <l spec=html>[=Content-Type metadata=]</l>,
234+
the type is treated as <code>text/css</code>.
235+
* If the host document is in [=quirks mode=],
236+
and the host document's origin is [=same origin=]
237+
with the linked resource [=/response's=] [=response/URL's=] origin,
238+
the type is treated as <code>text/css</code>.
239+
* Otherwise, the type is determined from its <l spec=html>[=Content-Type metadata=]</l>.
237240

238241
If the linked resource's type is <code>text/css</code>,
239242
it must be interpreted as a CSS style sheet.

css-cascade-5/Overview.bs

+9-6
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,15 @@ Processing Stylesheet Imports</h3>
221221
<h3 id='content-type'>
222222
Content-Type of CSS Style Sheets</h3>
223223

224-
The processing of imported style sheets depends on the actual type of the linked resource.
225-
If the resource does not have <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#content-type">Content-Type metadata</a>,
226-
or the host document is in <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#quirks-mode">quirks mode</a>
227-
and has the <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">same origin</a> as the imported style sheet,
228-
the type of the linked resource is <code>text/css</code>.
229-
Otherwise, the type is determined from its <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#content-type">Content-Type metadata</a>.
224+
The processing of imported style sheets depends on the actual type of the linked resource:
225+
226+
* If the resource does not have <l spec=html>[=Content-Type metadata=]</l>,
227+
the type is treated as <code>text/css</code>.
228+
* If the host document is in [=quirks mode=],
229+
and the host document's origin is [=same origin=]
230+
with the linked resource [=/response's=] [=response/URL's=] origin,
231+
the type is treated as <code>text/css</code>.
232+
* Otherwise, the type is determined from its <l spec=html>[=Content-Type metadata=]</l>.
230233

231234
If the linked resource's type is <code>text/css</code>,
232235
it must be interpreted as a CSS style sheet.

0 commit comments

Comments
 (0)