Repository navigation
Match CSS namespace type selectors - #521
Merged
Merged
Conversation
This was referenced Sep 19, 2026
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 and behavior
@namespacerules were reflected through CSSOM, but the namespace map was discarded before selector matching. A stylesheet such as@namespace svg url(...); svg|path { ... }could therefore match the wrong element namespace.This change carries default and prefix namespace declarations through the Servo selector-parser FFI, native stylesheet preparation, compiled type/universal compounds, shared payload identity, and runtime matching against
dom_node.namespace_uri. Selector cache keys include the sorted namespace context, so identical selector text compiled under different stylesheets cannot reuse incompatible payloads. Existing owner-backed and adopted stylesheet publication performs the dynamic recascade.The focused slice covers prefixed, default, any, and empty namespaces on type/universal selectors. Namespace-qualified attributes are tracked in #519; namespace propagation inside functional pseudo-class selector lists is tracked in #520.
Regression sources
Authored Servo/native parser checks and a WebPlatform contract/profile cover prefixed/default/any/empty namespace matching, cache separation, owner/adopted stylesheet publication, and dynamic rule deletion.
Validation
git diff --check origin/main..HEADpassed after rebasing onto WebScene73d0daf9. Per the current implementation-first direction, builds, test execution, WPT, performance, memory, lifecycle, and complete-CI qualification were not run and are not claimed.Closes #518. Progresses #239 and #235. Builds on #495/#496.