Sha256: 1466dce2a7ddb6654c6c9e6063fa60f3a2bfea5194d3a39953635b75cf13c126

Contents?: true

Size: 1.87 KB

Versions: 375

Compression:

Stored size: 1.87 KB

Contents

/* global text */
text.nativeElementType = [
	{
		// 5.1 input type="text", input type="password", input type="search", input type="tel", input type="url" and textarea Element
		matches: [
			{
				nodeName: 'textarea'
			},
			{
				nodeName: 'input',
				properties: {
					type: ['text', 'password', 'search', 'tel', 'email', 'url']
				}
			}
		],
		namingMethods: 'labelText'
	},
	{
		// 5.2 input type="button", input type="submit" and input type="reset"
		matches: {
			nodeName: 'input',
			properties: {
				type: ['button', 'submit', 'reset']
			}
		},
		namingMethods: ['valueText', 'titleText', 'buttonDefaultText']
	},
	{
		// 5.3 input type="image"
		matches: {
			nodeName: 'input',
			properties: {
				type: 'image'
			}
		},
		namingMethods: [
			'altText',
			'valueText',
			'labelText',
			'titleText',
			'buttonDefaultText'
		]
	},
	{
		// 5.4 button Element
		matches: 'button',
		namingMethods: 'subtreeText'
	},
	{
		// 5.5 fieldset and legend Elements
		matches: 'fieldset',
		namingMethods: 'fieldsetLegendText'
	},
	{
		// 5.6 output Element
		matches: 'OUTPUT',
		namingMethods: 'subtreeText'
	},
	{
		// 5.7 Other Form Elements
		matches: [
			{
				nodeName: 'select'
			},
			{
				nodeName: 'input',
				properties: {
					// Regex: Everything other than these
					type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
				}
			}
		],
		namingMethods: 'labelText'
	},
	{
		// 5.8 summary Element
		matches: 'summary',
		namingMethods: 'subtreeText'
	},
	{
		// 5.9 figure and figcaption Elements
		matches: 'figure',
		namingMethods: ['figureText', 'titleText']
	},
	{
		// 5.10 img Element
		matches: 'img',
		namingMethods: 'altText'
	},
	{
		// 5.11 table Element
		matches: 'table',
		namingMethods: ['tableCaptionText', 'tableSummaryText']
	},
	{
		matches: ['hr', 'br'],
		namingMethods: ['titleText', 'singleSpace']
	}
	// All else defaults to just title
];

Version data entries

375 entries across 375 versions & 1 rubygems

Version Path
govuk_publishing_components-30.4.1 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-30.4.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-30.3.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-30.2.1 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-30.2.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-30.1.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-30.0.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.15.3 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.15.2 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.15.1 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.15.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.14.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.13.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.12.1 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.12.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.11.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.10.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.9.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.8.0 node_modules/axe-core/lib/commons/text/native-element-types.js
govuk_publishing_components-29.7.0 node_modules/axe-core/lib/commons/text/native-element-types.js