Repository navigation
Description
Proven gap
After #330, #359, and #362, WebScene's owner-backed stylesheet objects support live rule reflection and mutation but do not expose replaceSync() or replace(). A browser-compatible implementation cannot use these APIs to mutate a <style> or linked sheet: CSSOM permits replacement only for constructed stylesheets.
The focused WPT CSSStyleSheet-constructable-replace-on-regular-sheet.html and a direct Chrome 153 control establish the required behavior for owner-backed sheets:
replaceSync(cssText)synchronously throwsNotAllowedError;replace(cssText)returns a realm-local Promise rejected withNotAllowedError;- missing required arguments and Symbol conversion follow Web IDL (
replaceSyncthrowsTypeError;replacerejects withTypeError); - neither operation changes the existing rules, computed style, rule identity, owner DOM text, or invalidation/publication state;
- the same rejection applies after the owner is detached and the retained sheet no longer has an associated document.
Focused scope
- Add exact constructed-only replacement guards to existing owner-backed stylesheet wrappers.
- Preserve live top-level/nested rules, owner detach/reattach behavior, main/iframe realm isolation, and all existing staged-publication bounds.
- Prove denied replacement performs no stylesheet publication or style/layout invalidation.
- Keep constructed stylesheet creation, successful replacement,
adoptedStyleSheets, imported child sheets, stylesheet metadata/branding, namespaces, and other CSSOM reflection outside this slice.
Missing primitive and ownership boundary
Successful replace / replaceSync remains blocked on a native owner-independent stylesheet identity plus per-document and shadow-root adoption registries. Current native wrappers and __webSceneStageRules publication are keyed to connected <style> / <link> owner nodes. Treating an owner-backed wrapper as constructed would incorrectly allow mutation of a regular sheet and could not model multi-root adoption or teardown. This child therefore implements only the exact regular-sheet rejection semantics and does not expose a misleading constructed-sheet constructor.
Ownership and non-overlap
Planned paths:
experiments/WebScene.NativeEngine.Probe/native/webscene_stylesheet_cssom_compatibility.h;experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_browser_dom_tests.inc;- new
tests/WebPlatformSubset/contracts/cssom-owner-stylesheet-replacement.html; - new dedicated WebPlatformSubset profile.
These paths are disjoint from open docs PR #76, #248 File System Access directories, #266 resource work, AppScene, and vscode-demo.
Acceptance
- Chromium/native contract matches synchronous
replaceSyncthrows, asynchronousreplacerejections, Web IDL argument conversion, realm-local Promise/error objects, detached-owner behavior, and unchanged rule/style state. - Denied replacement preserves sheet/rule/list identity and owner text without stylesheet publication, style invalidation, layout, or scene work.
- A 64-rule, 20-cycle denied-replacement workload stays within the focused timing budget with zero replacement-triggered invalidation/publication.
- A 100-cycle main/iframe create, reject, detach, and navigation gate retains <= 8 MiB V8 heap and <= 64 MiB RSS after warm-up and drains native CSS rules/pending replacements.
Activity
wieslawsoltes commentedon Sep 18, 2026
Implementation is open as PR #369 at exact base
d521dd05f217eb1a43604b357346197d60b5b294, headbce745d100f4e4b950cc20b12fcd3b0a1bfc5106.The focused four-path change adds exact constructed-only guards for existing owner-backed sheets:
replaceSyncthrows synchronously,replacereturns a rejected Promise, missing/Symbol arguments follow Web IDL, and attached/detached main/iframe rules remain unchanged. It does not expose a constructed-sheet constructor or claim adoption support.Current evidence:
The branch was rebased after #367; its four paths remain disjoint from #248, #266, open docs PR #76, AppScene, and vscode-demo.
wieslawsoltes commentedon Sep 18, 2026
PR #369 is rebased after disjoint #368 at exact base
83b2c4e8b3c1cc71e4f4a8f67b8db470a9031f15, head24dd08dd6e14607a17ffbf80aa64834f947307b5. Local direct correctness/performance and native 6/6 were rerun unchanged at this head; the PR body carries the updated evidence.Merge is held for runner coordination. All three exact-head Linux workflows hit the same self-hosted-host exhaustion outside this change: CI fails setup-dotnet extraction, portable V8 completes adapter/cold-process contracts then cannot write/link CMake temp files, and native document configures Clang then cannot write Rust temp artifacts. Every failure reports
No space left on device; exact predecessor #368 passed Linux/macOS CI minutes earlier. Exact-head macOS remains queued/running. No code workaround or scope expansion is planned.