Skip to content

Paint CSS Custom Highlight ranges for Code OSS #746

Description

@wieslawsoltes

Active implementation checkpoint — 20 September 2026

Exact upstream heads are WebScene 3cc78ac28101e23f07ded947b44869277da6632d and AppScene acf42662309ea601720ed07c440cf183d7c73fe3; unchanged Code OSS is 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c. Local vscode-demo is 06b5fa4328bae547e40462cbd049b6322f8e8d8e, clean, 294 commits ahead, and intentionally unpushed with Actions disabled.

Focused merge stacks

One-agent mode is enforced. No subagent is active. Reusable runtime behavior continues to land in WebScene or AppScene; unchanged Code OSS remains pinned. The change-related #752 and #753 runs passed. Broad PR CI/NuGet plus consolidation, post-merge main and previous-main runs were canceled to release runners; no WebScene job is intentionally retained between focused PRs. Full package, performance, visual, physical-platform and VM qualification remains deferred under the fast implementation directive; focused parser/native correctness and allocation checks are complete locally.

Next: finish the remaining planned CSS and product features, then physical Linux pixels, synchronization/device-loss/resize/soak/performance, visual comparison, VM/computer-use, and unchanged Code OSS Release qualification. Rich clipboard MIME, MULTIPLE/SAVE_TARGETS, recorded desktop-service/cross-platform work, workspace/Explorer, file/save, terminal, Markdown preview, accessibility, lifecycle, package-size, and no-browser promotion gates remain tracked and incomplete.

Parent: #740
Depends on: #741/#743 and PRs #742/#744 in native stack #745
Epic: #235

Scope

Complete unchanged Code OSS Custom Highlight rendering on top of retained Range/registry state:

  • parse functional ::highlight(<custom-ident>) selectors and preserve the originating selector/cascade metadata;
  • retain only the Code OSS property subset: color and background-color, including custom-property resolution, importance, source order, and stylesheet replacement/removal;
  • intersect registered live ranges with text nodes and retained text fragments using UTF-16 boundary offsets;
  • emit clipped background rectangles before selected glyphs and foreground text spans with the authored color;
  • resolve overlaps by Highlight priority, then registry insertion order; skip collapsed, detached, hidden, display-none, wrong-root, and empty intersections;
  • recompute only on registered Highlight/range/style/text/layout changes; static scenes request zero idle frames and add no DOM/visual-tree nodes;
  • clean range paint on registry deletion, stylesheet mutation, detach, nested-context teardown, navigation, and engine destruction.

Acceptance

  • Unchanged Code OSS chat-find current/other matches and Markdown added/deleted inner ranges paint with authored custom-property colors.
  • Same-node and cross-node ranges, wrapping, collapsed ranges, overlap priority/order, hidden/detached text, registry replacement/deletion, stylesheet mutation, and nested contexts have focused scene contracts.
  • Work counters scale with intersected registered ranges/fragments and are independent of unrelated DOM, rules, and unregistered Highlights.
  • Static highlighted scenes have zero idle frame demand; mutation bursts coalesce; repeated create/delete/navigation return commands, bindings, heap/RSS, and lifecycle counts to baseline.
  • The top of native stack #745 carries the focused implementation gate; lower stack CI can be canceled as redundant.

Complete arbitrary highlight pseudo properties, Range mutation adjustment, spelling/grammar/target-text pseudos, and full Selection paint remain separate work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsize/XLvscode-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