Repository navigation
Description
Problem
The native parser and cascade already evaluate authored @supports blocks, but the owner-backed CSSOM compatibility layer exposes each block as a generic CSSRule. Scripts cannot observe CSSSupportsRule / CSSConditionRule / CSSGroupingRule branding, a live stable child rule list, parent links, or nested mutation.
This is the next bounded dynamic CSSOM gap after #366. It does not require the owner-independent stylesheet identity and per-root adoption registries that still block successful constructed/adopted stylesheet replacement.
Browser and WPT-derived authority
Chrome 153 establishes this focused contract:
CSSSupportsRule instanceof CSSConditionRule instanceof CSSGroupingRule instanceof CSSRule;type === CSSRule.SUPPORTS_RULE === 12;- readonly
conditionTextkeeps the authored normalized condition; cssRulesis SameObject and children retainparentRule/parentStyleSheet;- nested
insertRule/deleteRulesynchronously update serialization and computed style; - deletion clears both parent links on the removed child;
- missing arguments throw
TypeError; out-of-range insertion throwsIndexSizeError; multiple rules throwSyntaxError; nested@importthrowsHierarchyRequestError; - a supports group nested inside a media group stays live and publishes immediately.
The behavior follows the CSSOM grouping-rule algorithms and the CSS Conditional Rules CSSSupportsRule interface, reduced to the already supported owner-backed stylesheet path.
Scope and ownership
Exact audited base: b89b0de5cc4ba3aa6b1e359854566082cb42ad62.
Owned paths:
experiments/WebScene.NativeEngine.Probe/native/webscene_stylesheet_cssom_compatibility.hexperiments/WebScene.NativeEngine.Probe/tests/native_v8_runtime_browser_dom_tests.inc- one new dedicated
tests/WebPlatformSubset/contracts/cssom-supports-rule-mutation.html - one new dedicated
tests/WebPlatformSubset/webscene-cssom-supports-rule-mutation-profile.json
The slice is disjoint from open docs consolidation PR #76, #377 / PR #380 File System Access paths, #379 parser-resource work, AppScene, and vscode-demo. It will not modify parser/cascade internals, resource loading, imports/namespaces, constructed/adopted ownership, or successful replacement.
Acceptance gates
- Chrome/native exact contract parity for interface identity, constants, condition reflection, live child identity, errors, detach behavior, serialization, nested media/supports, and synchronous computed style.
- Explicit cascade, layout, staged-publication, scene-build, native-rule, wrapper, and pending-scene counter assertions.
- A 64-rule / 20-cycle mutation gate with recorded p95/max.
- V8 heap and process RSS bounds with no retained rule/wrapper growth.
- 100 main-document/iframe create-mutate-detach/teardown cycles with drained queues.
- Direct exact-head native correctness and dedicated WebPlatformSubset runs before merge.
Completion boundary
This issue completes live CSSSupportsRule grouping reflection and mutation only for existing owner-backed stylesheets. Constructed/adopted sheets, imports/namespaces, other conditional grouping interfaces, and full CSS conditional grammar remain under #239.
Activity
wieslawsoltes commentedon Sep 18, 2026
Implementation starts from fresh current-main worktree at exact base
b89b0de5cc4ba3aa6b1e359854566082cb42ad62after disjoint File System Access PR #380 merged. Native hierarchy verified: #381 parent is #239; #239 remains parented by #235. GitHub permits one native parent, so this is the intended #235 → #239 → #381 chain.wieslawsoltes commentedon Sep 18, 2026
Completed through PR #384 at merge
5a6ab1aa56bca25ad1e056dfc302364924d6481cfrom exact head19f66f07e36dbd6895a8b89992c35a29b6930e32on baseb5b51017ab1888ecdadbb638590afa645ee5f62a.Owner-backed authored and inserted
@supportsblocks now expose liveCSSSupportsRule → CSSConditionRule → CSSGroupingRule → CSSRuleidentity,type/SUPPORTS_RULE12, readonlyconditionText, stable child lists and parent links, nested insertion/deletion, correct detach behavior, and recursive containing-group serialization with synchronous cascade/layout/scene publication. The implementation retains the native parser as condition authority and does not claim broader conditional grammar.Final evidence:
The child is closed and remains natively attached to #239. Post-merge CI/NuGet tails were cancelled.