Skip to content
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

CSS queries on NodeSet should return matching toplevel nodes #73

Closed
flavorjones opened this issue Jun 7, 2009 · 2 comments
Closed

CSS queries on NodeSet should return matching toplevel nodes #73

flavorjones opened this issue Jun 7, 2009 · 2 comments

Comments

@flavorjones
Copy link
Member

Because a CSS search on a Node only returns children of that node, a search on NodeSet will search across the collective children of the nodes in the set.

We should return matching toplevel nodes.

tenderlove suggested that CSS queries on a NodeSet should get translated as follows:

"div" => "self::div | .//div"
@flavorjones
Copy link
Member Author

def test_node_set_css_searches_match_self
  html = Nokogiri::HTML("<html><body><div class='a'></div></body></html>")
  set = html.xpath("/html/body/div")
  assert_equal set.first, set.css(".a").first
end

@tenderlove
Copy link
Member

node sets now search the top level list of nodes in addition to children. closed by e65d71c

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants