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

[selectors-4] Is current spec for :empty web compatible? #8106

Open
nt1m opened this issue Nov 19, 2022 · 2 comments
Open

[selectors-4] Is current spec for :empty web compatible? #8106

nt1m opened this issue Nov 19, 2022 · 2 comments
Labels
selectors-4 Current Work

Comments

@nt1m
Copy link
Member

nt1m commented Nov 19, 2022

https://w3c.github.io/csswg-drafts/selectors-4/#the-empty-pseudo

:empty now matches whitespace-only nodes, this is not implemented in any browser yet, and there are concerns that implementing this may not be web compatible.

Should the spec be changed to match current implementations?

@nt1m nt1m added the selectors-4 Current Work label Nov 19, 2022
@nt1m nt1m changed the title [selectors] Is current spec for :empty web compatible? [selectors-4] Is current spec for :empty web compatible? Nov 19, 2022
@SebastianZ
Copy link
Contributor

The question is rather whether this claim from the spec. is true:

Note: In Level 2 and Level 3 of Selectors, :empty did not match elements that contained only white space. This was changed so that that — given white space is largely collapsible in HTML and is therefore used for source code formatting, and especially because elements with omitted end tags are likely to absorb such white space into their DOM text contents — elements which authors perceive of as empty can be selected by this selector, as they expect.

So, to answer whether this change in the behavior of :empty is actually web compatible, the HTTP archive should be queried if that didn't happen yet.

Sebastian

@gsnedders
Copy link
Member

gsnedders commented Oct 15, 2024

There's a lot of discussion in #1967 about this question. (I don't know if it's worthwhile having a separate issue to track this?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
selectors-4 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants