Skip to content

Fix invalid selectors - #1309

Open
snowystinger wants to merge 3 commits into
parcel-bundler:masterfrom
snowystinger:fix-invalid-selectors
Open

Fix invalid selectors#1309
snowystinger wants to merge 3 commits into
parcel-bundler:masterfrom
snowystinger:fix-invalid-selectors

Conversation

@snowystinger

Copy link
Copy Markdown

closes: #1239

unlike :is and :where which are forgiving selectors and can be empty, :has is not.

https://www.w3.org/TR/selectors-4/#forgiving-selector
https://www.w3.org/TR/selectors-4/#changes-2022-05

The only thing I'm a little confused on is https://www.w3.org/TR/selectors-4/#has-allowed-pseudo-element says

Also, unless explicitly defined as a :has-allowed pseudo-element, pseudo-elements are not valid selectors within :has(). (This specification does not define any :has-allowed pseudo-elements, but other specifications may do so.)

I'm not sure what the other specifications are which would define these. We could introduce support for this in the future though. Given that it was already removing the inside selector in some scenarios I think this isn't introducing a regression for anyone trying to use an "other specification" allowed pseudo element.

This would've caught and prevented adobe/react-spectrum#10468

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.

Pseudo-element arg inside :has() / :is() / :where() is dropped, leaving an empty () and an invalid output selector

1 participant