0

Back in 2015 when Safari Content Blockers were released it was said that they support CSS Selectors Level 4 expressions.

However even today they don't support at least the :has() operator.

What parts of Level4-only specification does Safari actually supports?

Is this the only what is supported (per Webkit blog post):

:matches(), :not(), :nth-child(), and :nth-last-child()?

wass rubleff
  • 326
  • 1
  • 14

1 Answers1

1

Safari 9, released in 2015, shipped with support for the following level 4 selectors:

As of 2018, no new level 4 selectors have been added since. However, Safari remains the only browser to support all but the first and last of these.

There are no known browser implementations of :has(), and frankly I wouldn't hold out on one surfacing within the next few years. Given that browser implementations are optimized for matching CSS selectors live, implementing snapshot matching is going to take a non-trivial amount of work which doesn't seem to be work vendors want to invest effort into right now. The WG is still exploring their options in the performance department.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • Thanks for elaborate answer! Is there any issue tracker or discussion board open to external developers which could allow tracking prospects of implementing `:has()` in future versions of Safari? – wass rubleff Oct 12 '18 at 07:06
  • @wass rubleff: There aren't any open issues on bugs.webkit.org but you might start there. – BoltClock Oct 12 '18 at 07:17
  • Is it an appropriate way to ask for the prospects of supporting for elements of a new standard? – wass rubleff Oct 12 '18 at 07:34
  • @wass rubleff: Hmm, on second thought I don't believe so. Issue trackers aren't suited to discussing the prospects so much as tracking the actual development of features. – BoltClock Oct 12 '18 at 07:36