Skip to content

feat: a selector couldn't use a declared namespace prefix - #107

Merged
jamesconwaydev merged 1 commit into
mainfrom
sync-namespaces
Nov 19, 2026
Merged

jamesconwaydev merged 1 commit into
mainfrom
sync-namespaces

Conversation

@jamesconwaydev

Copy link
Copy Markdown
Collaborator

Problem

A selector could use only *| and |. Any other prefix, like svg|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 @namespace rules do.
  • parse declares none and is unchanged, so no existing selector changes meaning.
  • The default namespace applies to type selectors and *, not to attribute selectors, as Selectors 3 says. Inside a functional pseudo-class it applies as Selectors 4 says for :is().
  • Interplay: || and a prefix are told apart, and a test covers where they meet.
  • ROADMAP marks namespace prefixes done.

Closes #17

Tests

  • cargo test --workspace: 257 test groups, 0 failed. Tokenizer 7,045 and tree construction 3,898 passed, 0 failed.
  • The synced declared_namespace_prefixes test covers prefixes, the default, attribute prefixes and specificity.

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.
@jamesconwaydev
jamesconwaydev enabled auto-merge (squash) November 19, 2026 14:31
@jamesconwaydev
jamesconwaydev merged commit 0da79ba into main Nov 19, 2026
33 checks passed
@jamesconwaydev
jamesconwaydev deleted the sync-namespaces branch November 19, 2026 14:37
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.

Namespace prefixes, the column combinator and :nth-col()

1 participant