Selector.matchesElement

bool matchesElement(Element e, Element relativeTo = null)

Returns true if the given element matches this selector, considered relative to an arbitrary element.

You can do a form of lazy Element.querySelectorAll|querySelectorAll by using this with std.algorithm.iteration.filter:

Selector sel = Selector("foo > bar");
auto lazySelectorRange = element.tree.filter!(e => sel.matchElement(e))(document.root);