Repository navigation
fix: selectors CSS rejects parsed, and a comment split a compound - #62
Merged
Merged
Conversation
Synced from Netweir 90fcd03 (netweir/netweir#246), by @foothillsdigital, for #37. A comment between simple selectors no longer reads as whitespace, so a/**/.b is the compound a.b. An+B allows whitespace only where CSS Syntax does, so 2 n and + 5 are errors. An ID selector must be an identifier, so #1a is an error. :has() inside :has() is an error, as Selectors 4 says.
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.
Problem
#37 found four places where the selector parser was looser than CSS: a comment read as whitespace, so
a/**/.bwas a descendant selector; An+B took2 nand+ 5;#1aparsed as an ID; and:has()nested inside:has().Change
Synced from Netweir 90fcd03, netweir/netweir#246, which @foothillsdigital wrote.
NETWEIR_COMMITmoves to that commit. The full write-up, including where Lexbor differs, is on that PR.Tests
selectors_read_as_css_reads_themintests/css.rscovers each case, with the valid forms beside the rejected ones.cargo test,cargo clippy --all-targets -D warningsand the drift check pass locally.Closes #37.