From http://api.jquery.com/has-selector/:
The expression $('div:has(p)') matches a <div> if a <p> exists anywhere among its descendants, not just as a direct child.
So I would expect:
Nokogiri::CSS.xpath_for("#outer:has(#inner)") # => ["//*[@id = 'outer' and .//*[@id = 'inner']]"]
But, instead:
Nokogiri::CSS.xpath_for("#outer:has(#inner)") # => ["//*[@id = 'outer' and *[@id = 'inner']]"]
which doesn't match:
<div id="outer">
<div>
<div id="inner"/>
</div>
</div>
(I think that's the right way to match all descendants, but I'm not totally solid on XPath. It works in my testing.)
From http://api.jquery.com/has-selector/:
So I would expect:
But, instead:
which doesn't match:
(I think that's the right way to match all descendants, but I'm not totally solid on XPath. It works in my testing.)