@@ -305,12 +305,8 @@ def css2css(css, res=None):
305
305
css2css (':not(*[foo])' , ':not([foo])' )
306
306
css2css (':not(:empty)' )
307
307
css2css (':not(#foo)' )
308
- # css2css(':has(*)')
309
- # css2css(':has(foo)')
310
- # css2css(':has(*.foo)', ':has(.foo)')
311
- # css2css(':has(*[foo])', ':has([foo])')
312
- # css2css(':has(:empty)')
313
- # css2css(':has(#foo)')
308
+ css2css (':has(*)' )
309
+ css2css (':has(foo)' )
314
310
css2css ('foo:empty' )
315
311
css2css ('foo::before' )
316
312
css2css ('foo:empty::before' )
@@ -504,8 +500,8 @@ def xpath(css):
504
500
assert xpath ('e:nOT(*)' ) == (
505
501
"e[0]" ) # never matches
506
502
assert xpath ('e:has(> f)' ) == 'e[./f]'
507
- assert xpath ('e:has(f)' ) == 'e/ descendant-or-self ::f/ancestor-or-self::e '
508
- assert xpath ('e:has(~ f)' ) == 'e/ following-sibling::f/preceding-sibling::e '
503
+ assert xpath ('e:has(f)' ) == 'e[ descendant::f] '
504
+ assert xpath ('e:has(~ f)' ) == 'e[ following-sibling::f] '
509
505
assert xpath ('e:has(+ f)' ) == "e/following-sibling::*[(name() = 'f') and (position() = 1)]/preceding-sibling::*[(name() = 'e') and (position() = 1)]"
510
506
assert xpath ('e f' ) == (
511
507
"e/descendant-or-self::*/f" )
@@ -878,9 +874,7 @@ def pcss(main, *selectors, **kwargs):
878
874
assert pcss ('ol :Not(li[class])' ) == [
879
875
'first-li' , 'second-li' , 'li-div' ,
880
876
'fifth-li' , 'sixth-li' , 'seventh-li' ]
881
- # assert pcss('link:has(*)') == []
882
- # assert pcss('link:has([href])') == ['link-href']
883
- # assert pcss('ol:has(div)') == ['first-ol']
877
+ assert pcss ('ol:has(div)' ) == ['first-ol' ]
884
878
assert pcss ('ol.a.b.c > li.c:nth-child(3)' ) == ['third-li' ]
885
879
886
880
# Invalid characters in XPath element names, should not crash
0 commit comments