Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

div + p works

  • Loading branch information...
commit 95ebac8c38223776e69d7c4151aa49f6ebd00ada 1 parent 399fdb3
Yehuda Katz authored
Showing with 4 additions and 5 deletions.
  1. +3 −4 css/xpath_visitor.rb
  2. +1 −1  spec/combinator_adjacent_to_spec.rb
7 css/xpath_visitor.rb
View
@@ -43,10 +43,9 @@ def visit_preceding_selector node
end
def visit_direct_adjacent_selector node
- node.value.last.accept(self) +
- '[preceding-sibling::' +
- node.value.first.accept(self) +
- '][position()=1]'
+ node.value.last.accept(self) +
+ "/following-sibling::*[1]/self::" +
+ node.value.first.accept(self)
end
def visit_id node
2  spec/combinator_adjacent_to_spec.rb
View
@@ -7,7 +7,7 @@
end
it "<span + span> should return the last 3 span tags" do
- HTML.should have_nodes("span[foo] + span", 3)
+ HTML.should have_nodes("span[foo] + span", 2)
end
it "<span[foo] + span> should return the last 3 span tags" do
Please sign in to comment.
Something went wrong with that request. Please try again.