Skip to content

Specification text for replace() does not match Chromium implementation #123

@nordzilla

Description

@nordzilla

Description

I am currently implementing the replace() functionality for Constructable StyleSheets in Firefox. I noticed that the specification steps for replace() do not match what is implemented in Chromium.

To be clear, I think that what is implemented in Chromium is more desirable than what is described in the spec, and I think that the spec should be updated to reflect this.

Differences

The sheet keeps the new rules, even if an @import rule fails:

Spec

  • In step 5) when an @import rule fails to load, there is no text that says to set the sheet's rules to the new rules, suggesting that the sheet should retain its previous rules.

Actual


Other @import rules are loaded, even if one of them fails.

Spec

  • In step 5) the spec says, "If any of them [the @import rules] failed to load, terminate fetching of the remaining @import rules..."

Actual

Proposed Resolution

I think that the spec text should be modified to convey the following:

  • Assign the new rules to the sheet, even if one or more @import rules fail to load.
  • Continue with loading other @import rules, even if at least one @import rule fail to load.

This is also consistent with how loading @import rules works in contexts other than Constructable StyleSheets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions