Skip to content

Match CSS namespace type selectors - #521

Merged
wieslawsoltes merged 1 commit into
mainfrom
feature/cssom-namespace-selector-239
Sep 19, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
feature/cssom-namespace-selector-239

Conversation

@wieslawsoltes

Copy link
Copy Markdown
Collaborator

Problem and behavior

@namespace rules 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..HEAD passed after rebasing onto WebScene 73d0daf9. 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.

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.

Apply CSS namespace rules to type and universal selector matching

1 participant