Repository navigation
Description
Proven gap
After #330 and #359, WebScene exposes live owner-backed CSSMediaRule objects with conditionText, nested rule mutation, and bounded publication, but the standard media attribute is absent. Authors cannot obtain the rule's SameObject MediaList, update mediaText, append a medium, delete a medium, or use Web IDL PutForwards assignment.
CSSOM defines CSSMediaRule.media as [SameObject, PutForwards=mediaText]. The WPT CSSOM interface surface and a direct Chromium 153 control require stable MediaList identity, indexed/item reflection, normalized list serialization, mutation through mediaText / appendMedium / deleteMedium, synchronized conditionText and cssText, and immediate style changes.
Focused scope
- Expose a realm-correct
MediaListfor owner-backed top-level and nestedCSSMediaRuleobjects. - Preserve SameObject identity and implement indexed/item access,
mediaText,appendMedium,deleteMedium, and PutForwards assignment through the rule's existing condition state. - Re-serialize enclosing media groups and publish through the existing bounded stylesheet staging path only while attached.
- Preserve rule/list identity, owner DOM text topology, nested mutation, detach behavior, main/iframe realm isolation, and the 32 MiB/1,024-owner staging bounds.
- Keep constructed/adopted sheets,
replace/replaceSync, imports/namespaces, other grouping-rule types, and media-query parser expansion outside this slice. Constructed adoption currently lacks a native owner primitive: native stylesheet wrappers and staged publication are keyed to connected style/link nodes.
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-media-list-mutation.html; - new dedicated WebPlatformSubset profile.
These paths have zero overlap with active #312 PR #354, #248 File System Access work, or draft docs PR #76.
Acceptance
- Chromium/native contract matches interface branding, SameObject and PutForwards behavior, normalized indexed/item reflection, append/delete/error behavior, synchronized condition/cssText, and synchronous computed style.
- Top-level and nested media rules preserve rule/list identity and mutate only their owning cascade while attached; detached mutation cannot recascade the former document.
- Main and iframe realms remain isolated through owner removal/navigation.
- A 64-rule, 20-cycle mutation workload stays within the focused timing budget with bounded invalidation/publication counters.
- A 100-cycle create/mutate/detach/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
Merged through PR #365 as
c4c4ac915918d44919d573539e89e7ace551aa5cfrom exact head6caac6643b05026084618804593be5a83d2db52b, based onb6dfb66051e417fecb328da6639d7dfce7f251eeafter #354 and #363.WebScene now exposes stable realm-local
MediaListobjects for owner-backed top-level and nestedCSSMediaRule.media, including PutForwards assignment, normalized indexed/item/string reflection, append/deduplicate/delete behavior, synchronizedconditionText/cssText, immediate recascade while attached, containing-group serialization, and detached mutation isolation.Final evidence:
CSSMediaRule.media.Constructed/adopted sheets remain in #239 because correct multi-root adoption still requires an owner-independent native stylesheet primitive.