-
-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:has() selector should match against all descendants, not just direct children #350
Comments
On it |
Just to be clear, to anyone following this issue: ":has()" does indeed match all descendents for most queries. Used in combination with an element id ("#inner"), though (and perhaps one or two other types of selectors), the xpath doesn't work. It's not clear to me yet whether this is an xpath interpreter bug in libxml, or whether we simply need to restructure the xpath query in these cases. Need to investigate more. |
Got bit by this. Want me to write test cases? |
Sure, test cases of the sort found in https://github.com/tenderlove/nokogiri/blob/master/test/css/test_parser.rb#L61-64 would be great -- pass the CSS and assert on the generated XPath query string. The point being, we need more thorough coverage of what the :has operator should generate for different (more complex) CSS queries. Thanks! |
This test line is wrong:
It should be:
Similarly, the next line:
should instead be:
|
PR #1852 addresses this. |
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.)
The text was updated successfully, but these errors were encountered: