Having this html:
<div><h1>1</h1></div>
<div>2</div>
<div><h1>3</h1></div>
This is returning 0:
$("div").filter(":not(:not(:has(h1)))").length
I've made some testing here and the first two selectors are ok (without any filtering, and then just with one not).
This is a simpler model than my code. I really can't avoid both not's because one is added by a plugin and the other is being received in its options.