Skip to content

Fixes for :scope() and :has() parsing and some error paths.#168

Open
wRAR wants to merge 5 commits into
masterfrom
fix-parser-error-paths
Open

Fixes for :scope() and :has() parsing and some error paths.#168
wRAR wants to merge 5 commits into
masterfrom
fix-parser-error-paths

Conversation

@wRAR

@wRAR wRAR commented Jul 15, 2026

Copy link
Copy Markdown
Member
  1. An invalid - "combinator" inside :has() raises KeyError, not a clean error
  2. X|ident silently discards everything parsed before the |; |* is rejected
  3. The :scope start-of-selector rule mis-fires in both directions
  4. *:nth-last-of-type() error message names the wrong pseudo-class
  5. :has() re-tokenizes its argument through a string, accepting strings and breaking escapes
  6. :is()/:where() have a misleading error for :not() arguments
  7. The :scope rejection message mislabels it as an "immediate child pseudo-element"
  8. :nth-child() series parsing is case-sensitive where CSS is not
  9. Trailing whitespace inside a :has() argument is a syntax error

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.67%. Comparing base (743c6e5) to head (12467f0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #168      +/-   ##
==========================================
+ Coverage   96.61%   96.67%   +0.06%     
==========================================
  Files           3        3              
  Lines         885      901      +16     
  Branches      136      142       +6     
==========================================
+ Hits          855      871      +16     
  Misses         14       14              
  Partials       16       16              

☔ 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:05
@wRAR
wRAR force-pushed the fix-parser-error-paths branch from d6cc313 to 12467f0 Compare July 17, 2026 08: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