From 82a9c39fd2a4978f8165dab1d42f5afcd6efa599 Mon Sep 17 00:00:00 2001 From: Liubin Guo Date: Wed, 31 Aug 2016 20:25:19 +0800 Subject: [PATCH] [Issue #212,#213,#214,#215,#216] Added five a11y rules. react-a11y-img-has-alt react-a11y-props react-a11y-role-has-required-aria-props react-a11y-role react-a11y-role-supports-aria-props --- Gruntfile.js | 98 +- README.md | 6 + src/a11yImgHasAltRule.ts | 89 + src/a11yPropsRule.ts | 46 + src/a11yRoleHasRequiredAriaPropsRule.ts | 102 + src/a11yRoleRule.ts | 70 + src/a11yRoleSupportsAriaPropsRule.ts | 84 + src/a11yTabindexNoPositiveRule.ts | 4 +- src/utils/JsxAttribute.ts | 6 +- src/utils/attributes/IAria.ts | 4 + src/utils/attributes/IRole.ts | 15 +- src/utils/attributes/roleSchema.json | 3713 +++++------------ src/utils/implicitRoles/a.ts | 1 + src/utils/implicitRoles/area.ts | 1 + src/utils/implicitRoles/index.ts | 3 + src/utils/implicitRoles/input.ts | 6 +- src/utils/implicitRoles/menu.ts | 6 +- src/utils/implicitRoles/menuitem.ts | 6 +- .../CustomElementHasEmptyAltValue.tsx | 6 + .../CustomElementHasNoAltProp.tsx | 4 + .../CustomElementHasPresentationRole.tsx | 6 + .../CustomElementHasValidAltValue.tsx | 6 + .../ElementNeitherImgNorCustomElement.tsx | 3 + .../ImgElementHasEmptyAltValue.tsx | 4 + .../FailingTestinputs/ImgElementHasNoAlt.tsx | 2 + .../PassingTestInputs/ElementNotImg.tsx | 3 + .../ImgElementHasNotEmptyAltValue.tsx | 4 + .../ImgElementHasPresentationRole.tsx | 4 + .../ImgElementHasSpreadAttribute.tsx | 2 + .../ImgElementNotLowerCase.tsx | 2 + .../InvalidAriaAttributeName.tsx | 5 + .../PassingTestInputs/AttributeNotAria.tsx | 5 + .../CorrectAriaAttributeName.tsx | 4 + .../FailingTestInputs/AbstractRole.tsx | 3 + .../FailingTestInputs/InvalidRole.tsx | 3 + .../FailingTestInputs/UndefinedRole.tsx | 6 + .../PassingTestInputs/AttributeNotRole.tsx | 3 + .../PassingTestInputs/CorrectName.tsx | 4 + .../PassingTestInputs/MultipleCorrectRole.tsx | 3 + .../RoleNameNotStringLiteral.tsx | 2 + .../CheckboxRoleMissingRequiredProps.tsx | 2 + .../ComboboxRoleMissingRequiredProps.tsx | 2 + .../MultipleRoleMissingRequiredProps.tsx | 4 + .../ScrollbarRoleMissingRequiredProps.tsx | 5 + .../SliderRoleMissingRequiredProps.tsx | 3 + .../SpinbuttonRoleMissingRequiredProps.tsx | 3 + .../AttributeHasNoValidRole.tsx | 6 + .../RoleHasNoRequiredProps.tsx | 3 + ...oleValueAndAttributesHaveRequiredprops.tsx | 9 + .../RoleValueNotLiteralString.tsx | 4 + .../ImplicitRoleNotSupportsAriaProp.tsx | 6 + .../RoleNameNotSupportsAriaProp.tsx | 8 + .../a/ImplicitLinkRole.tsx | 17 + .../area/ImplicitLinkRole.tsx | 17 + .../img/ImplicitImgRole.tsx | 17 + .../img/ImplicitPresentationRole.tsx | 18 + .../input/ImplicitButtonRole.tsx | 79 + .../input/ImplicitCheckboxRole.tsx | 18 + .../input/ImplicitRadioRole.tsx | 21 + .../input/ImplicitSliderRole.tsx | 22 + .../input/ImplicitTextboxRole.tsx | 8 + .../link/ImplicitLinkRole.tsx | 17 + .../menu/ImplicitToolbarRole.tsx | 18 + .../menuitem/ImplicitMenuitemRole.tsx | 17 + .../menuitem/ImplicitMenuitemcheckboxRole.tsx | 18 + .../menuitem/ImplicitMenuitemradioRole.tsx | 21 + .../ImplicitRoleTestInputs/otherTags.tsx | 30 + .../GlobalSupportsAriaProp.tsx | 16 + .../NotEmptyRoleValue.tsx | 60 + .../UndefinedRoleOrEmptyRoleValue.tsx | 23 + tests/a11yImgHasAltRule.test.ts | 213 + tests/a11yPropsRule.test.ts | 69 + .../a11yRoleHasRequiredAriaPropsRule.test.ts | 253 ++ tests/a11yRoleRule.test.ts | 119 + tests/a11yRoleSupportsAriaPropsRule.test.ts | 192 + tslint.json | 5 + 76 files changed, 2887 insertions(+), 2800 deletions(-) create mode 100644 src/a11yImgHasAltRule.ts create mode 100644 src/a11yPropsRule.ts create mode 100644 src/a11yRoleHasRequiredAriaPropsRule.ts create mode 100644 src/a11yRoleRule.ts create mode 100644 src/a11yRoleSupportsAriaPropsRule.ts create mode 100644 test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasEmptyAltValue.tsx create mode 100644 test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasNoAltProp.tsx create mode 100644 test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasPresentationRole.tsx create mode 100644 test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasValidAltValue.tsx create mode 100644 test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/ElementNeitherImgNorCustomElement.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/FailingTestinputs/ImgElementHasEmptyAltValue.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/FailingTestinputs/ImgElementHasNoAlt.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/PassingTestInputs/ElementNotImg.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/PassingTestInputs/ImgElementHasNotEmptyAltValue.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/PassingTestInputs/ImgElementHasPresentationRole.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/PassingTestInputs/ImgElementHasSpreadAttribute.tsx create mode 100644 test-data/a11yImgHasAlt/DefaltTests/PassingTestInputs/ImgElementNotLowerCase.tsx create mode 100644 test-data/a11yProps/FailingTestInputs/InvalidAriaAttributeName.tsx create mode 100644 test-data/a11yProps/PassingTestInputs/AttributeNotAria.tsx create mode 100644 test-data/a11yProps/PassingTestInputs/CorrectAriaAttributeName.tsx create mode 100644 test-data/a11yRole/FailingTestInputs/AbstractRole.tsx create mode 100644 test-data/a11yRole/FailingTestInputs/InvalidRole.tsx create mode 100644 test-data/a11yRole/FailingTestInputs/UndefinedRole.tsx create mode 100644 test-data/a11yRole/PassingTestInputs/AttributeNotRole.tsx create mode 100644 test-data/a11yRole/PassingTestInputs/CorrectName.tsx create mode 100644 test-data/a11yRole/PassingTestInputs/MultipleCorrectRole.tsx create mode 100644 test-data/a11yRole/PassingTestInputs/RoleNameNotStringLiteral.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/FailingTestInputs/CheckboxRoleMissingRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/FailingTestInputs/ComboboxRoleMissingRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/FailingTestInputs/MultipleRoleMissingRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/FailingTestInputs/ScrollbarRoleMissingRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/FailingTestInputs/SliderRoleMissingRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/FailingTestInputs/SpinbuttonRoleMissingRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/PassingTestInputs/AttributeHasNoValidRole.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/PassingTestInputs/RoleHasNoRequiredProps.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/PassingTestInputs/RoleValueAndAttributesHaveRequiredprops.tsx create mode 100644 test-data/a11yRoleHasRequiredAriaProps/PassingTestInputs/RoleValueNotLiteralString.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/FailingTestInputs/ImplicitRoleNotSupportsAriaProp.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/FailingTestInputs/RoleNameNotSupportsAriaProp.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/a/ImplicitLinkRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/area/ImplicitLinkRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/img/ImplicitImgRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/img/ImplicitPresentationRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/input/ImplicitButtonRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/input/ImplicitCheckboxRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/input/ImplicitRadioRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/input/ImplicitSliderRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/input/ImplicitTextboxRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/link/ImplicitLinkRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/menu/ImplicitToolbarRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/menuitem/ImplicitMenuitemRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/menuitem/ImplicitMenuitemcheckboxRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/menuitem/ImplicitMenuitemradioRole.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/ImplicitRoleTestInputs/otherTags.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/NotImplicitRoleTestInputs/GlobalSupportsAriaProp.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/NotImplicitRoleTestInputs/NotEmptyRoleValue.tsx create mode 100644 test-data/a11yRoleSupportsAriaProps/PassingTestInputs/NotImplicitRoleTestInputs/UndefinedRoleOrEmptyRoleValue.tsx create mode 100644 tests/a11yImgHasAltRule.test.ts create mode 100644 tests/a11yPropsRule.test.ts create mode 100644 tests/a11yRoleHasRequiredAriaPropsRule.test.ts create mode 100644 tests/a11yRoleRule.test.ts create mode 100644 tests/a11yRoleSupportsAriaPropsRule.test.ts diff --git a/Gruntfile.js b/Gruntfile.js index 674741176..ba01e99e8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,7 +2,7 @@ var _ = require('underscore'); -module.exports = function(grunt) { +module.exports = function (grunt) { let additionalMetadata; let allCweDescriptions; @@ -36,7 +36,7 @@ module.exports = function(grunt) { } function createCweDescription(metadata) { - allCweDescriptions = allCweDescriptions || grunt.file.readJSON('./cwe_descriptions.json', {encoding: 'UTF-8'}); + allCweDescriptions = allCweDescriptions || grunt.file.readJSON('./cwe_descriptions.json', { encoding: 'UTF-8' }); const cwe = getMetadataValue(metadata, 'commonWeaknessEnumeration', true, true); if (cwe === '') { @@ -62,7 +62,7 @@ module.exports = function(grunt) { } function getMetadataValue(metadata, name, allowEmpty, doNotEscape) { - additionalMetadata = additionalMetadata || grunt.file.readJSON('./additional_rule_metadata.json', {encoding: 'UTF-8'}); + additionalMetadata = additionalMetadata || grunt.file.readJSON('./additional_rule_metadata.json', { encoding: 'UTF-8' }); let value = metadata[name]; if (value == null) { @@ -94,7 +94,7 @@ module.exports = function(grunt) { } function camelize(input) { - return _(input).reduce(function(memo, element) { + return _(input).reduce(function (memo, element) { if (element.toLowerCase() === element) { memo = memo + element; } else { @@ -107,7 +107,7 @@ module.exports = function(grunt) { function getAllRuleNames(options) { options = options || { skipTsLintRules: false } - var convertToRuleNames = function(filename) { + var convertToRuleNames = function (filename) { filename = filename .replace(/Rule\..*/, '') // file extension plus Rule name .replace(/.*\//, ''); // leading path @@ -126,7 +126,7 @@ module.exports = function(grunt) { function getAllFormatterNames() { - var convertToRuleNames = function(filename) { + var convertToRuleNames = function (filename) { filename = filename .replace(/Formatter\..*/, '') // file extension plus Rule name .replace(/.*\//, ''); // leading path @@ -139,7 +139,7 @@ module.exports = function(grunt) { } function camelCase(input) { - return input.toLowerCase().replace(/-(.)/g, function(match, group1) { + return input.toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); }); } @@ -185,6 +185,12 @@ module.exports = function(grunt) { dest: 'dist/build' } ] + }, + json: { + expand: true, + cwd: '.', + src: ['src/**/*.json'], + dest: 'dist/' } }, @@ -193,7 +199,6 @@ module.exports = function(grunt) { src: ['dist/tests/**/*.js'] } }, - ts: { default: { src: [ @@ -240,7 +245,7 @@ module.exports = function(grunt) { }, tests: { options: { - configuration: (function() { + configuration: (function () { let tslintJson = grunt.file.readJSON("tslint.json", { encoding: 'UTF-8' }); tslintJson.rules['no-multiline-string'] = false; tslintJson.rules['quotemark'] = false; @@ -293,26 +298,26 @@ module.exports = function(grunt) { grunt.registerTask('validate-documentation', 'A task that validates that all rules defined in src are documented in README.md\n' + 'and validates that the package.json version is the same version defined in README.md', function () { - var readmeText = grunt.file.read('README.md', { encoding: 'UTF-8' }); - var packageJson = grunt.file.readJSON('package.json', { encoding: 'UTF-8' }); - getAllRuleNames({ skipTsLintRules: true }).forEach(function(ruleName) { - if (readmeText.indexOf(ruleName) === -1) { - grunt.fail.warn('A rule was found that is not documented in README.md: ' + ruleName); - } - }); - getAllFormatterNames().forEach(function(formatterName) { - if (readmeText.indexOf(formatterName) === -1) { - grunt.fail.warn('A formatter was found that is not documented in README.md: ' + formatterName); + var readmeText = grunt.file.read('README.md', { encoding: 'UTF-8' }); + var packageJson = grunt.file.readJSON('package.json', { encoding: 'UTF-8' }); + getAllRuleNames({ skipTsLintRules: true }).forEach(function (ruleName) { + if (readmeText.indexOf(ruleName) === -1) { + grunt.fail.warn('A rule was found that is not documented in README.md: ' + ruleName); + } + }); + getAllFormatterNames().forEach(function (formatterName) { + if (readmeText.indexOf(formatterName) === -1) { + grunt.fail.warn('A formatter was found that is not documented in README.md: ' + formatterName); + } + }); + + if (readmeText.indexOf('\nVersion ' + packageJson.version + ' ') === -1) { + grunt.fail.warn('Version not documented in README.md correctly.\n' + + 'package.json declares: ' + packageJson.version + '\n' + + 'README.md declares something different.'); } }); - if (readmeText.indexOf('\nVersion ' + packageJson.version + ' ') === -1) { - grunt.fail.warn('Version not documented in README.md correctly.\n' + - 'package.json declares: ' + packageJson.version + '\n' + - 'README.md declares something different.'); - } - }); - grunt.registerTask('validate-config', 'A task that makes sure all the rules in the project are defined to run during the build.', function () { var tslintConfig = grunt.file.readJSON('tslint.json', { encoding: 'UTF-8' }); @@ -323,7 +328,7 @@ module.exports = function(grunt) { 'no-empty-line-after-opening-brace': true }; var errors = []; - getAllRuleNames().forEach(function(ruleName) { + getAllRuleNames().forEach(function (ruleName) { if (rulesToSkip[ruleName]) { return; } @@ -346,7 +351,7 @@ module.exports = function(grunt) { const procedure = 'TSLint Procedure'; const header = 'Title,Description,ErrorID,Tool,IssueClass,IssueType,SDL Bug Bar Severity,' + 'SDL Level,Resolution,SDL Procedure,CWE,CWE Description'; - getAllRules().forEach(function(ruleFile) { + getAllRules().forEach(function (ruleFile) { const metadata = getMetadataFromFile(ruleFile); const issueClass = getMetadataValue(metadata, 'issueClass'); @@ -367,7 +372,7 @@ module.exports = function(grunt) { }); rows.sort(); rows.unshift(header); - grunt.file.write('tslint-warnings.csv', rows.join('\n'), {encoding: 'UTF-8'}); + grunt.file.write('tslint-warnings.csv', rows.join('\n'), { encoding: 'UTF-8' }); }); @@ -375,7 +380,7 @@ module.exports = function(grunt) { const groupedRows = {}; - getAllRules().forEach(function(ruleFile) { + getAllRules().forEach(function (ruleFile) { const metadata = getMetadataFromFile(ruleFile); const groupName = getMetadataValue(metadata, 'group'); @@ -396,20 +401,20 @@ module.exports = function(grunt) { _.values(groupedRows).forEach(function (element) { element.sort(); }); - let data = grunt.file.read('./templates/recommended_ruleset.js.snippet', {encoding: 'UTF-8'}); - data = data.replace('%security_rules%', groupedRows['Security'].join('\n')); - data = data.replace('%correctness_rules%', groupedRows['Correctness'].join('\n')); - data = data.replace('%clarity_rules%', groupedRows['Clarity'].join('\n')); - data = data.replace('%whitespace_rules%', groupedRows['Whitespace'].join('\n')); - data = data.replace('%configurable_rules%', groupedRows['Configurable'].join('\n')); - data = data.replace('%deprecated_rules%', groupedRows['Deprecated'].join('\n')); + let data = grunt.file.read('./templates/recommended_ruleset.js.snippet', { encoding: 'UTF-8' }); + data = data.replace('%security_rules%', groupedRows['Security'].join('\n')); + data = data.replace('%correctness_rules%', groupedRows['Correctness'].join('\n')); + data = data.replace('%clarity_rules%', groupedRows['Clarity'].join('\n')); + data = data.replace('%whitespace_rules%', groupedRows['Whitespace'].join('\n')); + data = data.replace('%configurable_rules%', groupedRows['Configurable'].join('\n')); + data = data.replace('%deprecated_rules%', groupedRows['Deprecated'].join('\n')); data = data.replace('%accessibilityy_rules%', groupedRows['Accessibility'].join('\n')); - grunt.file.write('recommended_ruleset.js', data, {encoding: 'UTF-8'}); + grunt.file.write('recommended_ruleset.js', data, { encoding: 'UTF-8' }); }); grunt.registerTask('generate-default-tslint-json', 'A task that converts recommended_ruleset.js to ./dist/build/tslint.json', function () { const data = require('./recommended_ruleset.js'); - grunt.file.write('./dist/build/tslint.json', JSON.stringify(data, null, 2), {encoding: 'UTF-8'}); + grunt.file.write('./dist/build/tslint.json', JSON.stringify(data, null, 2), { encoding: 'UTF-8' }); }); grunt.registerTask('create-rule', 'A task that creates a new rule from the rule templates. --rule-name parameter required', function () { @@ -430,21 +435,22 @@ module.exports = function(grunt) { var testFileName = './tests/' + ruleFile.charAt(0).toUpperCase() + ruleFile.substr(1) + 'Tests.ts'; var walkerName = ruleFile.charAt(0).toUpperCase() + ruleFile.substr(1) + 'Walker'; - var ruleTemplateText = grunt.file.read('./templates/rule.snippet', {encoding: 'UTF-8'}); - var testTemplateText = grunt.file.read('./templates/rule-tests.snippet', {encoding: 'UTF-8'}); + var ruleTemplateText = grunt.file.read('./templates/rule.snippet', { encoding: 'UTF-8' }); + var testTemplateText = grunt.file.read('./templates/rule-tests.snippet', { encoding: 'UTF-8' }); - grunt.file.write(sourceFileName, applyTemplates(ruleTemplateText), {encoding: 'UTF-8'}); - grunt.file.write(testFileName, applyTemplates(testTemplateText), {encoding: 'UTF-8'}); + grunt.file.write(sourceFileName, applyTemplates(ruleTemplateText), { encoding: 'UTF-8' }); + grunt.file.write(testFileName, applyTemplates(testTemplateText), { encoding: 'UTF-8' }); - var currentRuleset = grunt.file.readJSON('./tslint.json', {encoding: 'UTF-8'}); + var currentRuleset = grunt.file.readJSON('./tslint.json', { encoding: 'UTF-8' }); currentRuleset.rules[ruleName] = true; - grunt.file.write('./tslint.json', JSON.stringify(currentRuleset, null, 2), {encoding: 'UTF-8'}); + grunt.file.write('./tslint.json', JSON.stringify(currentRuleset, null, 2), { encoding: 'UTF-8' }); } }); grunt.registerTask('all', 'Performs a cleanup and a full build with all tasks', [ 'clean', - 'ts', + 'copy:json', + 'ts:default', 'mochaTest', 'tslint', 'validate-documentation', diff --git a/README.md b/README.md index 5868988a5..1bab539e8 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,12 @@ Supported Rules Rule Name | Description | Since :---------- | :------------ | ------------- +`a11y-img-has-alt` | Enforce that an `img` element contains the `alt` attribute or `role='presentation'` for decorative image. All images must have `alt` text to convey their purpose and meaning to **screen reader users**. Besides, the `alt` attribute specifies an alternate text for an image, if the image cannot be displayed. | 2.0.11 +`a11y-props` | Enforce all `aria-*` attributes are valid. Elements cannot use an invalid `aria-*` attribute. This rule will fail if it finds an `aria-*` attribute that is not listed in [WAI-ARIA states and properties](https://www.w3.org/TR/wai-aria/states_and_properties#state_prop_def). | 2.0.11 +`a11y-role-has-required-aria-props` | Elements with aria roles must have all required attributes according to the role. | 2.0.11 +`a11y-role` | Elements with aria roles must use a **valid**, **non-abstract** aria role. A reference to role defintions can be found at [WAI-ARIA roles](https://www.w3.org/TR/wai-aria/roles#role_definitions). | 2.0.11 +`a11y-role-supports-aria-props` | Enforce that elements with explicit or implicit roles defined contain only `aria-*` properties supported by that `role`. Many aria attributes (states and properties) can only be used on elements with particular roles. Some elements have implicit roles, such as ``, which will be resolved to `role='link'`. A reference for the implicit roles can be found at [Default Implicit ARIA Semantics](https://www.w3.org/TR/html-aria/#sec-strong-native-semantics). | 2.0.11 +`a11y-tabindex-no-positive` | Enforce tabindex value is **not greater than zero**. Avoid positive tabindex attribute values to synchronize the flow of the page with keyboard tab order. | 2.0.11 `chai-prefer-contains-to-index-of` | Avoid Chai assertions that invoke indexOf and compare for a -1 result. It is better to use the chai .contain() assertion API instead because the failure message will be more clearer if the test fails. | 2.0.10 `chai-vague-errors` | Avoid Chai assertions that result in vague errors. For example, asserting `expect(something).to.be.true` will result in the failure message "Expected true received false". This is a vague error message that does not reveal the underlying problem. It is especially vague in TypeScript because stack trace line numbers often do not match the source code. A better pattern to follow is the xUnit Patterns [Assertion Message](http://xunitpatterns.com/Assertion%20Message.html) pattern. The previous code sample could be better written as `expect(something).to.equal(true, 'expected something to have occurred');`| 1.0 `export-name` | The name of the exported module must match the filename of the source file. This is case-sensitive but ignores file extension. Since version 1.0, this rule takes a list of regular expressions as a parameter. Any export name matching that regular expression will be ignored. For example, to allow an exported name like myChartOptions, then configure the rule like this: "export-name": \[true, "myChartOptionsg"\]| 0.0.3 diff --git a/src/a11yImgHasAltRule.ts b/src/a11yImgHasAltRule.ts new file mode 100644 index 000000000..29dfa8bfe --- /dev/null +++ b/src/a11yImgHasAltRule.ts @@ -0,0 +1,89 @@ +/** + * @copyright Microsoft Corporation. All rights reserved. + * + * @a11yImgHasAltRule tslint rule for accessibility. + */ + +import * as ts from 'typescript'; +import * as Lint from 'tslint/lib/lint'; + +import { + getAllAttributesFromJsxElement, + getJsxAttributesFromJsxElement, + getStringLiteral +} from './utils/JsxAttribute'; +import { isJsxSpreadAttribute } from './utils/TypeGuard'; + +const roleString: string = 'role'; +const altString: string = 'alt'; + +export function getFailureStringNoAlt(tagName: string): string { + return `<${tagName}> elements must have an alt attribute or use role='presentation' for presentational images. \ +A reference for the presentation role can be found at https://www.w3.org/TR/wai-aria/roles#presentation.`; +} + +export function getFailureStringEmptyAlt(tagName: string): string { + return `The value of 'alt' attribute in <${tagName}> tag is undefined or empty. \ +Add more details in 'alt' attribute or use role='presentation' for presentational images. \ +A reference for the presentation role can be found at https://www.w3.org/TR/wai-aria/roles#presentation.`; +} + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return sourceFile.languageVariant === ts.LanguageVariant.JSX + ? this.applyWithWalker(new ImgHasAltWalker(sourceFile, this.getOptions())) + : []; + } +} + +class ImgHasAltWalker extends Lint.RuleWalker { + public visitJsxSelfClosingElement(node: ts.JsxSelfClosingElement): void { + // Tag name is sensitive on lowercase or uppercase, we shoudn't normalize tag names in this rule. + const tagName: string = node.tagName && node.tagName.getText(); + const options: any[] = this.getOptions(); // tslint:disable-line:no-any + + // The additionalTagNames are specified by tslint config to check not only 'img' tag but also customized tag. + // @example checking a customized component 'Image' which should require 'alt' attribute. + const additionalTagNames: string[] = options.length > 1 ? options[1] : []; + + // The targetTagNames is the list of tag names we want to check. + const targetTagNames: string[] = ['img'].concat(additionalTagNames); + + if (!tagName || targetTagNames.indexOf(tagName) === -1) { + return; + } + + // If element contains JsxSpreadElement in which there could possibly be alt attribute, don't check it. + if (getAllAttributesFromJsxElement(node).some(isJsxSpreadAttribute)) { + return; + } + + const attributes: { [propName: string]: ts.JsxAttribute } = getJsxAttributesFromJsxElement(node); + const role: ts.JsxAttribute = attributes[roleString]; + const roleValue: string = role && getStringLiteral(role); + + // if element has role of 'presentation', it's presentational image, don't check it; + // @example + if (roleValue && roleValue.match(/\bpresentation\b/)) { + return; + } + + const altProp: ts.JsxAttribute = attributes[altString]; + + if (!altProp) { + this.addFailure(this.createFailure( + node.getStart(), + node.getWidth(), + getFailureStringNoAlt(tagName) + )); + } else if (getStringLiteral(altProp) === '') { + this.addFailure(this.createFailure( + altProp.getStart(), + altProp.getWidth(), + getFailureStringEmptyAlt(tagName) + )); + } + + super.visitJsxSelfClosingElement(node); + } +} diff --git a/src/a11yPropsRule.ts b/src/a11yPropsRule.ts new file mode 100644 index 000000000..0d8d16642 --- /dev/null +++ b/src/a11yPropsRule.ts @@ -0,0 +1,46 @@ +/** + * @copyright Microsoft Corporation. All rights reserved. + * + * @a11yPropsRule tslint rule for accessibility. + */ + +import * as ts from 'typescript'; +import * as Lint from 'tslint/lib/lint'; + +import { getPropName } from './utils/JsxAttribute'; +import { IAria } from './utils/attributes/IAria'; + +// tslint:disable-next-line:no-require-imports no-var-requires +const aria: { [attributeName: string]: IAria } = require('./utils/attributes/ariaSchema.json'); + +export function getFailureString(name: string): string { + return `This attribute name '${name}' is an invalid ARIA attribute. \ +A reference to valid ARIA attributes can be found at \ +https://www.w3.org/TR/2014/REC-wai-aria-20140320/states_and_properties#state_prop_def `; +} + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return sourceFile.languageVariant === ts.LanguageVariant.JSX + ? this.applyWithWalker(new A11yPropsWalker(sourceFile, this.getOptions())) + : []; + } +} + +class A11yPropsWalker extends Lint.RuleWalker { + public visitJsxAttribute(node: ts.JsxAttribute): void { + const name: string = getPropName(node); + + if (!name || !name.match(/^aria-/i)) { + return; + } + + if (!aria[name.toLowerCase()]) { + this.addFailure(this.createFailure( + node.getStart(), + node.getWidth(), + getFailureString(name) + )); + } + } +} diff --git a/src/a11yRoleHasRequiredAriaPropsRule.ts b/src/a11yRoleHasRequiredAriaPropsRule.ts new file mode 100644 index 000000000..026382864 --- /dev/null +++ b/src/a11yRoleHasRequiredAriaPropsRule.ts @@ -0,0 +1,102 @@ +/** + * @copyright Microsoft Corporation. All rights reserved. + * + * @a11yRoleHasRequiredAriaPropsRule tslint rule for accessibility. + */ + +import * as ts from 'typescript'; +import * as Lint from 'tslint/lib/lint'; + +import { getImplicitRole } from './utils/getImplicitRole'; +import { + getJsxAttributesFromJsxElement, + getStringLiteral +} from './utils/JsxAttribute'; +import { IRole, IRoleSchema } from './utils/attributes/IRole'; +import { IAria } from './utils/attributes/IAria'; + +// tslint:disable-next-line:no-require-imports no-var-requires +const roleSchema: IRoleSchema = require('./utils/attributes/roleSchema.json'); +const roles: IRole[] = roleSchema.roles; + + +// tslint:disable-next-line:no-require-imports no-var-requires +const ariaAttributes: { [attributeName: string]: IAria } = require('./utils/attributes/ariaSchema.json'); +const roleString: string = 'role'; + +export function getFailureStringForNotImplicitRole( + roleNamesInElement: string[], + missingProps: string[] +): string { + return `Element with ARIA role(s) '${roleNamesInElement.join(', ')}' \ +are missing required attribute(s): ${missingProps.join(', ')}. \ +A reference to role definitions can be found at https://www.w3.org/TR/wai-aria/roles#role_definitions.`; +} + +export function getFailureStringForImplicitRole( + tagName: string, + roleNamesInElement: string, + missingProps: string[] +): string { + return `Tag '${tagName}' has implicit role '${roleNamesInElement}'. \ +It requires aria-* attributes: ${missingProps.join(', ')} that are missing in the element. \ +A reference to role definitions can be found at https://www.w3.org/TR/wai-aria/roles#role_definitions.`; +} + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return sourceFile.languageVariant === ts.LanguageVariant.JSX + ? this.applyWithWalker(new A11yRoleHasRequiredAriaPropsWalker(sourceFile, this.getOptions())) + : []; + } +} + +class A11yRoleHasRequiredAriaPropsWalker extends Lint.RuleWalker { + public visitJsxElement(node: ts.JsxElement): void { + this.checkJsxElement(node.openingElement); + super.visitJsxElement(node); + } + + public visitJsxSelfClosingElement(node: ts.JsxSelfClosingElement): void { + this.checkJsxElement(node); + super.visitJsxSelfClosingElement(node); + } + + private checkJsxElement(node: ts.JsxOpeningElement): void { + const attributesInElement: { [propName: string]: ts.JsxAttribute } = getJsxAttributesFromJsxElement(node); + const roleProp: ts.JsxAttribute = attributesInElement[roleString]; + + // If role attribute is specified, get the role value. Otherwise get the implicit role from tag name. + const roleValue: string = roleProp ? getStringLiteral(roleProp) : getImplicitRole(node); + const isImplicitRole: boolean = !roleProp && !!roleValue; + const normalizedRoles: string[] = (roleValue || '').toLowerCase().split(' ') + .filter((role: string) => !!roles[role]); + + if (normalizedRoles.length === 0) { + return; + } + + let requiredAttributeNames: string[] = []; + + normalizedRoles.forEach((role: string) => { + requiredAttributeNames = requiredAttributeNames.concat(roles[role].requiredProps || []); + }); + + const attributeNamesInElement: string[] = Object.keys(attributesInElement) + .filter((attributeName: string) => !!ariaAttributes[attributeName.toLowerCase()]); + + // Get the list of missing required aria-* attributes in current element. + const missingAttributes: string[] = requiredAttributeNames + .filter((attributeName: string) => attributeNamesInElement.indexOf(attributeName) === -1); + + if (missingAttributes.length > 0) { + this.addFailure(this.createFailure( + node.getStart(), + node.getWidth(), + isImplicitRole ? + getFailureStringForImplicitRole(node.tagName.getText(), normalizedRoles[0], missingAttributes) : + getFailureStringForNotImplicitRole(normalizedRoles, missingAttributes) + )); + } + } +} diff --git a/src/a11yRoleRule.ts b/src/a11yRoleRule.ts new file mode 100644 index 000000000..c25a55a0c --- /dev/null +++ b/src/a11yRoleRule.ts @@ -0,0 +1,70 @@ +/** + * @copyright Microsoft Corporation. All rights reserved. + * + * @a11yRole tslint rule for accessibility. + */ + +import * as ts from 'typescript'; +import * as Lint from 'tslint/lib/lint'; +import { getPropName, getStringLiteral } from './utils/JsxAttribute'; +import { IRole, IRoleSchema } from './utils/attributes/IRole'; + +// tslint:disable-next-line:no-require-imports no-var-requires +const roleSchema: IRoleSchema = require('./utils/attributes/roleSchema.json'); +const roles: IRole[] = roleSchema.roles; + +// The array of non-abstract valid rules. +const validRoles: string[] = Object.keys(roles).filter(role => roles[role].isAbstract === false); + +export function getFailureStringUndefinedRole(): string { + return '\'role\' attribute empty. Either select a role from https://www.w3.org/TR/wai-aria/roles#role_definitions, ' + + 'or simply remove this attribute'; +} + +export function getFailureStringInvalidRole(invalidRoleName: string): string { + return `Invalid role attribute value '${invalidRoleName}', elements with ARIA roles must use a valid, \ +non-abstract ARIA role. A reference to role definitions can be found at \ +https://www.w3.org/TR/wai-aria/roles#role_definitions.`; +} + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return sourceFile.languageVariant === ts.LanguageVariant.JSX + ? this.applyWithWalker(new A11yRoleRuleWalker(sourceFile, this.getOptions())) + : []; + } +} + +class A11yRoleRuleWalker extends Lint.RuleWalker { + public visitJsxAttribute(node: ts.JsxAttribute): void { + const name: string = getPropName(node); + + if (!name || name.toLowerCase() !== 'role') { + return; + } + + const roleValue: string = getStringLiteral(node); + + if (roleValue) { + // Splitted by space doesn't mean the multiple role definition is correct, + // just because this rule is not checking if it is using multiple role definition. + const normalizedValues: string[] = roleValue.toLowerCase().split(' '); + + if (normalizedValues.some(value => value && validRoles.indexOf(value) === -1)) { + this.addFailure(this.createFailure( + node.getStart(), + node.getWidth(), + getFailureStringInvalidRole(roleValue) + )); + } + } else if (roleValue === '') { + this.addFailure(this.createFailure( + node.getStart(), + node.getWidth(), + getFailureStringUndefinedRole() + )); + } + + super.visitJsxAttribute(node); + } +} diff --git a/src/a11yRoleSupportsAriaPropsRule.ts b/src/a11yRoleSupportsAriaPropsRule.ts new file mode 100644 index 000000000..32c97e8ad --- /dev/null +++ b/src/a11yRoleSupportsAriaPropsRule.ts @@ -0,0 +1,84 @@ +/** + * @copyright Microsoft Corporation. All rights reserved. + * + * @a11yRoleSupportsAriaPropsRule tslint rule for accessibility. + */ + +import * as ts from 'typescript'; +import * as Lint from 'tslint/lib/lint'; +import { getImplicitRole } from './utils/getImplicitRole'; +import { getJsxAttributesFromJsxElement, getStringLiteral } from './utils/JsxAttribute'; +import { IRole, IRoleSchema } from './utils/attributes/IRole'; +import { IAria } from './utils/attributes/IAria'; + +// tslint:disable:no-require-imports no-var-requires +const roleSchema: IRoleSchema = require('./utils/attributes/roleSchema.json'); +const ariaAttributes: { [attributeName: string]: IAria } = require('./utils/attributes/ariaSchema.json'); +// tslint:enable:no-require-imports no-var-requires + +const roles: IRole[] = roleSchema.roles; +const roleString: string = 'role'; + +export function getFailureStringForNotImplicitRole(roleNamesInElement: string[], invalidPropNames: string[]): string { + return `Attribute(s) ${invalidPropNames.join(', ')} are not supported by role(s) ${roleNamesInElement.join(', ')}. \ +You are using incorrect role or incorrect aria-* attribute`; +} + +export function getFailureStringForImplicitRole(tagName: string, roleName: string, invalidPropNames: string[]): string { + return `Attribute(s) ${invalidPropNames.join(', ')} not supported \ + by role ${roleName} which is implicitly set by the HTML tag ${tagName}.`; +} + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return sourceFile.languageVariant === ts.LanguageVariant.JSX + ? this.applyWithWalker(new A11yRoleSupportsAriaPropsWalker(sourceFile, this.getOptions())) + : []; + } +} + +class A11yRoleSupportsAriaPropsWalker extends Lint.RuleWalker { + public visitJsxElement(node: ts.JsxElement): void { + this.checkJsxElement(node.openingElement); + super.visitJsxElement(node); + } + + public visitJsxSelfClosingElement(node: ts.JsxSelfClosingElement): void { + this.checkJsxElement(node); + super.visitJsxSelfClosingElement(node); + } + + private checkJsxElement(node: ts.JsxOpeningElement): void { + const attributesInElement: { [propName: string]: ts.JsxAttribute } = getJsxAttributesFromJsxElement(node); + const roleProp: ts.JsxAttribute = attributesInElement[roleString]; + + // If role attribute is specified, get the role value. Otherwise get the implicit role from tag name. + const roleValue: string = roleProp ? getStringLiteral(roleProp) : getImplicitRole(node); + const isImplicitRole: boolean = !roleProp && !!roleValue; + const normalizedRoles: string[] = (roleValue || '').toLowerCase().split(' ') + .filter((role: string) => !!roles[role]); + + let supportedAttributeNames: string[] = roleSchema.globalSupportedProps; + + normalizedRoles.forEach((role: string) => { + supportedAttributeNames = supportedAttributeNames.concat(roles[role].additionalSupportedProps || []); + }); + + const attributeNamesInElement: string[] = Object.keys(attributesInElement) + .filter((attributeName: string) => !!ariaAttributes[attributeName.toLowerCase()]); + + // Get the list of not-supported aria-* attributes in current element. + const invalidAttributeNamesInElement: string[] = attributeNamesInElement + .filter((attributeName: string) => supportedAttributeNames.indexOf(attributeName) === -1); + + if (invalidAttributeNamesInElement.length > 0) { + this.addFailure(this.createFailure( + node.getStart(), + node.getWidth(), + isImplicitRole ? + getFailureStringForImplicitRole(node.tagName.getText(), normalizedRoles[0], invalidAttributeNamesInElement) : + getFailureStringForNotImplicitRole(normalizedRoles, invalidAttributeNamesInElement) + )); + } + } +} diff --git a/src/a11yTabindexNoPositiveRule.ts b/src/a11yTabindexNoPositiveRule.ts index f72a563e6..164b53233 100644 --- a/src/a11yTabindexNoPositiveRule.ts +++ b/src/a11yTabindexNoPositiveRule.ts @@ -1,7 +1,7 @@ /** * @copyright Microsoft Corporation. All rights reserved. * - * @a11yTabindexNoPositiveRule tslint rule of accessibility. + * @a11yTabindexNoPositiveRule tslint rule for accessibility. */ import * as ts from 'typescript'; @@ -9,7 +9,7 @@ import * as Lint from 'tslint/lib/lint'; import { getPropName, getStringLiteral, getNumericLiteral } from './utils/JsxAttribute'; export function getFailureString(): string { - return `The value of 'tabindex' attribute is invalid or undefined. It must be either -1 or 0.`; + return 'The value of tabindex attribute is invalid or undefined. It must be either -1 or 0.'; } export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/utils/JsxAttribute.ts b/src/utils/JsxAttribute.ts index 6bf74a989..e33cc7d83 100644 --- a/src/utils/JsxAttribute.ts +++ b/src/utils/JsxAttribute.ts @@ -44,7 +44,7 @@ export function getStringLiteral(node: ts.JsxAttribute): string { } else if (isStringLiteral(initializer)) { // return initializer.text.trim(); } else if (isJsxExpression(initializer) && isStringLiteral(initializer.expression)) { // - return (initializer.expression as ts.StringLiteral).text; + return (initializer.expression).text; } else if (isJsxExpression(initializer) && !initializer.expression) { // return ''; } else { @@ -65,7 +65,7 @@ export function getNumericLiteral(node: ts.JsxAttribute): string { const initializer: ts.Expression = node.initializer; return isJsxExpression(initializer) && isNumericLiteral(initializer.expression) - ? (initializer.expression as ts.LiteralExpression).text + ? (initializer.expression).text : undefined; } @@ -94,7 +94,7 @@ export function getAllAttributesFromJsxElement(node: ts.Node): (ts.JsxAttribute * @returns { [propName: string]: ts.JsxAttribute } a dictionary has lowercase keys. */ export function getJsxAttributesFromJsxElement(node: ts.Node): { [propName: string]: ts.JsxAttribute } { - let attributesDictionary: { [propName: string]: ts.JsxAttribute } = {}; + const attributesDictionary: { [propName: string]: ts.JsxAttribute } = {}; getAllAttributesFromJsxElement(node).forEach((attr) => { if (isJsxAttribute(attr)) { diff --git a/src/utils/attributes/IAria.ts b/src/utils/attributes/IAria.ts index 27705f826..4ea7fe7da 100644 --- a/src/utils/attributes/IAria.ts +++ b/src/utils/attributes/IAria.ts @@ -1,4 +1,8 @@ +/** + * Interface of aria attribute. + */ export interface IAria { + // tslint:disable-next-line:no-reserved-keywords type: string; values: string[]; allowUndefined: boolean; diff --git a/src/utils/attributes/IRole.ts b/src/utils/attributes/IRole.ts index dbf8711b5..975f4add5 100644 --- a/src/utils/attributes/IRole.ts +++ b/src/utils/attributes/IRole.ts @@ -1,5 +1,16 @@ +/** + * Interface of role. + */ export interface IRole { requiredProps: string[]; - supportedProps: string[]; + additionalSupportedProps: string[]; isAbstract: boolean; -} \ No newline at end of file +} + +/** + * Interface of role schema. + */ +export interface IRoleSchema { + roles: IRole[]; + globalSupportedProps: string[]; +} diff --git a/src/utils/attributes/roleSchema.json b/src/utils/attributes/roleSchema.json index bad97abd6..88db45105 100644 --- a/src/utils/attributes/roleSchema.json +++ b/src/utils/attributes/roleSchema.json @@ -1,2739 +1,976 @@ { - "alert": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "alertdialog": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "application": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "article": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "banner": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "button": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-pressed", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "checkbox": { - "requiredProps": [ - "aria-checked" - ], - "supportedProps": [ - "aria-checked", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "columnheader": { - "requiredProps": [], - "supportedProps": [ - "aria-sort", - "aria-readonly", - "aria-required", - "aria-selected", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "combobox": { - "requiredProps": [ - "aria-expanded" - ], - "supportedProps": [ - "aria-expanded", - "aria-autocomplete", - "aria-required", - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "command": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "complementary": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "composite": { - "supportedProps": [ - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "contentinfo": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "definition": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "dialog": { - "requiredProps": [], - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "isAbstract": false - }, - "directory": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "doc-abstract": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-acknowledgments": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-afterword": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-appendix": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-backlink": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-biblioentry": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-level", - "aria-live", - "aria-owns", - "aria-posinset", - "aria-relevant", - "aria-setsize" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-bibliography": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-biblioref": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-chapter": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-colophon": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-conclusion": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-cover": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-credit": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-credits": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-dedication": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-endnote": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-level", - "aria-live", - "aria-owns", - "aria-posinset", - "aria-relevant", - "aria-setsize" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-endnotes": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-epigraph": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-epilogue": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-errata": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-example": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-footnote": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-foreword": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-glossary": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-glossref": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-index": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-introduction": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-noteref": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-notice": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-pagebreak": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-orientation", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-pagelist": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-part": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-preface": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-prologue": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-pullquote": { - "supportedProps": [], - "requiredProps": [], - "isAbstract": false - }, - "doc-qna": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-subtitle": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-tip": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "doc-toc": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-current", - "aria-describedat", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-expanded", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": false - }, - "document": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "form": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "grid": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-multiselectable", - "aria-readonly", - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-expanded" - ] - }, - "gridcell": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-readonly", - "aria-required", - "aria-selected", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "group": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-activedescendant", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "heading": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "img": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "input": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "landmark": { - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "link": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "list": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "listbox": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-multiselectable", - "aria-required", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-activedescendant" - ] - }, - "listitem": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-posinset", - "aria-setsize", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "log": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "main": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "marquee": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "math": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "menu": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-activedescendant" - ] - }, - "menubar": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-activedescendant" - ] - }, - "menuitem": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "menuitemcheckbox": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-checked", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "menuitemradio": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-checked", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-posinset", - "aria-selected", - "aria-setsize" - ] - }, - "navigation": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "note": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "option": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-checked", - "aria-posinset", - "aria-selected", - "aria-setsize", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "presentation": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "progressbar": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-valuemax", - "aria-valuemin", - "aria-valuenow", - "aria-valuetext", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "radio": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-checked", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-posinset", - "aria-selected", - "aria-setsize" - ] - }, - "radiogroup": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-required", - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-expanded" - ] - }, - "range": { - "supportedProps": [ - "aria-valuemax", - "aria-valuemin", - "aria-valuenow", - "aria-valuetext", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "region": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "roletype": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "row": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-selected", - "aria-activedescendant", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "rowgroup": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-activedescendant", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "rowheader": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-sort", - "aria-readonly", - "aria-required", - "aria-selected", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "search": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "section": { - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "sectionhead": { - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "select": { - "supportedProps": [ - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-expanded" - ], - "requiredProps": [], - "isAbstract": true - }, - "separator": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-orientation", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "scrollbar": { - "requiredProps": [ - "aria-controls", - "aria-orientation", - "aria-valuemax", - "aria-valuemin", - "aria-valuenow" - ], - "isAbstract": false, - "supportedProps": [ - "aria-controls", - "aria-orientation", - "aria-valuemax", - "aria-valuemin", - "aria-valuenow", - "aria-atomic", - "aria-busy", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-valuetext" - ] - }, - "slider": { - "requiredProps": [ - "aria-valuemax", - "aria-valuemin", - "aria-valuenow" - ], - "isAbstract": false, - "supportedProps": [ - "aria-valuemax", - "aria-valuemin", - "aria-valuenow", - "aria-orientation", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-valuetext" - ] - }, - "spinbutton": { - "requiredProps": [ - "aria-valuemax", - "aria-valuemin", - "aria-valuenow" - ], - "isAbstract": false, - "supportedProps": [ - "aria-valuemax", - "aria-valuemin", - "aria-valuenow", - "aria-required", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-valuetext" - ] - }, - "status": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "structure": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "tab": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-selected", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "tablist": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-expanded" - ] - }, - "tabpanel": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "textbox": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-activedescendant", - "aria-autocomplete", - "aria-multiline", - "aria-readonly", - "aria-required", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "timer": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "toolbar": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-activedescendant", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "tooltip": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ] - }, - "tree": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-multiselectable", - "aria-required", - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-expanded" - ] - }, - "treegrid": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-multiselectable", - "aria-readonly", - "aria-activedescendant", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-expanded", - "aria-required" - ] - }, - "treeitem": { - "requiredProps": [], - "isAbstract": false, - "supportedProps": [ - "aria-level", - "aria-posinset", - "aria-setsize", - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant", - "aria-checked", - "aria-selected" - ] - }, - "widget": { - "supportedProps": [ - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - }, - "window": { - "supportedProps": [ - "aria-expanded", - "aria-atomic", - "aria-busy", - "aria-controls", - "aria-describedby", - "aria-disabled", - "aria-dropeffect", - "aria-flowto", - "aria-grabbed", - "aria-haspopup", - "aria-hidden", - "aria-invalid", - "aria-label", - "aria-labelledby", - "aria-live", - "aria-owns", - "aria-relevant" - ], - "requiredProps": [], - "isAbstract": true - } -} + "roles": { + "alert": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "alertdialog": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "application": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "article": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "banner": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "button": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded", + "aria-pressed" + ], + "isAbstract": false + }, + "checkbox": { + "requiredProps": [ + "aria-checked" + ], + "additionalSupportedProps": [ + "aria-checked" + ], + "isAbstract": false + }, + "columnheader": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-sort", + "aria-readonly", + "aria-required", + "aria-selected", + "aria-expanded" + ], + "isAbstract": false + }, + "combobox": { + "requiredProps": [ + "aria-expanded" + ], + "additionalSupportedProps": [ + "aria-expanded", + "aria-autocomplete", + "aria-required", + "aria-activedescendant" + ], + "isAbstract": false + }, + "command": { + "additionalSupportedProps": [], + "requiredProps": [], + "isAbstract": true + }, + "complementary": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "composite": { + "additionalSupportedProps": [ + "aria-activedescendant" + ], + "requiredProps": [], + "isAbstract": true + }, + "contentinfo": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "definition": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "dialog": { + "requiredProps": [], + "additionalSupportedProps": [ + "aria-expanded" + ], + "isAbstract": false + }, + "directory": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "doc-abstract": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-acknowledgments": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-afterword": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-appendix": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-backlink": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-biblioentry": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded", + "aria-level", + "aria-posinset", + "aria-setsize" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-bibliography": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-biblioref": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-chapter": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-colophon": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-conclusion": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-cover": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-credit": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-credits": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-dedication": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-endnote": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded", + "aria-level", + "aria-posinset", + "aria-setsize" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-endnotes": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-epigraph": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-epilogue": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-errata": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-example": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-footnote": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-foreword": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-glossary": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-glossref": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-index": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-introduction": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-noteref": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-notice": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-pagebreak": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded", + "aria-orientation" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-pagelist": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-part": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-preface": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-prologue": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-pullquote": { + "additionalSupportedProps": [], + "requiredProps": [], + "isAbstract": false + }, + "doc-qna": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-subtitle": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-tip": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "doc-toc": { + "additionalSupportedProps": [ + "aria-current", + "aria-describedat", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": false + }, + "document": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "form": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "grid": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-multiselectable", + "aria-readonly", + "aria-activedescendant", + "aria-expanded" + ] + }, + "gridcell": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-readonly", + "aria-required", + "aria-selected", + "aria-expanded" + ] + }, + "group": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-activedescendant", + "aria-expanded" + ] + }, + "heading": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-expanded" + ] + }, + "img": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "input": { + "additionalSupportedProps": [], + "requiredProps": [], + "isAbstract": true + }, + "landmark": { + "additionalSupportedProps": [ + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": true + }, + "link": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "list": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "listbox": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-multiselectable", + "aria-required", + "aria-expanded", + "aria-activedescendant" + ] + }, + "listitem": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-posinset", + "aria-setsize", + "aria-expanded" + ] + }, + "log": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "main": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "marquee": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "math": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "menu": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded", + "aria-activedescendant" + ] + }, + "menubar": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded", + "aria-activedescendant" + ] + }, + "menuitem": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [] + }, + "menuitemcheckbox": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-checked" + ] + }, + "menuitemradio": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-checked", + "aria-posinset", + "aria-selected", + "aria-setsize" + ] + }, + "navigation": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "note": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "option": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-checked", + "aria-posinset", + "aria-selected", + "aria-setsize" + ] + }, + "presentation": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [] + }, + "progressbar": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-valuemax", + "aria-valuemin", + "aria-valuenow", + "aria-valuetext" + ] + }, + "radio": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-checked", + "aria-posinset", + "aria-selected", + "aria-setsize" + ] + }, + "radiogroup": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-required", + "aria-activedescendant", + "aria-expanded" + ] + }, + "range": { + "additionalSupportedProps": [ + "aria-valuemax", + "aria-valuemin", + "aria-valuenow", + "aria-valuetext" + ], + "requiredProps": [], + "isAbstract": true + }, + "region": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "roletype": { + "additionalSupportedProps": [], + "requiredProps": [], + "isAbstract": true + }, + "row": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-selected", + "aria-activedescendant", + "aria-expanded" + ] + }, + "rowgroup": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-activedescendant", + "aria-expanded" + ] + }, + "rowheader": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-sort", + "aria-readonly", + "aria-required", + "aria-selected", + "aria-expanded" + ] + }, + "search": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "section": { + "additionalSupportedProps": [ + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": true + }, + "sectionhead": { + "additionalSupportedProps": [ + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": true + }, + "select": { + "additionalSupportedProps": [ + "aria-activedescendant", + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": true + }, + "separator": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded", + "aria-orientation" + ] + }, + "scrollbar": { + "requiredProps": [ + "aria-controls", + "aria-orientation", + "aria-valuemax", + "aria-valuemin", + "aria-valuenow" + ], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-orientation", + "aria-valuemax", + "aria-valuemin", + "aria-valuenow", + "aria-valuetext" + ] + }, + "slider": { + "requiredProps": [ + "aria-valuemax", + "aria-valuemin", + "aria-valuenow" + ], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-valuemax", + "aria-valuemin", + "aria-valuenow", + "aria-orientation", + "aria-valuetext" + ] + }, + "spinbutton": { + "requiredProps": [ + "aria-valuemax", + "aria-valuemin", + "aria-valuenow" + ], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-valuemax", + "aria-valuemin", + "aria-valuenow", + "aria-required", + "aria-valuetext" + ] + }, + "status": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "structure": { + "additionalSupportedProps": [], + "requiredProps": [], + "isAbstract": true + }, + "tab": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-selected", + "aria-expanded" + ] + }, + "tablist": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-activedescendant", + "aria-expanded" + ] + }, + "tabpanel": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "textbox": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-activedescendant", + "aria-autocomplete", + "aria-multiline", + "aria-readonly", + "aria-required" + ] + }, + "timer": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "toolbar": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-activedescendant", + "aria-expanded" + ] + }, + "tooltip": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-expanded" + ] + }, + "tree": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-multiselectable", + "aria-required", + "aria-activedescendant", + "aria-expanded" + ] + }, + "treegrid": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-multiselectable", + "aria-readonly", + "aria-activedescendant", + "aria-expanded", + "aria-required" + ] + }, + "treeitem": { + "requiredProps": [], + "isAbstract": false, + "additionalSupportedProps": [ + "aria-level", + "aria-posinset", + "aria-setsize", + "aria-expanded", + "aria-checked", + "aria-selected" + ] + }, + "widget": { + "additionalSupportedProps": [], + "requiredProps": [], + "isAbstract": true + }, + "window": { + "extraadditionalSupportedProps": [ + "aria-expanded" + ], + "requiredProps": [], + "isAbstract": true + } + }, + "globalSupportedProps": [ + "aria-atomic", + "aria-busy", + "aria-controls", + "aria-describedby", + "aria-disabled", + "aria-dropeffect", + "aria-flowto", + "aria-grabbed", + "aria-haspopup", + "aria-hidden", + "aria-invalid", + "aria-label", + "aria-labelledby", + "aria-live", + "aria-owns", + "aria-relevant" + ] +} \ No newline at end of file diff --git a/src/utils/implicitRoles/a.ts b/src/utils/implicitRoles/a.ts index 27a783efc..259c02e99 100644 --- a/src/utils/implicitRoles/a.ts +++ b/src/utils/implicitRoles/a.ts @@ -2,6 +2,7 @@ import * as ts from 'typescript'; import { getJsxAttributesFromJsxElement } from '../JsxAttribute'; const hrefString: string = 'href'; + /** * @Returns the implicit role for an anchor tag. */ diff --git a/src/utils/implicitRoles/area.ts b/src/utils/implicitRoles/area.ts index 513f04588..743c87d27 100644 --- a/src/utils/implicitRoles/area.ts +++ b/src/utils/implicitRoles/area.ts @@ -2,6 +2,7 @@ import * as ts from 'typescript'; import { getJsxAttributesFromJsxElement } from '../JsxAttribute'; const hrefString: string = 'href'; + /** * @Returns the implicit role for an area tag. */ diff --git a/src/utils/implicitRoles/index.ts b/src/utils/implicitRoles/index.ts index 76556d99d..a22992908 100644 --- a/src/utils/implicitRoles/index.ts +++ b/src/utils/implicitRoles/index.ts @@ -36,6 +36,9 @@ import { TFOOT } from './tfoot'; import { THEAD } from './thead'; import { UL } from './ul'; +/** + * All functions of getting implicit role. + */ export { A, AREA, diff --git a/src/utils/implicitRoles/input.ts b/src/utils/implicitRoles/input.ts index 67f457614..3b0ab27a3 100644 --- a/src/utils/implicitRoles/input.ts +++ b/src/utils/implicitRoles/input.ts @@ -7,10 +7,10 @@ const typeString: string = 'type'; * @Returns the implicit role for an input tag. */ function getImplicitRoleForInput(node: ts.Node): string { - const type: ts.JsxAttribute = getJsxAttributesFromJsxElement(node)[typeString]; + const typeProp: ts.JsxAttribute = getJsxAttributesFromJsxElement(node)[typeString]; - if (type) { - const value: string = getStringLiteral(type) || ''; + if (typeProp) { + const value: string = getStringLiteral(typeProp) || ''; /* tslint:disable:no-switch-case-fall-through */ switch (value.toUpperCase()) { diff --git a/src/utils/implicitRoles/menu.ts b/src/utils/implicitRoles/menu.ts index b16ba326b..d38d38354 100644 --- a/src/utils/implicitRoles/menu.ts +++ b/src/utils/implicitRoles/menu.ts @@ -7,10 +7,10 @@ const typeString: string = 'type'; * @Returns the implicit role for a menu tag. */ function getImplicitRoleForMenu(node: ts.Node): string { - const type: ts.JsxAttribute = getJsxAttributesFromJsxElement(node)[typeString]; + const typeProp: ts.JsxAttribute = getJsxAttributesFromJsxElement(node)[typeString]; - if (type) { - const value: string = getStringLiteral(type) || undefined; + if (typeProp) { + const value: string = getStringLiteral(typeProp) || undefined; return (value && value.toUpperCase() === 'TOOLBAR') ? 'toolbar' : undefined; } diff --git a/src/utils/implicitRoles/menuitem.ts b/src/utils/implicitRoles/menuitem.ts index f4cc15312..dab772bd4 100644 --- a/src/utils/implicitRoles/menuitem.ts +++ b/src/utils/implicitRoles/menuitem.ts @@ -7,10 +7,10 @@ const typeString: string = 'type'; * @Returns the implicit role for a menuitem tag. */ function getImplicitRoleForMenuitem(node: ts.Node): string { - const type: ts.JsxAttribute = getJsxAttributesFromJsxElement(node)[typeString]; + const typeProp: ts.JsxAttribute = getJsxAttributesFromJsxElement(node)[typeString]; - if (type) { - const value: string = getStringLiteral(type) || ''; + if (typeProp) { + const value: string = getStringLiteral(typeProp) || ''; switch (value.toUpperCase()) { case 'COMMAND': diff --git a/test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasEmptyAltValue.tsx b/test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasEmptyAltValue.tsx new file mode 100644 index 000000000..e0787a6ce --- /dev/null +++ b/test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasEmptyAltValue.tsx @@ -0,0 +1,6 @@ + + + + + +{''} diff --git a/test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasNoAltProp.tsx b/test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasNoAltProp.tsx new file mode 100644 index 000000000..8cd5a2b1b --- /dev/null +++ b/test-data/a11yImgHasAlt/CustomElementTests/FailingTestInputs/CustomElementHasNoAltProp.tsx @@ -0,0 +1,4 @@ + + + + diff --git a/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasPresentationRole.tsx b/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasPresentationRole.tsx new file mode 100644 index 000000000..23125f21a --- /dev/null +++ b/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasPresentationRole.tsx @@ -0,0 +1,6 @@ + + + + +{''} + diff --git a/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasValidAltValue.tsx b/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasValidAltValue.tsx new file mode 100644 index 000000000..6c2d96a38 --- /dev/null +++ b/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/CustomElementHasValidAltValue.tsx @@ -0,0 +1,6 @@ + + + +validAltValue +{validAltValue} +{'validAltValue'} diff --git a/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/ElementNeitherImgNorCustomElement.tsx b/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/ElementNeitherImgNorCustomElement.tsx new file mode 100644 index 000000000..a45bced8c --- /dev/null +++ b/test-data/a11yImgHasAlt/CustomElementTests/PassingTestInputs/ElementNeitherImgNorCustomElement.tsx @@ -0,0 +1,3 @@ +
+ +