-
Notifications
You must be signed in to change notification settings - Fork 757
Description
https://drafts.csswg.org/cssom/#the-cssimportrule-interface
If loading of the style sheet fails its CSS rules list is simply empty,
The specification has this non-normative text but the algorithms seem to contradict it in the case of a network error. When loading fails cssRules, insertRule, and deleteRule would throw a SecurityError, as follows:
cssRules checks the origin-clean flag:
https://drafts.csswg.org/cssom/#dom-cssstylesheet-cssrules
This is set to true iff CORS-same-origin:
https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet
CORS-same-origin is false for “error” responses:
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-same-origin
I've just updated Chrome to match this algorithm and added WPT css/cssom/stylesheet-same-origin.sub.html accordingly.