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) { } catch(ex) {
return; return;
} }
var out = []; var out = [], elem;
for ( var i = 0, n = elems.length; i < n; i++ ) { for ( var i = 0, n = elems.length; i < n; i++ ) {
if ( document.querySelector(arg) ) { elem = elems[i];
out.push({ type: 'cosmetic', elem: elems[i] }); if ( elem.querySelector(arg) ) {
out.push({ type: 'cosmetic', elem: elem });
} }
} }
return out; return out;