Change ":has" selector's behaviour to include all descendants instead of direct child elements.

This commit is contained in:
iska
2015-12-21 16:25:26 +01:00
parent 3c89df333c
commit b99cb0c9d4
+3 -2
View File
@@ -73,8 +73,9 @@
- (BOOL)acceptElement:(HTMLElement *)element
{
for (HTMLNode *child in element.childNodes) {
if (child.nodeType == HTMLNodeElement && [self.selector acceptElement:child.asElement]) {
HTMLNodeIterator *iterator = [element nodeIteratorWithShowOptions:HTMLNodeFilterShowAll filter:nil];
for (HTMLNode *descendant in iterator) {
if (descendant.nodeType == HTMLNodeElement && [self.selector acceptElement:descendant.asElement]) {
return YES;
}
}