-
Notifications
You must be signed in to change notification settings - Fork 756
Description
I believe steps 3.4-7 of fetch @import should be replaced with something similar to this:
Let
rulesandencodingbe the result of decode withresponseandrule.Create a CSS style sheet object with the following properties:
- encoding:
encoding- location: the result of resolving
rule's URL withruleOrDeclaration- media: the media's
mediaTextattribute ofrule- origin-clean flag: true if
responseURL has same-origin aslocation, otherwise false- owner CSS Rule:
rule- parentStyleSheet:
rule's parent style sheet- rules:
rules
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.
origin-clean flag should be defined depending on whether response has same-origin instead of CORS-same-origin as the rule's URL. See #12288.
I may be missing other state items. Perhaps title should be rule's parent style sheet title.
edit: removed use of create a style sheet since @import-ed style sheets are not included in document stylesheets.