Sha256: 8afff1b9f368fa400fe8292fe6f72af8e63b755459c6775b89110439c7fe972c
Contents?: true
Size: 1001 Bytes
Versions: 375
Compression:
Stored size: 1001 Bytes
Contents
/*global dom, axe */ /** * Get elements referenced via a space-separated token attribute; * it will insert `null` for any Element that is not found * @method idrefs * @memberof axe.commons.dom * @instance * @param {HTMLElement} node * @param {String} attr The name of attribute * @return {Array|null} Array of elements (or `null` if not found) * * NOTE: When in a shadow DOM environment: ID refs (even for slotted content) * refer to the document in which the element is considered to be in the * "light DOM". Therefore, we use getElementById on the root node and not QSA * on the flattened tree to dereference idrefs. * */ dom.idrefs = function(node, attr) { 'use strict'; var index, length, doc = dom.getRootNode(node), result = [], idrefs = node.getAttribute(attr); if (idrefs) { idrefs = axe.utils.tokenList(idrefs); for (index = 0, length = idrefs.length; index < length; index++) { result.push(doc.getElementById(idrefs[index])); } } return result; };
Version data entries
375 entries across 375 versions & 1 rubygems