KnowledgeBase icon indicating copy to clipboard operation
KnowledgeBase copied to clipboard

Describe when native CSS4 ':has()' can be used and how it is handled in browsers without native ':has()' support

Open Alex-302 opened this issue 2 years ago • 1 comments

  • Add examples for CSS4 ':has()';
  • Describe limitations of CSS4 ':has()' or add the link https://www.w3.org/TR/selectors-4/#relational and which rules can be converted to native;
  • Describe how CSS4 ':has()' handled in browsers without it's support (old Safari, Firefox without experimental flags), including cases where the selector is not supported by CSS4 (:has(:contains(aaa)));
  • in which cases native implementation may fail to hide an element;
  • performance comparison.

Alex-302 avatar Oct 02 '23 11:10 Alex-302

Sure this thread OP is more than 3 months old by now, but things have picked up very fast after Eyeo sent out an E-mail some days ago to its related filterlist makers that strongly and honestly very suddenly recommended switching from #?# + :has, to ## + :has (except if the entry also has :has-text), the logic being that Firefox Stable (and presumably also Beta and Nightly) added native CSS :has in early December 2023.

I had already converted all of my own lists to ##, but realised regarding EasyList Lithuania and Adblock List for Finland (https://github.com/finnish-easylist-addition/finnish-easylist-addition/pull/450#issuecomment-1896396404), "Wait, hold on the horses a little bit. To which extent would this new syntax affect Firefox ESR and quite a few browsers that are forked from ESR (Tor Browser being the biggest example IIRC), which'd seemingly be quite substantially for Browser Extension; and/or should adblockers even accomodate to ESR at all?"

So, this is certainly a good time to consider relatively fast what to do with this situation.

DandelionSprout avatar Jan 17 '24 22:01 DandelionSprout