Sha256: 99c48be2fa8e0d06761f58215893a744dd1a7d3f70386c58068bea4a9e988e32

Contents?: true

Size: 1.07 KB

Versions: 115

Compression:

Stored size: 1.07 KB

Contents

/* exported matches */

/**
 * Check if a DOM element matches a definition
 *
 * Example:
 * ```js
 * // Match a single nodeName:
 * axe.commons.matches(elm, 'div')
 *
 * // Match one of multiple nodeNames:
 * axe.commons.matches(elm, ['ul', 'ol'])
 *
 * // Match a node with nodeName 'button' and with aria-hidden: true:
 * axe.commons.matches(elm, {
 * 	 nodeName: 'button',
 * 	 attributes: { 'aria-hidden': 'true' }
 * })
 *
 * // Mixed input. Match button nodeName, input[type=button] and input[type=reset]
 * axe.commons.matches(elm, ['button', {
 * 	nodeName: 'input', // nodeName match isn't case sensitive
 * 	properties: { type: ['button', 'reset'] }
 * }])
 * ```
 *
 * @namespace matches
 * @memberof axe.commons
 * @param {HTMLElement|VirtualNode} node node to verify attributes against constraints
 * @param {Array<ElementDefinition>|String|Object|Function|Regex} definition
 * @return {Boolean} true/ false based on if node passes the constraints expected
 */
function matches(node, definition) {
	return matches.fromDefinition(node, definition);
}

commons.matches = matches;

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
govuk_publishing_components-21.22.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.22.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.21.3 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.21.2 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.21.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.21.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.20.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.19.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.19.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.18.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.17.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.16.3 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.16.2 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.16.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.16.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.15.2 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.15.1 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.15.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.14.0 node_modules/axe-core/lib/commons/matches/index.js
govuk_publishing_components-21.13.5 node_modules/axe-core/lib/commons/matches/index.js