Fixed precedence of ID/class CSS selectors
This commit is contained in:
1 parent
91f9cc984b
commit
ed0cd7826e
2 files changed
+19
-1
No files matched your search
@@ -11,7 +11,7 @@ token T_NTH T_INT T_STRING T_ODD T_EVEN T_DOT T_HASH
|
||||
options no_result_var
|
||||
|
||||
prechigh
|
||||
left T_COLON
|
||||
left T_COLON T_HASH T_DOT
|
||||
left T_CHILD T_FOLLOWING T_FOLLOWING_DIRECT
|
||||
left T_DOT T_HASH
|
||||
preclow
|
||||
|
||||
@@ -20,6 +20,24 @@ describe Oga::CSS::Parser do
|
||||
)
|
||||
end
|
||||
|
||||
example 'parse an > axis followed by an element with an ID' do
|
||||
parse_css('x > foo#bar').should == s(
|
||||
:axis,
|
||||
'child',
|
||||
s(:test, nil, 'x'),
|
||||
s(:id, 'bar', s(:test, nil, 'foo'))
|
||||
)
|
||||
end
|
||||
|
||||
example 'parse an > axis followed by an element with a class' do
|
||||
parse_css('x > foo.bar').should == s(
|
||||
:axis,
|
||||
'child',
|
||||
s(:test, nil, 'x'),
|
||||
s(:class, 'bar', s(:test, nil, 'foo'))
|
||||
)
|
||||
end
|
||||
|
||||
example 'parse the + axis' do
|
||||
parse_css('x + y').should == s(
|
||||
:axis,
|
||||
|
||||
Reference in new issue
Block a user