Conversation
d02d89b to
2c15198
Compare
Codecov Report
@@ Coverage Diff @@
## master #124 +/- ##
==========================================
+ Coverage 95.39% 96.01% +0.62%
==========================================
Files 3 3
Lines 803 904 +101
Branches 139 150 +11
==========================================
+ Hits 766 868 +102
+ Misses 20 19 -1
Partials 17 17
Continue to review full report at Codecov.
|
2c15198 to
60a4266
Compare
|
I've found that at least the Chrome developer console supports this selector, so you can test it on something like: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p>
<span a="1"></span>
<span a="2"></span>
<span a="3"></span>
</p>
<div>
<span a="1"></span>
</div>
</body>
</html> |
60a4266 to
90d2eee
Compare
| "*[not([a] and following-sibling::*[b])]" | ||
| ) # select anything that is not b or doesn't have a sibling a | ||
| assert xpath("*:not(a b)") == ( | ||
| '*[not(name()="b" and ancestor::*[name()="a"])]' |
There was a problem hiding this comment.
This change should also be applied to other 3 combinators.
There was a problem hiding this comment.
So I suppose the tests should look like this:
assert xpath("*:not(a > b)") == '*[not(name()="b" and parent::*[name()="a"])]' # select anything that is not b or doesn't have a parent a
assert xpath("*:not(a + b)") == '*[not(name()="b" and following-sibling::*[position()=1 and name()="a"])]' # select anything that is not b or doesn't have an immediate sibling a
assert xpath("*:not(a ~ b)") == '*[not(name()="b" and following-sibling::*[name()="a"])]' # select anything that is not b or doesn't have a sibling a
assert xpath("*:not(a b)") == '*[not(name()="b" and ancestor::*[name()="a"])]' # select anything that is not b or doesn't have an ancestor a
please correct me if i'm wrong
90d2eee to
3c86499
Compare
|
@wRAR, is there a chance this will be reviewed soon? Do you need any help? |
|
@mikhainin we don't have specific plans to complete this PR, if you need this feature you can make a new PR based on this one and complete it and we will review it. |
#51
done: parse complex selector, with any type of combinators (
>,+,~,), translating to xpath all those combinators according to this commentthis pr also includes code from pr to support
:has()pseudo class