Sha256: 731bce1f90728ed09800df99920205357216a8741726629d7bc8525d5bf55e00
Contents?: true
Size: 1.15 KB
Versions: 260
Compression:
Stored size: 1.15 KB
Contents
/* exported matches */ /** * Check if a virtual node matches a definition * * Example: * ```js * // Match a single nodeName: * axe.commons.matches(vNode, 'div') * * // Match one of multiple nodeNames: * axe.commons.matches(vNode, ['ul', 'ol']) * * // Match a node with nodeName 'button' and with aria-hidden: true: * axe.commons.matches(vNode, { * nodeName: 'button', * attributes: { 'aria-hidden': 'true' } * }) * * // Mixed input. Match button nodeName, input[type=button] and input[type=reset] * axe.commons.matches(vNode, ['button', { * nodeName: 'input', // nodeName match isn't case sensitive * properties: { type: ['button', 'reset'] } * }]) * ``` * * @deprecated HTMLElement is deprecated, use VirtualNode instead * * @namespace matches * @memberof axe.commons * @param {HTMLElement|VirtualNode} vNode virtual node to verify attributes against constraints * @param {Array<ElementDefinition>|String|Object|Function|Regex} definition * @return {Boolean} true/ false based on if vNode passes the constraints expected */ function matches(vNode, definition) { return matches.fromDefinition(vNode, definition); } commons.matches = matches;
Version data entries
260 entries across 260 versions & 1 rubygems