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.7.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.6.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.6.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.5.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.4.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.4.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.3.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.2.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.1.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.1.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-21.0.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.5.2 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.5.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.5.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.4.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.3.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.2.2 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.2.1 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.2.0 node_modules/axe-core/lib/core/utils/are-styles-set.js
govuk_publishing_components-20.1.0 node_modules/axe-core/lib/core/utils/are-styles-set.js