Handle classes/ids after pseudo-classes
This commit is contained in:
parent
0545673e61
commit
9f46a6af42
4 changed files with 64 additions and 14 deletions
|
@ -424,6 +424,14 @@ def test_parse_not_with_missing_argument() -> None:
|
|||
_ = NotPseudoClassSelector.from_pseudo_cls(pseudo)
|
||||
|
||||
|
||||
def test_parse_class_after_pseudo_class() -> None:
|
||||
tokens = TokenStream([Token(TokenType.PSEUDO_CLASS, ":first-child"), Token(TokenType.CLASS, ".bar")])
|
||||
sel = parse_tokens(tokens)
|
||||
assert isinstance(sel, NthChildPseudoClassSelector)
|
||||
assert isinstance(sel.selector, SimpleSelector)
|
||||
assert sel.selector.classes == ["bar"]
|
||||
|
||||
|
||||
def test_parse_multiple_combinators() -> None:
|
||||
# div .parent > .child + .sibling:not(.bar):first-child
|
||||
tokens = TokenStream(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue