Created attachment 56644 [details]
[IMAGE] Web Inspector Shows Waiting for a useless media="print" resource
HTML5 describes the <link> element's media attribute here:
> However, if the link is an external resource link, then the media attribute
> is prescriptive. The user agent must apply the external resource when the
> media attribute's value matches the environment and the other relevant
> conditions apply, and must not apply it otherwise.
If the browser is unaffected by the media queries in the <link media="...">
then it is safe to assume that the content is not immediately necessary
and time could be better spent download other resources. Also, it may
not be necessary to prevent the DOMContentReady or onload event's
for the resource.
In the attached image, the "print.css" file is a link with media="print". These
styles do not affect the document, yet it was downloaded and delayed some
events from firing.
This also happens for type="alternate stylesheet".
Firing load events before alternate stylesheets have loaded can easily have compatibility consequences - a script running from onload may want to switch stylesheets, for example. Even media="print" stylesheets are exposed via CSSOM.
Loading them after other resources sounds like a great idea to me.
Antti, is this fixed now?