Skip to content
Skip the list of specifications

css/selectors/parsing/

parse-state.html

Passes: all 24 assertions match

A parsing check: each value the parser must accept or reject.

Run it in the playgroundThe fileOn GitHubBrowsers’ results on wpt.fyi

Each assertion

A passing assertion got what it asked for, so only a failing one shows what it expected and what it got.

AssertionExpectedGotVerdict
":state(--foo)" should be a valid selectorPasses
":state(bar)" should be a valid selectorPasses
":state(--)" should be a valid selectorPasses
":state(--0)" should be a valid selectorPasses
":host(:state(--foo))" should be a valid selectorPasses
"my-input[type=\"foo\"]:state(checked)" should be a valid selectorPasses
"my-input[type=\"foo\"]:state(--0)::before" should be a valid selectorPasses
"my-input[type=\"foo\"]:state(--0)::part(inner)" should be a valid selectorPasses
"my-input[type=\"foo\"]:state(--0)::part(inner):state(bar)" should be a valid selectorPasses
"::part(inner):state(bar)::before" should be a valid selectorPasses
"::part(inner):state(bar)::after" should be a valid selectorPasses
":state" should be an invalid selectorPasses
":state(" should be an invalid selectorPasses
":state()" should be an invalid selectorPasses
":state(0)" should be an invalid selectorPasses
":state(0rem)" should be an invalid selectorPasses
":state(url())" should be an invalid selectorPasses
":state(foo(1))" should be an invalid selectorPasses
":state(:host)" should be an invalid selectorPasses
"my-input::after:state(foo)" should be an invalid selectorPasses
"::part(inner):state(bar)::before:state(foo)" should be an invalid selectorPasses
"::part(inner):state(bar)::after:state(foo)" should be an invalid selectorPasses
"my-input::first-letter:state(foo)" should be an invalid selectorPasses
"::slotted(foo):state(foo)" should be an invalid selectorPasses

Results of the run of 8 November 2026, engine build 1d7a91105. The data behind every page is open.