Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Indicate that style sheets can conditionally block scripts on the media attribute value #2886
Right now Chrome Canary + Safari don't block the initial rendering of a page on the loading/process of style sheets originating from
Seems that Anne, Tab, and Boris feel that it is not necessary to actually block rendering on stylesheets where the link's media attr does not match the UA's environment, and Boris mentioned that https://html.spec.whatwg.org/multipage/semantics.html#interactions-of-styling-and-scripting (3rd para) could probably be changed to reflect this behavior in some way. If it is determined the spec should be changed to support this I wouldn't mind helping out and learning :)
Bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1386840
So what I said is this: https://html.spec.whatwg.org/multipage/semantics.html#interactions-of-styling-and-scripting third paragraph requires browsers to block on media-not-matching sheets (because those are enabled), unless the UA takes advantage of the "A user agent may give up on a style sheet at any time" weasel-wording.
If the spec intends UAs to not block on sheets that have non-matching media, it should say so explicitly.
That sounds reasonable. So a good start would be to turn that third paragraph into a list of conditions for clarity. And then add a conditional that uses https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#matches-the-environment on the value of the media attribute.