Skip to content

[css-cascade-4][css-syntax-3] *Fetch @import* should *create a CSS style sheet* #13049

Description

@cdoublev

I believe steps 3.4-7 of fetch @import should be replaced with something similar to this:

  1. Let rules and encoding be the result of decode with response and rule.

  2. 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions