Skip to content

Apply CSS namespace rules to type and universal selector matching #518

Closed

Description

@wieslawsoltes

Problem

WebScene reflects @namespace rules through CSSOM, but stylesheet type and universal selectors were compiled without that namespace context. Prefixed, default, any, and empty namespace selectors could therefore match the wrong DOM elements, including after live stylesheet publication.

Implementation

  • Pass the active default/prefix namespace map through the Servo selector parser FFI and native stylesheet preparation.
  • Retain namespace constraints on compiled type and universal compounds and compare them with dom_node.namespace_uri.
  • Include namespace context in shared selector payload/cache identity.
  • Reuse existing owner-backed and adopted-sheet recascade/publication for dynamic updates.
  • Preserve unqualified selector behavior when no default namespace is declared.

Acceptance gates

  • Prefixed, default, any, and empty namespace type/universal selectors match browser behavior.
  • Unknown prefixes and malformed namespace syntax fail closed.
  • Owner-backed and adopted stylesheets recascade after rule deletion/replacement without stale compiled payloads.
  • Selector cache identity separates equal selector text compiled under different namespace maps.
  • Focused parser, native WebPlatform, mutation, performance, and lifecycle coverage remains bounded.

Parent: #239. CSS epic: #235. Builds on #495/#496.

Completion status — 19 September 2026

PR #521 merged as 276d5b77737927a4bd67bfeb523b8a515a7b115f after rebasing over native Stack #517. #519 and #520 retain the namespace-qualified attribute and functional pseudo-class follow-ups.

Parser/native/WPT regression sources were authored but not executed. Only git diff --check ran; execution, performance, memory, lifecycle, and complete-CI qualification remain deferred and are not claimed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions