Skip to content

apply: keep the rules the matcher cannot decide - #286

Merged
samoht merged 3 commits into
mainfrom
apply-matcher-coverage
Aug 4, 2026
Merged

apply: keep the rules the matcher cannot decide#286
samoht merged 3 commits into
mainfrom
apply-matcher-coverage

Conversation

@samoht

@samoht samoht commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Two apply gaps: dynamic-property detection missed @scope, @starting-style, @when, @else and @-moz-document (a declaration moved inline above the kept scoped rule that overrides it) - fixed by an exhaustive Stylesheet.statement_children the traversal and Css.fold now share, so an unlisted future at-rule fails to compile. And the inlinable set exceeded the matcher: [data-k="X" i], namespaced selectors and >>> were inlined onto nobody and dropped - the matcher now answers Matches/No_match/Unsupported with Unsupported dominating, capability is derived from a probe instantiation rather than a second list, and :empty counts text children per Selectors 4 sec. 13.2 (space/tab/segment breaks only, so nbsp is non-empty). Resolve.NODE gains text_children (breaking, noted in CHANGES).

@samoht
samoht force-pushed the apply-matcher-coverage branch from 97f8b22 to e834a6e Compare August 2, 2026 04:32
@samoht
samoht force-pushed the apply-matcher-coverage branch 3 times, most recently from e986f27 to 809bd9c Compare August 2, 2026 05:59
samoht added 3 commits August 1, 2026 23:02
apply moves a declaration into a style attribute when no kept rule sets the
property and the matcher accepts the selector; @scope and @starting-style
blocks escape the first check, and attribute case flags, namespaces and >>>
escape the second. The CLI backend counts element children only, so
<p>text</p> matches :empty.
props_of_stmts listed the block at-rules it descended into and left out @scope,
@starting-style, @when, @else, @-moz-document and the origin wrapper, so a
declaration competing with one of their rules moved inline and won there. The
descent now goes through Stylesheet.statement_children, whose match is
exhaustive.
inlinable listed the selector forms it accepted and accepted more than the
matcher models, so an attribute case flag, a namespace and the >>> and ||
combinators were inlined onto nobody and dropped from the sheet along with
their declarations. The matcher now answers Unsupported apart from No_match
and the inlinable set is read off it, and NODE reports an element's text
children so :empty follows selectors-4 sec. 13.2 rather than counting element
children only.
@samoht
samoht force-pushed the apply-matcher-coverage branch from 809bd9c to f279fed Compare August 2, 2026 06:02
@samoht
samoht merged commit a26e7e7 into main Aug 4, 2026
5 checks passed
@samoht
samoht deleted the apply-matcher-coverage branch August 4, 2026 04: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