Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modern definition of :empty #794

Open
Westbrook opened this issue Oct 7, 2024 · 2 comments
Open

Modern definition of :empty #794

Westbrook opened this issue Oct 7, 2024 · 2 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@Westbrook
Copy link

Description

In Selectors level 4 the CSSWG has spec'd that the :empty pseudo-class will now match when the only contents of an element are white space, e.g. all of the following match :empty:

<p></p>
<p>
<p> </p>
<p></p>

Browsers do not currently deliver this capability, even while developers expect this behavior.

Specification

https://drafts.csswg.org/selectors-4/#the-empty-pseudo

Additional Signals

No response

@gsnedders
Copy link
Member

See also #180 and w3c/csswg-drafts#1967 about whether this change is web compatible.

@gsnedders
Copy link
Member

https://wpt.fyi/results/css/selectors/selectors-empty-001.xml?run_id=5141001291431936&run_id=5160261803835392&run_id=6263739599028224&run_id=5140230613237760 is still asserting the old (Selectors < 4) behaviour, and is still passing everywhere. It seems like nobody wants to take the risk of making the breaking change, moving away from interoperability?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: No status
Development

No branches or pull requests

2 participants