Skip to content

Reflect and mutate nested CSS style rules for Code OSS #425

Closed

Description

@wieslawsoltes

Parent: #239
Parent epic: #235
Program: #227

Code OSS trigger

Pinned unchanged Code OSS 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c recursively reads CSSStyleRule.cssRules in src/vs/editor/browser/gpu/css/decorationCssRuleExtractor.ts to discover GPU editor decoration rules through CSS nesting. The pinned production source contains nested selectors across 36 CSS files, including diff editors, inline completions, testing, chat, and browser views.

Current failure

WebScene native CSS already expands nested selectors into the cascade, but its CSSOM adapter exposes a nested outer style rule only as declarations: CSSStyleRule.cssRules, insertRule, and deleteRule are absent, post-nesting declaration runs have no CSSNestedDeclarations reflection, and the unchanged recursive consumer stops at the outer rule.

Focused scope

  • Expose SameObject live CSSStyleRule.cssRules with nested CSSStyleRule, grouping-rule, and CSSNestedDeclarations identity and parent links.
  • Support browser-shaped nested insertRule / deleteRule, declaration and selector mutation, serialization, synchronous recascade, and detached isolation.
  • Preserve the style owners DOM text while publishing through the existing bounded native staged replacement path.
  • Add Chrome/WPT-derived semantics, the exact Code OSS recursion, bounded mutation performance, heap/RSS, publication, and 100-cycle main/iframe teardown gates.

Collision boundary

Own only the CSSOM compatibility header, its existing native browser-DOM and performance tests, and one dedicated contract/profile. Do not touch runtime scheduling or FileReader paths in #423, iframe/window-message/cache paths in #81/#421, selector matcher/invalidation work under #237, docs consolidation #76, AppScene, or vscode-demo. Imported stylesheet loading/reflection remains a separate #239 slice.

Activity

  1. added
    vscode-oss/planned
    on Sep 18, 2026
  2. wieslawsoltes commented on Sep 18, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Implemented and merged in #427 at fc71e92f8fcfb38f7385ff355b64381240ebdda5.

    This closes the pinned Code OSS consumer in decorationCssRuleExtractor.ts: recursive nested CSSStyleRule.cssRules reflection now exposes live style/grouping children, CSSNestedDeclarations, standards-shaped selector serialization, mutation, parent links, detachment, and synchronous recascade.

    Validation on the PR head 6cdd985c1a60b8539860895f3b158c2e2713f6d0:

    • portable V8 contract: passed
    • Chrome 153 oracle: 6/6 in the main document and iframe
    • native WPT profile: 1/1 document, 6/6 subtests
    • focused native gate: 20 mutation cycles and 100 lifecycle cycles; p95 4.12 ms, max 6.72 ms
    • teardown: heap 843,184 → 843,184 bytes; roots 200 → 200; rules 0 → 0; nodes 1 → 1
    • adjacent full stylesheet mutation/performance gate: passed, including 256-rule flat sheets, grouping rules, replacement rejection, 100 main-document cycles, and 100 realm cycles; heap 34,435,572 → 34,435,572 bytes

    The redundant broad CI and native-document tails were canceled after the directly affected portable contract and focused local gates passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions