Sha256: fb420c01dd166481183b1ea15788bcfdf8d8d72059d81e170c418c5bfff7b65c
Contents?: true
Size: 574 Bytes
Versions: 27
Compression:
Stored size: 574 Bytes
Contents
var matches = require('matches-selector') module.exports = function (element, selector, checkYoSelf, root) { element = checkYoSelf ? element : element.parentNode root = root || document do { if (matches(element, selector)) return element // After `matches` on the edge case that // the selector matches the root // (when the root is not the document) if (element === root) return // Make sure `element !== document` // otherwise we get an illegal invocation } while ((element = element.parentNode) && element !== document) }
Version data entries
27 entries across 14 versions & 1 rubygems