Skip to content

Fix some :is(), :where() and :matches() bugs.#167

Open
wRAR wants to merge 5 commits into
masterfrom
fix-is-where-selector-lists
Open

Fix some :is(), :where() and :matches() bugs.#167
wRAR wants to merge 5 commits into
masterfrom
fix-is-where-selector-lists

Conversation

@wRAR

@wRAR wRAR commented Jul 15, 2026

Copy link
Copy Markdown
Member
  1. :is(a,b) mangle the argument after a comma not followed by whitespace
  2. :is(*, X) drops the universal argument and becomes over-restrictive
  3. :is(:has(X)) translates to a never-matching garbage predicate
  4. Unclosed :is( escapes as RuntimeError, not SelectorSyntaxError
  5. :matches() isn't tested
  6. A ns|* argument of :is()/:where()/:not() becomes a never-matching literal name test (fixes Incorrect use of XPath name() function #18)
  7. name()-literal comparisons don't match node-test semantics under a default namespace

Also applies to :matches (alias for :is) and for :where (shares the implementation with :is).

Found and fixed by an LLM, all test cases validated manually.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.83%. Comparing base (743c6e5) to head (810101e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   96.61%   96.83%   +0.22%     
==========================================
  Files           3        3              
  Lines         885      886       +1     
  Branches      136      136              
==========================================
+ Hits          855      858       +3     
  Misses         14       14              
+ Partials       16       14       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wRAR
wRAR marked this pull request as draft July 16, 2026 04:50
@wRAR
wRAR marked this pull request as ready for review July 16, 2026 18:04
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.

Incorrect use of XPath name() function

1 participant