Repository navigation
feat: a selector couldn't use a declared namespace prefix - #107
Merged
Merged
Conversation
Syncs Netweir 57a359d (netweir/netweir#336) by foothillsdigital: SelectorList::parse_with takes ParseOptions declaring prefixes and a default namespace the way @namespace rules do, so svg|rect matches only SVG elements. parse declares none and is unchanged. With the column combinator from #103, that finishes #17.
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
A selector could use only
*|and|. Any other prefix, likesvg|rect, was refused, because a query had no way to say what it stood for. That was the rest of #17, after the column combinator in #103.Change
Syncs Netweir 57a359d, netweir/netweir#336 by @foothillsdigital:
SelectorList::parse_with(selector, &ParseOptions { namespaces, default })declares prefixes, and a default namespace, the way@namespacerules do.parsedeclares none and is unchanged, so no existing selector changes meaning.*, not to attribute selectors, as Selectors 3 says. Inside a functional pseudo-class it applies as Selectors 4 says for:is().||and a prefix are told apart, and a test covers where they meet.Closes #17
Tests
cargo test --workspace: 257 test groups, 0 failed. Tokenizer 7,045 and tree construction 3,898 passed, 0 failed.declared_namespace_prefixestest covers prefixes, the default, attribute prefixes and specificity.