Skip to content

Fix @import loading during table updates in Firefox - #1

Open
menshikovs wants to merge 1 commit into
rhpaiva:mainfrom
menshikovs:fix/firefox-import-update
Open

menshikovs wants to merge 1 commit into
rhpaiva:mainfrom
menshikovs:fix/firefox-import-update

Conversation

@menshikovs

Copy link
Copy Markdown

Summary

Fix an issue where CSS @import rules can fail to load in Firefox during CSSV table updates.

Problem

In Firefox 155, appending an import-bearing stylesheet to an inert HTMLDocument can prevent an identical import from loading later in a connected Shadow DOM.

This affects CSSV's in-place stylesheet update path.

Solution

  • Detect @import at-rules before entering the detached-document style probe.
  • Fall back to full rendering when imports are present.
  • Preserve in-place updates for ordinary stylesheet changes.
  • Handle escaped and case-insensitive import names.
  • Ignore import-like text inside comments and strings.

Testing

  • Chromium: 91/91 browser tests passed.
  • Firefox: 90/91 browser tests passed.
  • Unit tests: 129/129 passed.

The remaining Firefox failure concerns the existing :lang() behavior across Shadow DOM boundaries ([Mozilla Bug 1579075](https://bugzilla.mozilla.org/show_bug.cgi?id=1579075)) and is unrelated to this change.

No specification changes are required.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant