code review re. #1772: fixed previewing of :has() filters

This commit is contained in:
gorhill 2016-10-01 13:34:20 -04:00
parent 889bf17545
commit 6557024434
1 changed files with 4 additions and 3 deletions

View File

@ -779,10 +779,11 @@ var filterToDOMInterface = (function() {
} catch(ex) {
return;
}
var out = [];
var out = [], elem;
for ( var i = 0, n = elems.length; i < n; i++ ) {
if ( document.querySelector(arg) ) {
out.push({ type: 'cosmetic', elem: elems[i] });
elem = elems[i];
if ( elem.querySelector(arg) ) {
out.push({ type: 'cosmetic', elem: elem });
}
}
return out;