Repository navigation
Description
Problem
Dynamic CSSOM #239 now covers constructed/adopted sheets, replacement, nested style rules, media/supports/layer grouping, and owner-backed mutation. Imported stylesheets remain the explicit gap:
- the compatibility adapter rejects
insertRule('@import …'), drops imports during constructed replacement, and does not exposeCSSImportRule; - linked stylesheet source is parsed natively without retaining the link owner/source for CSSOM reflection;
- imported rules are not represented as child
CSSStyleSheetobjects, so live mutation, parent ownership, teardown, and imported base-URL behavior cannot work coherently.
Proposed implementation
- Retain linked stylesheet source, resolved URL, and owner identity in native state and remove its rules when the owner disconnects.
- Add browser-shaped
CSSImportRulereflection (href,media,styleSheet,parentRule,parentStyleSheet,cssText) and a non-constructed childCSSStyleSheet. - Resolve imported sources through WebScene's existing stylesheet resource policy with bounded depth, byte, and cycle limits and correct nested base URLs.
- Preserve import ordering and media wrapping, flatten only the native publication payload, and keep the authored/import CSSOM tree live.
- Propagate imported rule/declaration/media mutations to the owning top-level sheet without altering owner DOM text.
- Retire imported sheets and pending loads on deletion, owner detach, navigation, and realm teardown.
Acceptance and validation debt
Required before release promotion: pinned Chrome/WPT API and error parity; linked and inline imports; nested relative imports; media/layer/supports qualifiers; insertion/deletion and live child mutation; cycle/failure/cross-origin behavior; disconnect/reconnect/navigation; bounded latency, bytes, heap/RSS, native rule count, and publication queue.
Per the current implementation-throughput directive, implementation will merge without running those build/browser/native/performance/package/CI gates; all remain explicit debt.
Parent: #239. Coordination: #235, #243, #263, and vscode-demo#1.
Activity
wieslawsoltes commentedon Sep 18, 2026
Imported stylesheet support is complete as the merged stack #483 → #484.
7dd8e048bb45b07a12cfa5ddbe3ae732b001840f: bounded recursive@importloading through the existing stylesheet resource policy, nested URL rebasing, media/layer/supports qualifiers, linked owner/source/address identity, disconnect/reconnect retirement, and private source/loader hooks.a42b9da5fb40a585880518668f604735a5af2440: browser-shapedCSSImportRule, live childCSSStyleSheetownership, nested relative imports, live declaration/rule/media mutation, flattened native publication without rewriting owner DOM text, deletion/detach semantics, runtime compatibility coverage, and a browser/native contract/profile.The stack closes #480/#481/#482 and the explicit imported-sheet remainder of #239. Per the implementation-throughput directive, the authored build/browser/native/WPT/performance/memory/lifecycle/package/CI gates were not run; that cumulative validation remains release debt.