Parent: #22
Prerequisites: Step 3b
Goal
Implement selector parsing, matching, specificity calculation, and the cascade algorithm.
Implementation
- Selector struct: compounds + combinators (descendant, child, sibling)
- CompoundSelector: type, id, classes, attributes, pseudo-classes
- Attribute selectors: [attr], [attr=val], [attr~=val], etc.
- Pseudo-classes: :hover, :focus, :first-child, :last-child, :nth-child(an+b), :not()
- Specificity(a, b, c) calculation and comparison
- Cascade: collect matching declarations, sort by origin/specificity/order
- Origin: UserAgent, Author, with !important handling
Tests
- Selector parsing, specificity calculation, cascade ordering
- ~15 tests
Acceptance Criteria
- cargo test -p ie-css passes
- Clippy clean
Parent: #22
Prerequisites: Step 3b
Goal
Implement selector parsing, matching, specificity calculation, and the cascade algorithm.
Implementation
Tests
Acceptance Criteria