Skip to content

Commit 5fbf130

Browse files
committed
[css3-cascade] Try to define the processing model of imported stylesheets.
1 parent 73faa1c commit 5fbf130

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

css3-cascade/Overview.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ <h2 class="no-num no-toc" id=table-of-contents> Table of contents</h2>
135135

136136
<li><a href="#at-import"><span class=secno>2. </span> Importing style
137137
sheets: the ‘<code class=css>@import</code>’ rule</a>
138+
<ul class=toc>
139+
<li><a href="#import-content-type"><span class=secno>2.1. </span>
140+
Content-Type of imported stylesheets</a>
141+
</ul>
138142

139143
<li><a href="#shorthand"><span class=secno>3. </span> Shorthand
140144
Properties</a>
@@ -282,10 +286,47 @@ <h2 id=at-import><span class=secno>2. </span> Importing style sheets: the
282286
Media Queries specification <a href="#MEDIAQ"
283287
rel=biblioentry>[MEDIAQ]<!--{{!MEDIAQ}}--></a>.
284288

289+
<h3 id=import-content-type><span class=secno>2.1. </span> Content-Type of
290+
imported stylesheets</h3>
291+
285292
<p> In the absence of any media queries, the import is unconditional.
286293
Specifying ‘<a href="#all"><code class=css>all</code></a>’ for the
287294
medium has the same effect.
288295

296+
<p> The processing of imported stylesheets depends on the actual type of
297+
the linked resource. If the resource does not have <a
298+
href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type
299+
metadata</a>, or the host document is in <a
300+
href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#quirks-mode">quirks
301+
mode</a> and has the <a
302+
href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#same-origin">
303+
sameorigin</a> as the imported stylesheet, the type of the linked resource
304+
is <code>text/css</code>. Otherwise, the type is determined from its <a
305+
href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type
306+
metadata</a>.
307+
308+
<p> If the linked resource's type is <code>text/css</code>, it must be
309+
interpreted as a CSS stylesheet. Otherwise, if the resource's type denotes
310+
a type of stylesheet that the user agent understands, it must be
311+
interpreted as defined by that type. Otherwise, the resource must not be
312+
interpreted as a stylesheet. The stylesheet keyword may be used with link
313+
elements. This keyword creates an external resource link that contributes
314+
to the styling processing model. The specified resource is a resource that
315+
describes how to present the document. Exactly how the resource is to be
316+
processed depends on the actual type of the resource. If the alternate
317+
keyword is also specified on the link element, then the link is an
318+
alternative stylesheet; in this case, the title attribute must be
319+
specified on the link element, with a non-empty value. The default type
320+
for resources given by the stylesheet keyword is text/css. The appropriate
321+
time to obtain the resource is when the external resource link is created
322+
or when its element is inserted into a document, whichever happens last.
323+
If the resource is an alternative stylesheet then the user agent may defer
324+
obtaining the resource until it is part of the preferred style sheet set.
325+
[CSSOM] Quirk: If the document has been set to quirks mode, has the same
326+
origin as the URL of the external resource, and the Content-Type metadata
327+
of the external resource is not a supported style sheet type, the user
328+
agent must instead assume it to be text/css.
329+
289330
<h2 id=shorthand><span class=secno>3. </span> Shorthand Properties</h2>
290331

291332
<p> Some properties are <dfn id=shorthand-properties>shorthand

css3-cascade/Overview.src.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,43 @@ <h2 id="at-import">
123123
The full syntax of the expressions after the URL
124124
is defined by the Media Queries specification [[!MEDIAQ]].
125125

126+
<h3 id='import-content-type'>
127+
Content-Type of imported stylesheets</h3>
128+
126129
<p>
127130
In the absence of any media queries,
128131
the import is unconditional.
129132
Specifying ''all'' for the medium has the same effect.
130133

134+
<p>
135+
The processing of imported stylesheets depends on the actual type of the linked resource.
136+
If the resource does not have <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a>,
137+
or the host document is in <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#quirks-mode">quirks mode</a>
138+
and has the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#same-origin"> sameorigin</a> as the imported stylesheet,
139+
the type of the linked resource is <code>text/css</code>.
140+
Otherwise, the type is determined from its <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a>.
141+
142+
<p>
143+
If the linked resource's type is <code>text/css</code>,
144+
it must be interpreted as a CSS stylesheet.
145+
Otherwise, if the resource's type denotes a type of stylesheet that the user agent understands,
146+
it must be interpreted as defined by that type.
147+
Otherwise, the resource must not be interpreted as a stylesheet.
148+
149+
150+
151+
The stylesheet keyword may be used with link elements. This keyword creates an external resource link that contributes to the styling processing model.
152+
153+
The specified resource is a resource that describes how to present the document. Exactly how the resource is to be processed depends on the actual type of the resource.
154+
155+
If the alternate keyword is also specified on the link element, then the link is an alternative stylesheet; in this case, the title attribute must be specified on the link element, with a non-empty value.
156+
157+
The default type for resources given by the stylesheet keyword is text/css.
158+
159+
The appropriate time to obtain the resource is when the external resource link is created or when its element is inserted into a document, whichever happens last. If the resource is an alternative stylesheet then the user agent may defer obtaining the resource until it is part of the preferred style sheet set. [CSSOM]
160+
161+
Quirk: If the document has been set to quirks mode, has the same origin as the URL of the external resource, and the Content-Type metadata of the external resource is not a supported style sheet type, the user agent must instead assume it to be text/css.
162+
131163

132164
<h2 id='shorthand'>
133165
Shorthand Properties</h2>

0 commit comments

Comments
 (0)