apply: keep the rules the matcher cannot decide - #286
Merged
Conversation
samoht
force-pushed
the
apply-matcher-coverage
branch
from
August 2, 2026 04:32
97f8b22 to
e834a6e
Compare
samoht
force-pushed
the
apply-matcher-coverage
branch
3 times, most recently
from
August 2, 2026 05:59
e986f27 to
809bd9c
Compare
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
force-pushed
the
apply-matcher-coverage
branch
from
August 2, 2026 06:02
809bd9c to
f279fed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).