Parent: #239
CSS epic: #235
Proven gap
WebScene's current owner-backed stylesheet adapter supports a stable top-level cssRules list, insertRule, deleteRule, declaration mutation, media enablement, detach/reattach, and bounded staged publication. A top-level @media rule is parsed and applied, but it is exposed as a generic rule object without the CSSGroupingRule surface: cssRules, insertRule, and deleteRule are absent, nested child identity/parent links cannot be inspected, and nested mutation is impossible.
A Chromium control for @media (min-width: 1px) { .x { display:block } } proves:
- the grouping rule is a
CSSMediaRule with type 4 and normalized conditionText;
mediaRule.cssRules has stable CSSRuleList identity;
- children expose
parentRule === mediaRule and parentStyleSheet === sheet;
mediaRule.insertRule('.x { display:grid }', length) updates computed style synchronously;
- deleting the inserted child restores style and clears that removed child's parent links;
- out-of-range nested insert throws
IndexSizeError, and missing delete index throws TypeError.
Focused scope
- Represent nested
@media children as live rule objects with stable list/rule identity and browser-shaped parent links.
- Implement nested
insertRule/deleteRule validation and synchronous observable recascade through the existing bounded owner publication path.
- Preserve top-level behavior, owner DOM text topology, media activation, detach/reattach, navigation teardown, and the 32 MiB/256-owner staging bounds.
- Keep
@import, @namespace, constructed/adopted sheets, replace/replaceSync, other grouping-rule types, cascade/global-keyword work, and selector metadata outside this slice.
Ownership and non-overlap
Planned implementation and gates are limited to:
experiments/WebScene.NativeEngine.Probe/native/webscene_stylesheet_cssom_compatibility.h;
experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_browser_dom_tests.inc;
- a new
tests/WebPlatformSubset/contracts/cssom-grouping-rule-mutation.html;
- a new dedicated CSSOM grouping profile/evidence file.
Do not touch #292/#245 structural DOM/listener paths, #322 generated line-height paths, #329 stream/service-worker paths, open PR #326 selector metadata, or draft #76.
Acceptance
Parent: #239
CSS epic: #235
Proven gap
WebScene's current owner-backed stylesheet adapter supports a stable top-level
cssRuleslist,insertRule,deleteRule, declaration mutation, media enablement, detach/reattach, and bounded staged publication. A top-level@mediarule is parsed and applied, but it is exposed as a generic rule object without theCSSGroupingRulesurface:cssRules,insertRule, anddeleteRuleare absent, nested child identity/parent links cannot be inspected, and nested mutation is impossible.A Chromium control for
@media (min-width: 1px) { .x { display:block } }proves:CSSMediaRulewith type 4 and normalizedconditionText;mediaRule.cssRuleshas stableCSSRuleListidentity;parentRule === mediaRuleandparentStyleSheet === sheet;mediaRule.insertRule('.x { display:grid }', length)updates computed style synchronously;IndexSizeError, and missing delete index throwsTypeError.Focused scope
@mediachildren as live rule objects with stable list/rule identity and browser-shaped parent links.insertRule/deleteRulevalidation and synchronous observable recascade through the existing bounded owner publication path.@import,@namespace, constructed/adopted sheets,replace/replaceSync, other grouping-rule types, cascade/global-keyword work, and selector metadata outside this slice.Ownership and non-overlap
Planned implementation and gates are limited to:
experiments/WebScene.NativeEngine.Probe/native/webscene_stylesheet_cssom_compatibility.h;experiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_browser_dom_tests.inc;tests/WebPlatformSubset/contracts/cssom-grouping-rule-mutation.html;Do not touch #292/#245 structural DOM/listener paths, #322 generated line-height paths, #329 stream/service-worker paths, open PR #326 selector metadata, or draft #76.
Acceptance