Sha256: 4bc7cceaff4e1b6efc8951dd3577ef2d64cd3cf699b5f3d04d8582d2c1950649

Contents?: true

Size: 510 Bytes

Versions: 104

Compression:

Stored size: 510 Bytes

Contents

/* global axe*/

function areStylesSet(el, styles, stopAt) {
	'use strict';
	var styl = window.getComputedStyle(el, null);
	var set = false;
	if (!styl) {
		return false;
	}
	styles.forEach(function(att) {
		if (styl.getPropertyValue(att.property) === att.value) {
			set = true;
		}
	});
	if (set) {
		return true;
	}
	if (el.nodeName.toUpperCase() === stopAt.toUpperCase() || !el.parentNode) {
		return false;
	}
	return areStylesSet(el.parentNode, styles, stopAt);
}

axe.utils.areStylesSet = areStylesSet;

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
govuk_publishing_components-21.16.3 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.16.2 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.16.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.16.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.15.2 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.15.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.15.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.14.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.13.5 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.13.4 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.13.3 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.13.2 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.13.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.13.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.12.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.11.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.10.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.9.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.8.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.8.0 node_modules/axe-core/lib/core/utils/are-styles-set.js