Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Custom class vs :has(> :not())
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Browser:
Chrome 147
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
14 days ago
Test name
Executions per second
Extra class
2990799.8 Ops/sec
:has(>:not())
5491183.5 Ops/sec
Multiple :has(:not())
2408858.2 Ops/sec
HTML Preparation code:
<button class="button"> <span class="icon-slot"> </span> No icon </button> <button class="button"> <span class="icon-slot"> <div class="3p-icon"> </div> </span> 3P icon </button> <button class="button"> <span class="icon-slot"> <i>icon</i> </span> 1P icon </button>
Tests:
Extra class
document.querySelector('.button .icon-slot-custom'); document.querySelector('.button .icon-slot-custom i'); document.querySelector('.button .icon-slot-custom img'); document.querySelector('.button .icon-slot-custom svg');
:has(>:not())
document.querySelector('.button .icon-slot:has(> :not(i), > :not(img), > :not(svg))');
Multiple :has(:not())
document.querySelector('.button .icon-slot:has(> :not(i))'); document.querySelector('.button .icon-slot:has(> :not(img))'); document.querySelector('.button .icon-slot:has(> :not(svg))');