Fixed precedence of ID/class CSS selectors
This commit is contained in:
parent
91f9cc984b
commit
ed0cd7826e
|
@ -11,7 +11,7 @@ token T_NTH T_INT T_STRING T_ODD T_EVEN T_DOT T_HASH
|
||||||
options no_result_var
|
options no_result_var
|
||||||
|
|
||||||
prechigh
|
prechigh
|
||||||
left T_COLON
|
left T_COLON T_HASH T_DOT
|
||||||
left T_CHILD T_FOLLOWING T_FOLLOWING_DIRECT
|
left T_CHILD T_FOLLOWING T_FOLLOWING_DIRECT
|
||||||
left T_DOT T_HASH
|
left T_DOT T_HASH
|
||||||
preclow
|
preclow
|
||||||
|
|
|
@ -20,6 +20,24 @@ describe Oga::CSS::Parser do
|
||||||
)
|
)
|
||||||
end
|
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
|
example 'parse the + axis' do
|
||||||
parse_css('x + y').should == s(
|
parse_css('x + y').should == s(
|
||||||
:axis,
|
:axis,
|
||||||
|
|
Loading…
Reference in New Issue