Skip to content

[selectors] Should :checked and :indeterminate be exclusive? #9706

Open
@josepharhar

Description

@josepharhar

The :checked and :indeterminate pseudo-classes can apply to <input type=checkbox>:
https://drafts.csswg.org/selectors/#checked
https://drafts.csswg.org/selectors/#indeterminate

These are also defined in the HTML spec here:
https://html.spec.whatwg.org/#selector-checked
https://html.spec.whatwg.org/#selector-indeterminate

WebKit recently implemented support for matching both of these selectors at the same time since the "checked" and "indeterminate" states exist independently and don't force each other on or off when modifying via javascript: WebKit/WebKit#21157

I was going to implement the same behavior in chromium to pass the WPT, but it was pointed out that the idea of matching both at the same time was never discussed here. Can we formally decide to allow this and perhaps add a note to the spec saying that both can match at the same time?

@dbaron @annevk

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions