Skip to content

Preserve valid namespace arms in forgiving functional selectors #842

Description

@wieslawsoltes

Problem

The full-V8 package gate fails webscene_selector_parser_tests: a mixed forgiving functional selector such as .subject:is(missing|circle, p|circle) loses the valid declared-namespace arm when Servo rejects the undeclared prefix while parsing the outer selector.

Top-level undeclared prefixes and functional lists containing only invalid arms must still fail closed. This is a generic Selectors behavior used by unchanged Code OSS CSS.

Proposed fix

  • when namespace-aware parsing fails only for a selector containing :is(), :where(), :not(), or :has(), retry syntax parsing with bounded temporary sentinel mappings for syntactically present undeclared prefixes;
  • compile every nested arm against the original namespace context, so invalid arms remain invalid and contribute neither matching nor specificity;
  • accept the functional pseudo only when at least one original-context arm compiles;
  • retain top-level strict rejection, recursion and selector budgets, cache identity, and declared namespace behavior.

Acceptance

Focused selector tests cover top-level rejection, unknown-only rejection, mixed forgiving acceptance, type and attribute namespace arms, nested functional lists, specificity, cache separation and depth bounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvscode-oss/mergedMerged for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions