function traverse(listeners, target) {
    const queue = []
    let node = target

    do {
        if (node.nodeType !== 1) {
            break
        }

        const matches = listeners.matches(node)

        if (matches.length) {
            queue.push({delegatedTarget: node, stack: matches})
        }
    } while ((node = node.parentElement))

    return queue
}
Find a matching selector for delegation

@param {SelectorSet} listeners
@param {HTMLElement|Element|EventTarget} target
@returns {[]}