@@ -305,12 +305,8 @@ def css2css(css, res=None):
305305 css2css (':not(*[foo])' , ':not([foo])' )
306306 css2css (':not(:empty)' )
307307 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)' )
314310 css2css ('foo:empty' )
315311 css2css ('foo::before' )
316312 css2css ('foo:empty::before' )
@@ -504,8 +500,8 @@ def xpath(css):
504500 assert xpath ('e:nOT(*)' ) == (
505501 "e[0]" ) # never matches
506502 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] '
509505 assert xpath ('e:has(+ f)' ) == "e/following-sibling::*[(name() = 'f') and (position() = 1)]/preceding-sibling::*[(name() = 'e') and (position() = 1)]"
510506 assert xpath ('e f' ) == (
511507 "e/descendant-or-self::*/f" )
@@ -878,9 +874,7 @@ def pcss(main, *selectors, **kwargs):
878874 assert pcss ('ol :Not(li[class])' ) == [
879875 'first-li' , 'second-li' , 'li-div' ,
880876 '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' ]
884878 assert pcss ('ol.a.b.c > li.c:nth-child(3)' ) == ['third-li' ]
885879
886880 # Invalid characters in XPath element names, should not crash
0 commit comments