Parsing support for the :first-of-type pseudo.
This commit is contained in:
parent
7a606a11d3
commit
10632eafd4
|
@ -514,6 +514,13 @@ end
|
|||
)
|
||||
end
|
||||
|
||||
##
|
||||
# @return [AST::Node]
|
||||
#
|
||||
def on_pseudo_class_first_of_type
|
||||
return s(:eq, s(:call, 'position'), s(:int, 1))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Oga::CSS::Parser do
|
||||
context ':first-of-type pseudo class' do
|
||||
example 'parse the :first-of-type pseudo class' do
|
||||
parse_css(':first-of-type').should == parse_xpath(
|
||||
'descendant-or-self::*[position() = 1]'
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue