web-platform-tests / interop

web-platform-tests Interop project
https://wpt.fyi/interop
313 stars 28 forks source link

Modern definition of `:empty` #794

Open Westbrook opened 2 weeks ago

Westbrook commented 2 weeks ago

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 commented 1 week ago

See also https://github.com/web-platform-tests/interop/issues/180 and https://github.com/w3c/csswg-drafts/issues/1967 about whether this change is web compatible.

gsnedders commented 1 week ago

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?