public function filter($selector)
{
$found = new \SplObjectStorage();
$tmp = new \SplObjectStorage();
foreach ($this->matches as $m) {
$tmp->attach($m);
// Seems like this should be right... but it fails unit
// tests. Need to compare to jQuery.
// $query = new \QueryPath\CSS\DOMTraverser($tmp, TRUE, $m);
$query = new \QueryPath\CSS\DOMTraverser($tmp);
$query->find($selector);
if (count($query->matches())) {
$found->attach($m);
}
$tmp->detach($m);
}
return $this->inst($found, null, $this->options);
}