Skip to content

Fixes for canonical(), __repr__, and specificity().#169

Open
wRAR wants to merge 5 commits into
masterfrom
fix-canonical-specificity
Open

Fixes for canonical(), __repr__, and specificity().#169
wRAR wants to merge 5 commits into
masterfrom
fix-canonical-specificity

Conversation

@wRAR

@wRAR wRAR commented Jul 15, 2026

Copy link
Copy Markdown
Member
  1. Selector.canonical() silently drops the :has() combinator
  2. More canonical() outputs that are wrong or unparseable
  3. Matching/SpecificityAdjustment ignore the base selector's specificity (Fixes The specificity computation is wrong for :where and :is #136)
  4. Relation.canonical()/specificity() have dead subselector[…] branches

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.73%. Comparing base (743c6e5) to head (68b38e9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   96.61%   96.73%   +0.12%     
==========================================
  Files           3        3              
  Lines         885      918      +33     
  Branches      136      149      +13     
==========================================
+ Hits          855      888      +33     
  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 17:32
@wRAR
wRAR marked this pull request as draft July 16, 2026 17:35
@wRAR
wRAR marked this pull request as ready for review July 16, 2026 18:24
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.

The specificity computation is wrong for :where and :is

1 participant