Skip to content

Match relative sibling :has() selectors - #426

Merged
wieslawsoltes merged 1 commit into
mainfrom
fix/relative-sibling-has-237
Sep 18, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
fix/relative-sibling-has-237

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Collaborator

Problem and result

Unchanged Code OSS uses .monaco-list-row:has(+ .monaco-list-row.selected) and p:has(+ [data-code] > .chat-codeblock-pill-widget). WebScene parsed sibling-leading relative selectors and compiled reverse invalidation routes, but native matching rejected every + and ~ arm.

Anchor each relative arm at :scope, search only its reachable descendant or following-sibling region, and reuse the ordinary compiled selector matcher for the full chain. Class and attribute changes use the existing reverse routes; child-list changes revisit the surviving sibling subjects so final-sibling removal cannot retain stale style.

This is the next focused slice of #237 after #420. It does not touch FileReader/task scheduling, iframe/Window messaging, cache/frame resource paths, AppScene, vscode-demo, or consolidation #76.

Validation

  • Chrome 153: 7/7.
  • Native pre-fix control: 1/7; candidate: 7/7.
  • Servo selector/parser and invalidation-plan executable: pass.
  • Adjacent nested-functional, attribute-invalidation, and structural-scaling native filters: pass.
  • 128 affected sibling groups × 1,000 paired transitions: identical seven-counter results with 32 and 1,024 unrelated rules/nodes; zero fallback visits; 3,097/3,356 ms; byte-exact settled V8 heap; bounded native nodes and RSS.

Detailed evidence: docs/validation/css-relative-sibling-has-20260918.md.

Refs #237, #235, and #227.

@wieslawsoltes
wieslawsoltes merged commit f034e70 into main Sep 18, 2026
2 of 15 checks passed
@wieslawsoltes
wieslawsoltes deleted the fix/relative-sibling-has-237 branch September 18, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant