Revert "Fixed XPath AST for :last-of-type"
Axes can't be used in combination with functions.
This reverts commit b0b572a584
.
This commit is contained in:
parent
8f3553f8f1
commit
2d6a2be2e8
|
@ -528,11 +528,7 @@ end
|
|||
# @return [AST::Node]
|
||||
#
|
||||
def on_pseudo_class_last_of_type
|
||||
return s(
|
||||
:eq,
|
||||
s(:call, 'count', s(:axis, 'following-sibling', s(:call, 'name'))),
|
||||
s(:int, 0)
|
||||
)
|
||||
return s(:eq, s(:call, 'position'), s(:call, 'last'))
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
@ -4,7 +4,7 @@ describe Oga::CSS::Parser do
|
|||
context ':last-of-type pseudo class' do
|
||||
example 'parse the :last-of-type pseudo class' do
|
||||
parse_css(':last-of-type').should == parse_xpath(
|
||||
'descendant::*[count(following-sibling::name()) = 0]'
|
||||
'descendant::*[position() = last()]'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue