Skip to content

Commit 6696446

Browse files
committed
one step back
1 parent aeca150 commit 6696446

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

src/main/javacc/CSS3Parser.jj

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,23 +1656,22 @@ Selector negation_arg() :
16561656
simpleSel = elementName() { return simpleSel; }
16571657
|
16581658
(
1659-
{ simpleSel = new ElementSelector(null, createLocator(token)); }
1660-
c = hash(null, false)
1661-
| c = _class(null, false)
1662-
| c = attrib(null, false)
1663-
| (
1664-
o = pseudo(null, false)
1665-
{ if (o instanceof Condition)
1666-
{ c = (Condition) o;
1667-
} else {
1659+
c = hash(null, false)
1660+
| c = _class(null, false)
1661+
| c = attrib(null, false)
1662+
| (
1663+
o = pseudo(null, false)
1664+
{ if (o instanceof Condition)
1665+
{ c = (Condition) o;
1666+
} else {
16681667
return new DescendantSelector(null, (SimpleSelector) o);
1669-
}
1670-
}
1671-
)
1668+
}
1669+
}
1670+
)
16721671
)
16731672
)
16741673
{
1675-
return new ConditionalSelector(simpleSel, c);
1674+
return new ConditionalSelector(null, c);
16761675
}
16771676
}
16781677

src/test/java/com/gargoylesoftware/css/parser/CSS3ParserTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,7 @@ public void not() throws Exception {
24212421

24222422
// hash
24232423
selectors = createSelectors("input:not(#test)");
2424-
Assert.assertEquals("input:not(*#test)", selectors.item(0).toString());
2424+
Assert.assertEquals("input:not(#test)", selectors.item(0).toString());
24252425

24262426
// class
24272427
selectors = createSelectors("input:not(.home)");
@@ -2515,7 +2515,7 @@ public void not_universal() throws Exception {
25152515
@Test
25162516
public void not_hash() throws Exception {
25172517
final SelectorList selectors = createSelectors("p:not( #test)");
2518-
Assert.assertEquals("p:not(*#test)", selectors.item(0).toString());
2518+
Assert.assertEquals("p:not(#test)", selectors.item(0).toString());
25192519

25202520
Assert.assertEquals(1, selectors.getLength());
25212521
final Selector selector = selectors.item(0);
@@ -2528,7 +2528,7 @@ public void not_hash() throws Exception {
25282528
Assert.assertEquals(ConditionType.PSEUDO_CLASS_CONDITION, condition.getConditionType());
25292529

25302530
final PseudoClassCondition pseudo = (PseudoClassCondition) condition;
2531-
Assert.assertEquals("not(*#test)", pseudo.getValue());
2531+
Assert.assertEquals("not(#test)", pseudo.getValue());
25322532
}
25332533

25342534
/**
@@ -2632,13 +2632,13 @@ public void twoPseudo() throws Exception {
26322632
Assert.assertEquals("input:foo(test):before", selectors.item(0).toString());
26332633

26342634
selectors = createSelectors("input:not(#test):not(#rest)");
2635-
Assert.assertEquals("input:not(*#test):not(*#rest)", selectors.item(0).toString());
2635+
Assert.assertEquals("input:not(#test):not(#rest)", selectors.item(0).toString());
26362636

26372637
selectors = createSelectors("input:not(#test):nth-child(even)");
2638-
Assert.assertEquals("input:not(*#test):nth-child(even)", selectors.item(0).toString());
2638+
Assert.assertEquals("input:not(#test):nth-child(even)", selectors.item(0).toString());
26392639

26402640
selectors = createSelectors("input:not(#test):before");
2641-
Assert.assertEquals("input:not(*#test):before", selectors.item(0).toString());
2641+
Assert.assertEquals("input:not(#test):before", selectors.item(0).toString());
26422642
}
26432643

26442644
/**
@@ -2662,7 +2662,7 @@ public void pseudoElementsErrors() throws Exception {
26622662

26632663
// pseudo element not at end
26642664
checkErrorSelector("input:before:not(#test)",
2665-
"Duplicate pseudo class \":not(*#test)\" or pseudo class \":not(*#test)\" not at end.");
2665+
"Duplicate pseudo class \":not(#test)\" or pseudo class \":not(#test)\" not at end.");
26662666
checkErrorSelector("input:before[type='file']",
26672667
"Error in attribute selector. (Invalid token \"type\". Was expecting: <S>.)");
26682668
checkErrorSelector("input:before.styleClass", "Error in class selector. (Invalid token \"\". "

0 commit comments

Comments
 (0)