I believe steps 3.4-7 of fetch @import should be replaced with something similar to this:
-
Let rules and encoding be the result of decode with response and rule.
-
Create a CSS style sheet object with the following properties:
- encoding:
encoding
- location: the result of resolving
rule's URL with ruleOrDeclaration
- media: the media's
mediaText attribute of rule
- origin-clean flag: true if
response URL is CORS-same-origin, otherwise false
- owner CSS Rule:
rule
- parentStyleSheet:
rule's parent style sheet
- rules:
rules
- title:
null
encoding should be a CSSStyleSheet state item because it is required as the environment encoding, if no other encoding has been defined otherwise (BOM, @charset, Content-Type):
The environment encoding of an imported style sheet is the encoding of the style sheet that imported it.
Since decode resolves the "final" encoding used, it should probably be included in its return value.
rules could also be byte stream or response instead. This is an implementation detail.
All browsers set title to null, regardless of the title of the parent style sheet.
edit 1: removed use of create a style sheet since @import-ed style sheets are not included in document stylesheets.
edit 2: replaced same-origin with CORS-same-origin, the difference being basically that a cross-origin request redirected to a same-origin request is still considered as cross-origin (cf. related WPT).
edit 3: added title with null (browser conformance).
I believe steps 3.4-7 of fetch
@importshould be replaced with something similar to this:encodingshould be aCSSStyleSheetstate item because it is required as the environment encoding, if no other encoding has been defined otherwise (BOM,@charset,Content-Type):Since decode resolves the "final" encoding used, it should probably be included in its return value.
rulescould also bebyte streamorresponseinstead. This is an implementation detail.All browsers set
titletonull, regardless of the title of the parent style sheet.edit 1: removed use of create a style sheet since
@import-ed style sheets are not included in document stylesheets.edit 2: replaced same-origin with CORS-same-origin, the difference being basically that a cross-origin request redirected to a same-origin request is still considered as cross-origin (cf. related WPT).
edit 3: added
titlewithnull(browser conformance).