Skip to content

test(css): nothing ran the web-platform-tests selector cases - #105

Merged
jamesconwaydev merged 1 commit into
mainfrom
sync-wpt-selectors
Nov 19, 2026
Merged

jamesconwaydev merged 1 commit into
mainfrom
sync-wpt-selectors

Conversation

@jamesconwaydev

Copy link
Copy Markdown
Collaborator

Problem

Nothing ran WPT's selector tests against Parsec (#19), so there was no outside check on what the selector engine matches.

Change

  • Syncs Netweir c9368c0 (test(css): nothing ran the web-platform-tests selector cases netweir/netweir#339):
    • scripts/wpt-selectors-cases.js extracts the static cases from WPT's dom/nodes selector suite and css/selectors in a Node vm sandbox, at a pinned WPT commit. tests/wpt-selectors.rs runs them.
    • The fixes the cases found:
      • pseudo-elements parse and match nothing, as querySelector has them;
      • :heading and :heading();
      • end of input closes an unfinished [ or (;
      • :dir() takes any keyword;
      • :lang() requires well-formed tags;
      • a forgiving list rejects an argument that never closes.
  • parsec-css: @scope's prelude now rules out a pseudo-element itself, since the selector parser accepts one. A scoping root or limit is an element. A unit test covers it, and the cascade count stays at 1,141.
  • README and ROADMAP mark the WPT item done.

Closes #19

Tests

  • wpt-dom-selectors: 1,719 passed, 0 failed, 8 skipped. wpt-css-selectors: 461 passed, 0 failed, 668 skipped, each with its reason (layout, rendering, shadow trees, tentative syntax).
  • cargo test --workspace: 254 test groups, 0 failed.

Syncs Netweir c9368c0 (netweir/netweir#339): WPT's dom/nodes selector
suite and the static css/selectors cases run in cargo test, 1,719 and
461 passing with none failing, and every skipped case has its reason.
It also brings the fixes those cases found: pseudo-elements parse and
match nothing, as in querySelector; :heading; end of input closes an
unfinished selector; :dir() with any keyword; :lang() needs well-formed
tags.

Now that the selector parser accepts a pseudo-element, @scope's prelude
rules one out itself: a scoping root or limit is an element.
@jamesconwaydev
jamesconwaydev enabled auto-merge (squash) November 19, 2026 12:30
@jamesconwaydev
jamesconwaydev merged commit cbca705 into main Nov 19, 2026
33 checks passed
@jamesconwaydev
jamesconwaydev deleted the sync-wpt-selectors branch November 19, 2026 12:33
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.

Run the web-platform-tests selector cases that don't need layout

1 participant