Skip to content

Implement pointer-driven CSS :active state with bounded invalidation #478

Description

@wieslawsoltes

Problem

WebScene parses :active, but the compound matcher has no active-state branch. Unchanged VS Code OSS uses :active extensively for buttons, tabs, list rows, actions, and other pressed feedback, so pointer presses never expose the expected style and visual comparison diverges.

Proposed implementation

  • Add a host-independent pressed target to selector interaction state.
  • Match :active on the pressed target and its inclusive ancestor chain, isolated to the current document tree.
  • Index :active selector dependencies separately from :hover so pointer transitions recascade only affected subjects, descendants, siblings, and custom-property consumers.
  • Enter active state before pointerdown/mousedown dispatch and clear it before pointerup/mouseup, cancellation, teardown, or navigation so synchronous computed-style reads see browser-shaped state.
  • Keep synthetic events and HTMLElement.click() from changing user-interaction state.

Acceptance and deferred validation

The implementation must retain bounded invalidation and support direct, ancestor, descendant, sibling, functional-pseudo, pseudo-element, and custom-property selectors. Browser/WPT/native, performance, memory, lifecycle, exact SDK/package, and CI validation are deliberately deferred under the current implementation-throughput directive and remain required before release promotion.

Parent: #237. Coordination: #235, #242, #243, and vscode-demo#1.

Activity

  1. wieslawsoltes commented on Sep 18, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Implemented and merged in PR #479 as 4d1a13e281fefa2e168c8506a6e4dd0769dc767c.

    The runtime now exposes pointer-driven :active state for the pressed target and its inclusive ancestor chain, maintains a dedicated dependency index separate from :hover, and recascades only affected subject/descendant/sibling/custom-property scopes. State becomes observable before down-event handlers and clears before up-event handlers while click targeting remains independent. Cascade switching, navigation, teardown, low-memory compaction, and memory accounting carry the new state/index.

    Per the implementation-throughput directive, native/browser/WPT, performance, memory, lifecycle, exact-package, and CI validation remain explicit debt before release promotion.

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/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