Support for the :scope pseudo-class
simmons opened this issue · comments
David Simmons commented
It would be useful if :scope
could be used to anchor selection to the root of the inclusive-descendant tree. For example, in the following document, div_b.select(":scope > div")
should return the div.c
element (as it does in Javascript), but instead returns nothing because the document root is being used as the selection scope.
<html>
<body>
<div class="a">
<div class="b">
<div class="c">
</div>
</div>
</div>
</body>
</html>
From a brief glance at the selectors
crate, it appears that :scope
is supported, but the MatchingContext::scope_element
field must be directly set.
Simon Sapin commented
I will soon archive this repository and make it read-only, so this issue will not be addressed: https://github.com/kuchiki-rs/kuchiki#archived