Conversation
When a selector list contained a part the parser could not handle (an
unknown pseudo-class/-element, an unknown type selector, a malformed
attribute selector), new_from_str_inner warned and skipped only that
token, keeping the rest of the selector. The rule then applied to a
WIDER selector than written: `.word::selection { color: #000 }` became
`.word { color: #000 }`, `p:unknown` became `p`, and
`div unknowntag` became `div ` + dangling descendant combinator.
Per Selectors 4 section 3.7 an invalid selector makes the whole rule
invalid (for a selector list, every selector in it). Track that while
the selector list is read; an invalid rule opens a dropped nesting
level, so neither its declarations nor any nested rule are emitted and
the SkippedRule warning is kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GPPrSydyY9syEfGC74Kch2
fschutt
pushed a commit
to fschutt/pdfocr
that referenced
this pull request
Sep 30, 2026
…tches printpdf comes from fschutt/printpdf#287 (text honours color alpha) as a git dependency; azul-css from fschutt/azul#480 (invalid selectors drop their rule) via [patch.crates-io]. azul-core/-layout stay on 0.0.16: azul master's azul-layout does not build with printpdf's feature set. Cargo.lock is committed so the exact upstream commits are pinned, and CI builds with --locked. patches/ is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GPPrSydyY9syEfGC74Kch2
fschutt
added a commit
that referenced
this pull request
Oct 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyGP18BMbfHvnTRYqNVjbP
fschutt
added a commit
that referenced
this pull request
Oct 2, 2026
PR #480 added NestingLevel::invalid; this branch's nested-@-rule push (the source-order change) had no initializer for it. It is reached only when the parent rule and the selector are valid - the invalid check runs first and continues - so false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyGP18BMbfHvnTRYqNVjbP
This branch has not been deployed
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.
When a selector list contained a part the parser could not handle (an unknown pseudo-class/-element, an unknown type selector, a malformed attribute selector), new_from_str_inner warned and skipped only that token, keeping the rest of the selector. The rule then applied to a WIDER selector than written:
.word::selection { color: #000 }became.word { color: #000 },p:unknownbecamep, anddiv unknowntagbecamediv+ dangling descendant combinator.Per Selectors 4 section 3.7 an invalid selector makes the whole rule invalid (for a selector list, every selector in it). Track that while the selector list is read; an invalid rule opens a dropped nesting level, so neither its declarations nor any nested rule are emitted and the SkippedRule warning is kept.
Claude-Session: https://claude.ai/code/session_01GPPrSydyY9syEfGC74Kch2