W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2018

[csswg-drafts] [cssom] "If loading of the style sheet fails its CSS rul..." (#3452)

From: Matt Falkenhagen via GitHub <sysbot+gh@w3.org>
Date: Tue, 18 Dec 2018 05:27:51 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-392002226-1545110870-sysbot+gh@w3.org>
mattto has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom] "If loading of the style sheet fails its CSS rul..." ==
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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3452 using your GitHub account
Received on Tuesday, 18 December 2018 05:27:52 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:41 UTC