Sha256: fdbf1c186b087e7f18357ec405150b62e4bdc9c2cfa12d230fbef313d759eacf
Contents?: true
Size: 836 Bytes
Versions: 375
Compression:
Stored size: 836 Bytes
Contents
/* global axe, dom */ /** * Find elements referenced from a given context * @method findElmsInContext * @memberof axe.commons.dom * @instance * @param {Object} element * @param {String} element.context Element in the same context * @param {String} element.value Attribute value to search for * @param {String} element.attr Attribute name to search for * @param {String} element.elm NodeName to search for (optional) * @return {Array<Node>} */ dom.findElmsInContext = function({ context, value, attr, elm = '' }) { let root; const escapedValue = axe.utils.escapeSelector(value); if (context.nodeType === 9 || context.nodeType === 11) { // It's already root root = context; } else { root = dom.getRootNode(context); } return Array.from( root.querySelectorAll(elm + '[' + attr + '=' + escapedValue + ']') ); };
Version data entries
375 entries across 375 versions & 1 rubygems