govuk_publishing_components 18.1.0 → 18.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/CHANGELOG.md +741 -0
- data/node_modules/axe-core/CONTRIBUTING.md +187 -0
- data/node_modules/axe-core/LICENSE +362 -0
- data/node_modules/axe-core/README.md +147 -0
- data/node_modules/axe-core/axe.d.ts +216 -0
- data/node_modules/axe-core/axe.js +15298 -0
- data/node_modules/axe-core/axe.min.js +12 -0
- data/node_modules/axe-core/bower.json +40 -0
- data/node_modules/axe-core/doc/API.md +798 -0
- data/node_modules/axe-core/doc/accessibility-supported.md +33 -0
- data/node_modules/axe-core/doc/act-rules-format.md +37 -0
- data/node_modules/axe-core/doc/aria-supported.md +23 -0
- data/node_modules/axe-core/doc/axelogo2018.png +0 -0
- data/node_modules/axe-core/doc/code-submission-guidelines.md +178 -0
- data/node_modules/axe-core/doc/developer-guide.md +500 -0
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/README.md +13 -0
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/axe-cdp.js +81 -0
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/package.json +8 -0
- data/node_modules/axe-core/doc/examples/html-handlebars.md +164 -0
- data/node_modules/axe-core/doc/examples/jasmine/README.md +37 -0
- data/node_modules/axe-core/doc/examples/jasmine/package.json +20 -0
- data/node_modules/axe-core/doc/examples/jasmine/spec/a11y.js +36 -0
- data/node_modules/axe-core/doc/examples/jest_react/README.md +41 -0
- data/node_modules/axe-core/doc/examples/jest_react/link.js +7 -0
- data/node_modules/axe-core/doc/examples/jest_react/link.test.js +24 -0
- data/node_modules/axe-core/doc/examples/jest_react/package.json +28 -0
- data/node_modules/axe-core/doc/examples/jest_react/test-helpers.js +21 -0
- data/node_modules/axe-core/doc/examples/mocha/README.md +37 -0
- data/node_modules/axe-core/doc/examples/mocha/package.json +21 -0
- data/node_modules/axe-core/doc/examples/phantomjs/README.md +17 -0
- data/node_modules/axe-core/doc/examples/phantomjs/axe-phantom.js +51 -0
- data/node_modules/axe-core/doc/examples/phantomjs/package.json +19 -0
- data/node_modules/axe-core/doc/examples/puppeteer/README.md +12 -0
- data/node_modules/axe-core/doc/examples/puppeteer/axe-puppeteer.js +60 -0
- data/node_modules/axe-core/doc/examples/puppeteer/package.json +10 -0
- data/node_modules/axe-core/doc/examples/qunit/README.md +37 -0
- data/node_modules/axe-core/doc/examples/qunit/package.json +21 -0
- data/node_modules/axe-core/doc/plugins.md +123 -0
- data/node_modules/axe-core/doc/projects.md +44 -0
- data/node_modules/axe-core/doc/rule-descriptions.md +79 -0
- data/node_modules/axe-core/doc/rule-development.md +95 -0
- data/node_modules/axe-core/doc/rule-proposal.md +106 -0
- data/node_modules/axe-core/lib/checks/aria/abstractrole.js +1 -0
- data/node_modules/axe-core/lib/checks/aria/abstractrole.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/allowed-attr.js +39 -0
- data/node_modules/axe-core/lib/checks/aria/allowed-attr.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/aria-allowed-role.js +28 -0
- data/node_modules/axe-core/lib/checks/aria/aria-allowed-role.json +16 -0
- data/node_modules/axe-core/lib/checks/aria/aria-hidden-body.js +1 -0
- data/node_modules/axe-core/lib/checks/aria/aria-hidden-body.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/errormessage.js +33 -0
- data/node_modules/axe-core/lib/checks/aria/errormessage.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/has-widget-role.js +6 -0
- data/node_modules/axe-core/lib/checks/aria/has-widget-role.json +12 -0
- data/node_modules/axe-core/lib/checks/aria/implicit-role-fallback.js +6 -0
- data/node_modules/axe-core/lib/checks/aria/implicit-role-fallback.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/invalidrole.js +3 -0
- data/node_modules/axe-core/lib/checks/aria/invalidrole.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/required-attr.js +28 -0
- data/node_modules/axe-core/lib/checks/aria/required-attr.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/required-children.js +117 -0
- data/node_modules/axe-core/lib/checks/aria/required-children.json +15 -0
- data/node_modules/axe-core/lib/checks/aria/required-parent.js +87 -0
- data/node_modules/axe-core/lib/checks/aria/required-parent.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedattr.js +39 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedattr.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedrole.js +1 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedrole.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr-value.js +32 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr-value.json +12 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr.js +25 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr.json +12 -0
- data/node_modules/axe-core/lib/checks/aria/valid-scrollable-semantics.js +62 -0
- data/node_modules/axe-core/lib/checks/aria/valid-scrollable-semantics.json +12 -0
- data/node_modules/axe-core/lib/checks/color/color-contrast.js +70 -0
- data/node_modules/axe-core/lib/checks/color/color-contrast.json +24 -0
- data/node_modules/axe-core/lib/checks/color/link-in-text-block.js +85 -0
- data/node_modules/axe-core/lib/checks/color/link-in-text-block.json +19 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-appropriate.js +67 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-appropriate.json +11 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-valid.js +2 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-valid.json +11 -0
- data/node_modules/axe-core/lib/checks/forms/fieldset-after.js +25 -0
- data/node_modules/axe-core/lib/checks/forms/fieldset.js +109 -0
- data/node_modules/axe-core/lib/checks/forms/fieldset.json +12 -0
- data/node_modules/axe-core/lib/checks/forms/group-labelledby-after.js +16 -0
- data/node_modules/axe-core/lib/checks/forms/group-labelledby.js +66 -0
- data/node_modules/axe-core/lib/checks/forms/group-labelledby.json +12 -0
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys-after.js +19 -0
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys.js +5 -0
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys.json +12 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-disabled.js +25 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-disabled.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-no-name.js +6 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-no-name.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-not-tabbable.js +25 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-not-tabbable.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/landmark-is-top-level.js +18 -0
- data/node_modules/axe-core/lib/checks/keyboard/landmark-is-top-level.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-elm-after.js +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-elm.js +9 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-heading-one.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-main.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-banner.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-contentinfo.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-main.json +14 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate.js +22 -0
- data/node_modules/axe-core/lib/checks/keyboard/tabindex.js +1 -0
- data/node_modules/axe-core/lib/checks/keyboard/tabindex.json +11 -0
- data/node_modules/axe-core/lib/checks/label/alt-space-value.js +2 -0
- data/node_modules/axe-core/lib/checks/label/alt-space-value.json +11 -0
- data/node_modules/axe-core/lib/checks/label/duplicate-img-label.js +19 -0
- data/node_modules/axe-core/lib/checks/label/duplicate-img-label.json +11 -0
- data/node_modules/axe-core/lib/checks/label/explicit.js +15 -0
- data/node_modules/axe-core/lib/checks/label/explicit.json +11 -0
- data/node_modules/axe-core/lib/checks/label/help-same-as-label.js +23 -0
- data/node_modules/axe-core/lib/checks/label/help-same-as-label.json +12 -0
- data/node_modules/axe-core/lib/checks/label/hidden-explicit-label.js +12 -0
- data/node_modules/axe-core/lib/checks/label/hidden-explicit-label.json +11 -0
- data/node_modules/axe-core/lib/checks/label/implicit.js +7 -0
- data/node_modules/axe-core/lib/checks/label/implicit.json +11 -0
- data/node_modules/axe-core/lib/checks/label/label-content-name-mismatch.js +49 -0
- data/node_modules/axe-core/lib/checks/label/label-content-name-mismatch.json +11 -0
- data/node_modules/axe-core/lib/checks/label/multiple-label.js +29 -0
- data/node_modules/axe-core/lib/checks/label/multiple-label.json +11 -0
- data/node_modules/axe-core/lib/checks/label/title-only.js +5 -0
- data/node_modules/axe-core/lib/checks/label/title-only.json +11 -0
- data/node_modules/axe-core/lib/checks/language/has-lang.js +5 -0
- data/node_modules/axe-core/lib/checks/language/has-lang.json +11 -0
- data/node_modules/axe-core/lib/checks/language/valid-lang.js +26 -0
- data/node_modules/axe-core/lib/checks/language/valid-lang.json +11 -0
- data/node_modules/axe-core/lib/checks/language/xml-lang-mismatch.js +5 -0
- data/node_modules/axe-core/lib/checks/language/xml-lang-mismatch.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/dlitem.js +23 -0
- data/node_modules/axe-core/lib/checks/lists/dlitem.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/listitem.js +18 -0
- data/node_modules/axe-core/lib/checks/lists/listitem.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/only-dlitems.js +42 -0
- data/node_modules/axe-core/lib/checks/lists/only-dlitems.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/only-listitems.js +68 -0
- data/node_modules/axe-core/lib/checks/lists/only-listitems.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/structured-dlitems.js +22 -0
- data/node_modules/axe-core/lib/checks/lists/structured-dlitems.json +11 -0
- data/node_modules/axe-core/lib/checks/media/caption.js +8 -0
- data/node_modules/axe-core/lib/checks/media/caption.json +11 -0
- data/node_modules/axe-core/lib/checks/media/description.js +8 -0
- data/node_modules/axe-core/lib/checks/media/description.json +11 -0
- data/node_modules/axe-core/lib/checks/media/frame-tested.js +28 -0
- data/node_modules/axe-core/lib/checks/media/frame-tested.json +15 -0
- data/node_modules/axe-core/lib/checks/mobile/css-orientation-lock.js +132 -0
- data/node_modules/axe-core/lib/checks/mobile/css-orientation-lock.json +12 -0
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-large.json +15 -0
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js +38 -0
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport.json +14 -0
- data/node_modules/axe-core/lib/checks/navigation/header-present.js +4 -0
- data/node_modules/axe-core/lib/checks/navigation/header-present.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/heading-order-after.js +14 -0
- data/node_modules/axe-core/lib/checks/navigation/heading-order.js +15 -0
- data/node_modules/axe-core/lib/checks/navigation/heading-order.json +12 -0
- data/node_modules/axe-core/lib/checks/navigation/internal-link-present.js +4 -0
- data/node_modules/axe-core/lib/checks/navigation/internal-link-present.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/landmark.js +3 -0
- data/node_modules/axe-core/lib/checks/navigation/landmark.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/meta-refresh.js +4 -0
- data/node_modules/axe-core/lib/checks/navigation/meta-refresh.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/p-as-heading.js +93 -0
- data/node_modules/axe-core/lib/checks/navigation/p-as-heading.json +30 -0
- data/node_modules/axe-core/lib/checks/navigation/region-after.js +1 -0
- data/node_modules/axe-core/lib/checks/navigation/region.js +85 -0
- data/node_modules/axe-core/lib/checks/navigation/region.json +12 -0
- data/node_modules/axe-core/lib/checks/navigation/skip-link.js +5 -0
- data/node_modules/axe-core/lib/checks/navigation/skip-link.json +12 -0
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title-after.js +9 -0
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title.js +6 -0
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title.json +12 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-active.json +12 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-after.js +8 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-aria.json +12 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id.js +17 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id.json +12 -0
- data/node_modules/axe-core/lib/checks/shared/aria-label.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/aria-label.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/aria-labelledby.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/aria-labelledby.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/button-has-visible-text.js +12 -0
- data/node_modules/axe-core/lib/checks/shared/button-has-visible-text.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/doc-has-title.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/doc-has-title.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/exists.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/exists.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/has-alt.js +4 -0
- data/node_modules/axe-core/lib/checks/shared/has-alt.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/has-visible-text.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/has-visible-text.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/is-on-screen.js +4 -0
- data/node_modules/axe-core/lib/checks/shared/is-on-screen.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-alt.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-alt.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-if-present.js +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-if-present.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-title.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-title.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-value.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-value.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/role-none.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/role-none.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/role-presentation.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/role-presentation.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/caption-faked.js +10 -0
- data/node_modules/axe-core/lib/checks/tables/caption-faked.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/has-caption.js +1 -0
- data/node_modules/axe-core/lib/checks/tables/has-caption.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/has-summary.js +1 -0
- data/node_modules/axe-core/lib/checks/tables/has-summary.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/has-th.js +31 -0
- data/node_modules/axe-core/lib/checks/tables/has-th.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/headers-visible-text.js +30 -0
- data/node_modules/axe-core/lib/checks/tables/html5-scope.js +5 -0
- data/node_modules/axe-core/lib/checks/tables/html5-scope.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/same-caption-summary.js +7 -0
- data/node_modules/axe-core/lib/checks/tables/same-caption-summary.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/scope-value.js +5 -0
- data/node_modules/axe-core/lib/checks/tables/scope-value.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/td-has-header.js +29 -0
- data/node_modules/axe-core/lib/checks/tables/td-has-header.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/td-headers-attr.js +62 -0
- data/node_modules/axe-core/lib/checks/tables/td-headers-attr.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/th-has-data-cells.js +76 -0
- data/node_modules/axe-core/lib/checks/tables/th-has-data-cells.json +12 -0
- data/node_modules/axe-core/lib/checks/tables/th-single-row-column.js +39 -0
- data/node_modules/axe-core/lib/checks/visibility/hidden-content.js +21 -0
- data/node_modules/axe-core/lib/checks/visibility/hidden-content.json +12 -0
- data/node_modules/axe-core/lib/commons/aria/arialabel-text.js +15 -0
- data/node_modules/axe-core/lib/commons/aria/arialabelledby-text.js +52 -0
- data/node_modules/axe-core/lib/commons/aria/attributes.js +45 -0
- data/node_modules/axe-core/lib/commons/aria/get-element-unallowed-roles.js +92 -0
- data/node_modules/axe-core/lib/commons/aria/get-owned-virtual.js +24 -0
- data/node_modules/axe-core/lib/commons/aria/get-role.js +44 -0
- data/node_modules/axe-core/lib/commons/aria/index.js +2417 -0
- data/node_modules/axe-core/lib/commons/aria/is-accessible-ref.js +55 -0
- data/node_modules/axe-core/lib/commons/aria/is-aria-role-allowed-on-element.js +41 -0
- data/node_modules/axe-core/lib/commons/aria/is-unsupported-role.js +14 -0
- data/node_modules/axe-core/lib/commons/aria/label-virtual.js +54 -0
- data/node_modules/axe-core/lib/commons/aria/named-from-contents.js +39 -0
- data/node_modules/axe-core/lib/commons/aria/roles.js +208 -0
- data/node_modules/axe-core/lib/commons/aria/validate-attr-value.js +63 -0
- data/node_modules/axe-core/lib/commons/color/contrast.js +172 -0
- data/node_modules/axe-core/lib/commons/color/element-is-distinct.js +88 -0
- data/node_modules/axe-core/lib/commons/color/get-background-color.js +411 -0
- data/node_modules/axe-core/lib/commons/color/get-foreground-color.js +32 -0
- data/node_modules/axe-core/lib/commons/color/incomplete-data.js +50 -0
- data/node_modules/axe-core/lib/commons/color/index.js +8 -0
- data/node_modules/axe-core/lib/commons/dom/elements-below-floating.js +39 -0
- data/node_modules/axe-core/lib/commons/dom/find-elms-in-context.js +28 -0
- data/node_modules/axe-core/lib/commons/dom/find-up.js +63 -0
- data/node_modules/axe-core/lib/commons/dom/get-composed-parent.js +25 -0
- data/node_modules/axe-core/lib/commons/dom/get-element-by-reference.js +34 -0
- data/node_modules/axe-core/lib/commons/dom/get-element-coordinates.js +38 -0
- data/node_modules/axe-core/lib/commons/dom/get-root-node.js +12 -0
- data/node_modules/axe-core/lib/commons/dom/get-scroll-offset.js +34 -0
- data/node_modules/axe-core/lib/commons/dom/get-tabbable-elements.js +24 -0
- data/node_modules/axe-core/lib/commons/dom/get-viewport-size.js +37 -0
- data/node_modules/axe-core/lib/commons/dom/has-content-virtual.js +73 -0
- data/node_modules/axe-core/lib/commons/dom/idrefs.js +36 -0
- data/node_modules/axe-core/lib/commons/dom/index.js +9 -0
- data/node_modules/axe-core/lib/commons/dom/is-focusable.js +90 -0
- data/node_modules/axe-core/lib/commons/dom/is-hidden-with-css.js +60 -0
- data/node_modules/axe-core/lib/commons/dom/is-html5.js +17 -0
- data/node_modules/axe-core/lib/commons/dom/is-in-text-block.js +95 -0
- data/node_modules/axe-core/lib/commons/dom/is-node.js +13 -0
- data/node_modules/axe-core/lib/commons/dom/is-offscreen.js +62 -0
- data/node_modules/axe-core/lib/commons/dom/is-visible.js +77 -0
- data/node_modules/axe-core/lib/commons/dom/is-visual-content.js +50 -0
- data/node_modules/axe-core/lib/commons/dom/shadow-elements-from-point.js +41 -0
- data/node_modules/axe-core/lib/commons/dom/visually-contains.js +62 -0
- data/node_modules/axe-core/lib/commons/dom/visually-overlaps.js +47 -0
- data/node_modules/axe-core/lib/commons/index.js +11 -0
- data/node_modules/axe-core/lib/commons/intro.stub +1 -0
- data/node_modules/axe-core/lib/commons/matches/attributes.js +23 -0
- data/node_modules/axe-core/lib/commons/matches/condition.js +19 -0
- data/node_modules/axe-core/lib/commons/matches/from-definition.js +47 -0
- data/node_modules/axe-core/lib/commons/matches/from-function.js +38 -0
- data/node_modules/axe-core/lib/commons/matches/from-primative.js +30 -0
- data/node_modules/axe-core/lib/commons/matches/index.js +37 -0
- data/node_modules/axe-core/lib/commons/matches/node-name.js +34 -0
- data/node_modules/axe-core/lib/commons/matches/properties.js +25 -0
- data/node_modules/axe-core/lib/commons/outro.stub +2 -0
- data/node_modules/axe-core/lib/commons/table/get-all-cells.js +28 -0
- data/node_modules/axe-core/lib/commons/table/get-cell-position.js +28 -0
- data/node_modules/axe-core/lib/commons/table/get-headers.js +29 -0
- data/node_modules/axe-core/lib/commons/table/get-scope.js +54 -0
- data/node_modules/axe-core/lib/commons/table/index.js +9 -0
- data/node_modules/axe-core/lib/commons/table/is-column-header.js +13 -0
- data/node_modules/axe-core/lib/commons/table/is-data-cell.js +22 -0
- data/node_modules/axe-core/lib/commons/table/is-data-table.js +190 -0
- data/node_modules/axe-core/lib/commons/table/is-header.js +22 -0
- data/node_modules/axe-core/lib/commons/table/is-row-header.js +13 -0
- data/node_modules/axe-core/lib/commons/table/to-grid.js +38 -0
- data/node_modules/axe-core/lib/commons/table/traverse.js +78 -0
- data/node_modules/axe-core/lib/commons/text/accessible-text-virtual.js +152 -0
- data/node_modules/axe-core/lib/commons/text/form-control-value.js +204 -0
- data/node_modules/axe-core/lib/commons/text/index.js +8 -0
- data/node_modules/axe-core/lib/commons/text/is-human-interpretable.js +51 -0
- data/node_modules/axe-core/lib/commons/text/is-valid-autocomplete.js +118 -0
- data/node_modules/axe-core/lib/commons/text/label-text.js +58 -0
- data/node_modules/axe-core/lib/commons/text/label-virtual.js +53 -0
- data/node_modules/axe-core/lib/commons/text/native-element-types.js +100 -0
- data/node_modules/axe-core/lib/commons/text/native-text-alternative.js +50 -0
- data/node_modules/axe-core/lib/commons/text/native-text-methods.js +122 -0
- data/node_modules/axe-core/lib/commons/text/sanitize.js +18 -0
- data/node_modules/axe-core/lib/commons/text/subtree-text.js +89 -0
- data/node_modules/axe-core/lib/commons/text/title-text.js +33 -0
- data/node_modules/axe-core/lib/commons/text/unicode.js +117 -0
- data/node_modules/axe-core/lib/commons/text/unsupported.js +5 -0
- data/node_modules/axe-core/lib/commons/text/visible-virtual.js +46 -0
- data/node_modules/axe-core/lib/commons/utils/index.js +10 -0
- data/node_modules/axe-core/lib/core/base/audit.js +684 -0
- data/node_modules/axe-core/lib/core/base/check-result.js +33 -0
- data/node_modules/axe-core/lib/core/base/check.js +123 -0
- data/node_modules/axe-core/lib/core/base/context.js +273 -0
- data/node_modules/axe-core/lib/core/base/rule-result.js +39 -0
- data/node_modules/axe-core/lib/core/base/rule.js +383 -0
- data/node_modules/axe-core/lib/core/constants.js +68 -0
- data/node_modules/axe-core/lib/core/imports/index.js +26 -0
- data/node_modules/axe-core/lib/core/index.js +45 -0
- data/node_modules/axe-core/lib/core/log.js +12 -0
- data/node_modules/axe-core/lib/core/public/cleanup-plugins.js +53 -0
- data/node_modules/axe-core/lib/core/public/configure.js +57 -0
- data/node_modules/axe-core/lib/core/public/get-rules.js +29 -0
- data/node_modules/axe-core/lib/core/public/load.js +66 -0
- data/node_modules/axe-core/lib/core/public/plugins.js +47 -0
- data/node_modules/axe-core/lib/core/public/reporter.js +24 -0
- data/node_modules/axe-core/lib/core/public/reset.js +12 -0
- data/node_modules/axe-core/lib/core/public/run-rules.js +94 -0
- data/node_modules/axe-core/lib/core/public/run.js +148 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/failure-summary.js +35 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/get-environment-data.js +39 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/incomplete-fallback-msg.js +11 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/index.js +3 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/process-aggregate.js +102 -0
- data/node_modules/axe-core/lib/core/reporters/na.js +20 -0
- data/node_modules/axe-core/lib/core/reporters/no-passes.js +18 -0
- data/node_modules/axe-core/lib/core/reporters/raw.js +8 -0
- data/node_modules/axe-core/lib/core/reporters/v1.js +26 -0
- data/node_modules/axe-core/lib/core/reporters/v2.js +22 -0
- data/node_modules/axe-core/lib/core/utils/aggregate.js +19 -0
- data/node_modules/axe-core/lib/core/utils/aggregateChecks.js +85 -0
- data/node_modules/axe-core/lib/core/utils/aggregateNodeResults.js +61 -0
- data/node_modules/axe-core/lib/core/utils/aggregateResult.js +37 -0
- data/node_modules/axe-core/lib/core/utils/are-styles-set.js +24 -0
- data/node_modules/axe-core/lib/core/utils/check-helper.js +38 -0
- data/node_modules/axe-core/lib/core/utils/clone.js +27 -0
- data/node_modules/axe-core/lib/core/utils/collect-results-from-frames.js +127 -0
- data/node_modules/axe-core/lib/core/utils/contains.js +30 -0
- data/node_modules/axe-core/lib/core/utils/css-parser.js +5 -0
- data/node_modules/axe-core/lib/core/utils/dq-element.js +97 -0
- data/node_modules/axe-core/lib/core/utils/element-matches.js +39 -0
- data/node_modules/axe-core/lib/core/utils/escape-selector.js +79 -0
- data/node_modules/axe-core/lib/core/utils/extend-meta-data.js +17 -0
- data/node_modules/axe-core/lib/core/utils/finalize-result.js +11 -0
- data/node_modules/axe-core/lib/core/utils/find-by.js +14 -0
- data/node_modules/axe-core/lib/core/utils/flattened-tree.js +170 -0
- data/node_modules/axe-core/lib/core/utils/get-all-checks.js +12 -0
- data/node_modules/axe-core/lib/core/utils/get-base-lang.js +16 -0
- data/node_modules/axe-core/lib/core/utils/get-check-option.js +40 -0
- data/node_modules/axe-core/lib/core/utils/get-friendly-uri-end.js +144 -0
- data/node_modules/axe-core/lib/core/utils/get-root-node.js +17 -0
- data/node_modules/axe-core/lib/core/utils/get-selector.js +406 -0
- data/node_modules/axe-core/lib/core/utils/get-xpath.js +84 -0
- data/node_modules/axe-core/lib/core/utils/index.js +10 -0
- data/node_modules/axe-core/lib/core/utils/inject-style.js +38 -0
- data/node_modules/axe-core/lib/core/utils/is-hidden.js +40 -0
- data/node_modules/axe-core/lib/core/utils/is-html-element.js +135 -0
- data/node_modules/axe-core/lib/core/utils/is-shadow-root.js +40 -0
- data/node_modules/axe-core/lib/core/utils/is-xhtml.js +14 -0
- data/node_modules/axe-core/lib/core/utils/merge-results.js +116 -0
- data/node_modules/axe-core/lib/core/utils/node-sorter.js +21 -0
- data/node_modules/axe-core/lib/core/utils/performance-timer.js +121 -0
- data/node_modules/axe-core/lib/core/utils/pollyfills.js +299 -0
- data/node_modules/axe-core/lib/core/utils/preload-cssom.js +456 -0
- data/node_modules/axe-core/lib/core/utils/preload.js +109 -0
- data/node_modules/axe-core/lib/core/utils/publish-metadata.js +93 -0
- data/node_modules/axe-core/lib/core/utils/qsa.js +322 -0
- data/node_modules/axe-core/lib/core/utils/queue.js +138 -0
- data/node_modules/axe-core/lib/core/utils/respondable.js +243 -0
- data/node_modules/axe-core/lib/core/utils/rule-should-run.js +83 -0
- data/node_modules/axe-core/lib/core/utils/scroll-state.js +70 -0
- data/node_modules/axe-core/lib/core/utils/select.js +146 -0
- data/node_modules/axe-core/lib/core/utils/to-array.js +21 -0
- data/node_modules/axe-core/lib/core/utils/token-list.js +15 -0
- data/node_modules/axe-core/lib/core/utils/uuid.js +242 -0
- data/node_modules/axe-core/lib/core/utils/valid-input-type.js +35 -0
- data/node_modules/axe-core/lib/core/utils/valid-langs.js +8152 -0
- data/node_modules/axe-core/lib/intro.stub +15 -0
- data/node_modules/axe-core/lib/misc/any-failure-summary.json +6 -0
- data/node_modules/axe-core/lib/misc/incomplete-fallback.json +3 -0
- data/node_modules/axe-core/lib/misc/none-failure-summary.json +6 -0
- data/node_modules/axe-core/lib/outro.stub +2 -0
- data/node_modules/axe-core/lib/rules/accesskeys.json +13 -0
- data/node_modules/axe-core/lib/rules/area-alt.json +19 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-attr-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-role-matches.js +7 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-role.json +14 -0
- data/node_modules/axe-core/lib/rules/aria-dpub-role-fallback-matches.js +10 -0
- data/node_modules/axe-core/lib/rules/aria-dpub-role-fallback.json +13 -0
- data/node_modules/axe-core/lib/rules/aria-has-attr-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/aria-hidden-body.json +13 -0
- data/node_modules/axe-core/lib/rules/aria-hidden-focus-matches.js +18 -0
- data/node_modules/axe-core/lib/rules/aria-hidden-focus.json +14 -0
- data/node_modules/axe-core/lib/rules/aria-required-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-required-children.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-required-parent.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-roles.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-valid-attr-value.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-valid-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/audio-caption.json +20 -0
- data/node_modules/axe-core/lib/rules/autocomplete-matches.js +45 -0
- data/node_modules/axe-core/lib/rules/autocomplete-valid.json +12 -0
- data/node_modules/axe-core/lib/rules/blink.json +19 -0
- data/node_modules/axe-core/lib/rules/button-name.json +27 -0
- data/node_modules/axe-core/lib/rules/bypass-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/bypass.json +20 -0
- data/node_modules/axe-core/lib/rules/checkboxgroup.json +12 -0
- data/node_modules/axe-core/lib/rules/color-contrast-matches.js +120 -0
- data/node_modules/axe-core/lib/rules/color-contrast.json +16 -0
- data/node_modules/axe-core/lib/rules/css-orientation-lock.json +13 -0
- data/node_modules/axe-core/lib/rules/data-table-large-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/data-table-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/definition-list.json +13 -0
- data/node_modules/axe-core/lib/rules/dlitem.json +13 -0
- data/node_modules/axe-core/lib/rules/document-title.json +13 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-active-matches.js +8 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-active.json +14 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-aria-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-aria.json +14 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-misc-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/duplicate-id.json +14 -0
- data/node_modules/axe-core/lib/rules/empty-heading.json +13 -0
- data/node_modules/axe-core/lib/rules/focus-order-semantics.json +13 -0
- data/node_modules/axe-core/lib/rules/form-field-multiple-labels.json +13 -0
- data/node_modules/axe-core/lib/rules/frame-tested.json +12 -0
- data/node_modules/axe-core/lib/rules/frame-title-has-text.js +2 -0
- data/node_modules/axe-core/lib/rules/frame-title-unique.json +13 -0
- data/node_modules/axe-core/lib/rules/frame-title.json +25 -0
- data/node_modules/axe-core/lib/rules/heading-matches.js +15 -0
- data/node_modules/axe-core/lib/rules/heading-order.json +13 -0
- data/node_modules/axe-core/lib/rules/hidden-content.json +13 -0
- data/node_modules/axe-core/lib/rules/html-has-lang.json +12 -0
- data/node_modules/axe-core/lib/rules/html-lang-valid.json +12 -0
- data/node_modules/axe-core/lib/rules/html-xml-lang-mismatch.json +13 -0
- data/node_modules/axe-core/lib/rules/image-alt.json +25 -0
- data/node_modules/axe-core/lib/rules/img-redundant-alt.json +12 -0
- data/node_modules/axe-core/lib/rules/input-image-alt.json +18 -0
- data/node_modules/axe-core/lib/rules/inserted-into-focus-order-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/label-content-name-mismatch-matches.js +42 -0
- data/node_modules/axe-core/lib/rules/label-content-name-mismatch.json +12 -0
- data/node_modules/axe-core/lib/rules/label-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/label-title-only.json +13 -0
- data/node_modules/axe-core/lib/rules/label.json +26 -0
- data/node_modules/axe-core/lib/rules/landmark-banner-is-top-level.json +13 -0
- data/node_modules/axe-core/lib/rules/landmark-complementary-is-top-level.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-contentinfo-is-top-level.json +13 -0
- data/node_modules/axe-core/lib/rules/landmark-has-body-context.js +8 -0
- data/node_modules/axe-core/lib/rules/landmark-main-is-top-level.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-banner.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-contentinfo.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-one-main.json +12 -0
- data/node_modules/axe-core/lib/rules/layout-table-matches.js +8 -0
- data/node_modules/axe-core/lib/rules/layout-table.json +13 -0
- data/node_modules/axe-core/lib/rules/link-in-text-block-matches.js +14 -0
- data/node_modules/axe-core/lib/rules/link-in-text-block.json +14 -0
- data/node_modules/axe-core/lib/rules/link-name.json +26 -0
- data/node_modules/axe-core/lib/rules/list.json +13 -0
- data/node_modules/axe-core/lib/rules/listitem.json +13 -0
- data/node_modules/axe-core/lib/rules/marquee.json +13 -0
- data/node_modules/axe-core/lib/rules/meta-refresh.json +13 -0
- data/node_modules/axe-core/lib/rules/meta-viewport-large.json +13 -0
- data/node_modules/axe-core/lib/rules/meta-viewport.json +13 -0
- data/node_modules/axe-core/lib/rules/no-role-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/not-html-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/object-alt.json +25 -0
- data/node_modules/axe-core/lib/rules/p-as-heading-matches.js +17 -0
- data/node_modules/axe-core/lib/rules/p-as-heading.json +13 -0
- data/node_modules/axe-core/lib/rules/page-has-heading-one.json +12 -0
- data/node_modules/axe-core/lib/rules/radiogroup.json +12 -0
- data/node_modules/axe-core/lib/rules/region.json +13 -0
- data/node_modules/axe-core/lib/rules/role-not-button-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/scope-attr-valid.json +12 -0
- data/node_modules/axe-core/lib/rules/server-side-image-map.json +18 -0
- data/node_modules/axe-core/lib/rules/skip-link-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/skip-link.json +13 -0
- data/node_modules/axe-core/lib/rules/tabindex.json +12 -0
- data/node_modules/axe-core/lib/rules/table-duplicate-name.json +12 -0
- data/node_modules/axe-core/lib/rules/table-fake-caption.json +20 -0
- data/node_modules/axe-core/lib/rules/td-has-header.json +20 -0
- data/node_modules/axe-core/lib/rules/td-headers-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/th-has-data-cells.json +13 -0
- data/node_modules/axe-core/lib/rules/valid-lang.json +13 -0
- data/node_modules/axe-core/lib/rules/video-caption.json +19 -0
- data/node_modules/axe-core/lib/rules/video-description.json +19 -0
- data/node_modules/axe-core/lib/rules/window-is-top.js +3 -0
- data/node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js +12 -0
- data/node_modules/axe-core/locales/de.json +627 -0
- data/node_modules/axe-core/locales/fr.json +667 -0
- data/node_modules/axe-core/locales/ja.json +728 -0
- data/node_modules/axe-core/locales/nl.json +36 -0
- data/node_modules/axe-core/package.json +215 -0
- data/node_modules/axe-core/sri-history.json +138 -0
- data/node_modules/axe-core/typings/axe-core/axe-core-tests.ts +180 -0
- metadata +511 -1
@@ -0,0 +1,22 @@
|
|
1
|
+
/* global table, axe */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Determine if a `HTMLTableCellElement` is a header
|
5
|
+
* @method isHeader
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} cell The table cell to test
|
9
|
+
* @return {Boolean}
|
10
|
+
*/
|
11
|
+
table.isHeader = function(cell) {
|
12
|
+
if (table.isColumnHeader(cell) || table.isRowHeader(cell)) {
|
13
|
+
return true;
|
14
|
+
}
|
15
|
+
|
16
|
+
if (cell.getAttribute('id')) {
|
17
|
+
const id = axe.utils.escapeSelector(cell.getAttribute('id'));
|
18
|
+
return !!document.querySelector(`[headers~="${id}"]`);
|
19
|
+
}
|
20
|
+
|
21
|
+
return false;
|
22
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/* global table */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Determine if a `HTMLTableCellElement` is a row header
|
5
|
+
* @method isRowHeader
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} cell The table cell to test
|
9
|
+
* @return {Boolean}
|
10
|
+
*/
|
11
|
+
table.isRowHeader = function(cell) {
|
12
|
+
return ['row', 'auto'].includes(table.getScope(cell));
|
13
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*global table */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Converts a table to an Array of arrays, normalized for row and column spans
|
5
|
+
* @method toGrid
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableElement} node The table to convert
|
9
|
+
* @return {Array<HTMLTableCellElement>} Array of HTMLTableCellElements
|
10
|
+
*/
|
11
|
+
table.toGrid = function(node) {
|
12
|
+
var table = [];
|
13
|
+
var rows = node.rows;
|
14
|
+
for (var i = 0, rowLength = rows.length; i < rowLength; i++) {
|
15
|
+
var cells = rows[i].cells;
|
16
|
+
table[i] = table[i] || [];
|
17
|
+
|
18
|
+
var columnIndex = 0;
|
19
|
+
|
20
|
+
for (var j = 0, cellLength = cells.length; j < cellLength; j++) {
|
21
|
+
for (var colSpan = 0; colSpan < cells[j].colSpan; colSpan++) {
|
22
|
+
for (var rowSpan = 0; rowSpan < cells[j].rowSpan; rowSpan++) {
|
23
|
+
table[i + rowSpan] = table[i + rowSpan] || [];
|
24
|
+
while (table[i + rowSpan][columnIndex]) {
|
25
|
+
columnIndex++;
|
26
|
+
}
|
27
|
+
table[i + rowSpan][columnIndex] = cells[j];
|
28
|
+
}
|
29
|
+
columnIndex++;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
return table;
|
35
|
+
};
|
36
|
+
|
37
|
+
// This was the old name
|
38
|
+
table.toArray = table.toGrid;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/* global table */
|
2
|
+
(function(table) {
|
3
|
+
var traverseTable = function(dir, position, tableGrid, callback) {
|
4
|
+
var result;
|
5
|
+
var cell = tableGrid[position.y]
|
6
|
+
? tableGrid[position.y][position.x]
|
7
|
+
: undefined;
|
8
|
+
if (!cell) {
|
9
|
+
return [];
|
10
|
+
}
|
11
|
+
if (typeof callback === 'function') {
|
12
|
+
result = callback(cell, position, tableGrid);
|
13
|
+
if (result === true) {
|
14
|
+
// abort
|
15
|
+
return [cell];
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
result = traverseTable(
|
20
|
+
dir,
|
21
|
+
{
|
22
|
+
x: position.x + dir.x,
|
23
|
+
y: position.y + dir.y
|
24
|
+
},
|
25
|
+
tableGrid,
|
26
|
+
callback
|
27
|
+
);
|
28
|
+
result.unshift(cell);
|
29
|
+
return result;
|
30
|
+
};
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Traverses a table in a given direction, passing the cell to the callback
|
34
|
+
* @method traverse
|
35
|
+
* @memberof axe.commons.table
|
36
|
+
* @instance
|
37
|
+
* @param {Object|String} dir Direction that will be added recursively {x: 1, y: 0}, 'left';
|
38
|
+
* @param {Object} startPos x/y coordinate: {x: 0, y: 0};
|
39
|
+
* @param {Array} [tablegrid] A matrix of the table obtained using axe.commons.table.toArray (OPTIONAL)
|
40
|
+
* @param {Function} callback Function to which each cell will be passed
|
41
|
+
* @return {NodeElement} If the callback returns true, the traversal will end and the cell will be returned
|
42
|
+
*/
|
43
|
+
table.traverse = function(dir, startPos, tableGrid, callback) {
|
44
|
+
/* eslint indent: 0 */
|
45
|
+
if (Array.isArray(startPos)) {
|
46
|
+
callback = tableGrid;
|
47
|
+
tableGrid = startPos;
|
48
|
+
startPos = { x: 0, y: 0 };
|
49
|
+
}
|
50
|
+
|
51
|
+
if (typeof dir === 'string') {
|
52
|
+
switch (dir) {
|
53
|
+
case 'left':
|
54
|
+
dir = { x: -1, y: 0 };
|
55
|
+
break;
|
56
|
+
case 'up':
|
57
|
+
dir = { x: 0, y: -1 };
|
58
|
+
break;
|
59
|
+
case 'right':
|
60
|
+
dir = { x: 1, y: 0 };
|
61
|
+
break;
|
62
|
+
case 'down':
|
63
|
+
dir = { x: 0, y: 1 };
|
64
|
+
break;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
return traverseTable(
|
69
|
+
dir,
|
70
|
+
{
|
71
|
+
x: startPos.x + dir.x,
|
72
|
+
y: startPos.y + dir.y
|
73
|
+
},
|
74
|
+
tableGrid,
|
75
|
+
callback
|
76
|
+
);
|
77
|
+
};
|
78
|
+
})(table);
|
@@ -0,0 +1,152 @@
|
|
1
|
+
/* global text, dom, aria, axe */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Finds virtual node and calls accessibleTextVirtual()
|
5
|
+
* IMPORTANT: This method requires the composed tree at axe._tree
|
6
|
+
*
|
7
|
+
* @param {HTMLElement} element The HTMLElement
|
8
|
+
* @param {Object} context
|
9
|
+
* @property {Bool} inControlContext
|
10
|
+
* @property {Bool} inLabelledByContext
|
11
|
+
* @return {string}
|
12
|
+
*/
|
13
|
+
text.accessibleText = function accessibleText(element, context) {
|
14
|
+
let virtualNode = axe.utils.getNodeFromTree(axe._tree[0], element); // throws an exception on purpose if axe._tree not correct
|
15
|
+
return text.accessibleTextVirtual(virtualNode, context);
|
16
|
+
};
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Finds virtual node and calls accessibleTextVirtual()
|
20
|
+
* IMPORTANT: This method requires the composed tree at axe._tree
|
21
|
+
*
|
22
|
+
* @param {HTMLElement} element The HTMLElement
|
23
|
+
* @param {Object} context
|
24
|
+
* @property {Bool} inControlContext
|
25
|
+
* @property {Bool} inLabelledByContext
|
26
|
+
* @return {string}
|
27
|
+
*/
|
28
|
+
text.accessibleTextVirtual = function accessibleTextVirtual(
|
29
|
+
virtualNode,
|
30
|
+
context = {}
|
31
|
+
) {
|
32
|
+
const { actualNode } = virtualNode;
|
33
|
+
context = prepareContext(virtualNode, context);
|
34
|
+
|
35
|
+
// Step 2A, check visibility
|
36
|
+
if (shouldIgnoreHidden(virtualNode, context)) {
|
37
|
+
return '';
|
38
|
+
}
|
39
|
+
|
40
|
+
const computationSteps = [
|
41
|
+
aria.arialabelledbyText, // Step 2B.1
|
42
|
+
aria.arialabelText, // Step 2C
|
43
|
+
text.nativeTextAlternative, // Step 2D
|
44
|
+
text.formControlValue, // Step 2E
|
45
|
+
text.subtreeText, // Step 2F + Step 2H
|
46
|
+
textNodeContent, // Step 2G (order with 2H does not matter)
|
47
|
+
text.titleText // Step 2I
|
48
|
+
];
|
49
|
+
|
50
|
+
// Find the first step that returns a non-empty string
|
51
|
+
let accName = computationSteps.reduce((accName, step) => {
|
52
|
+
if (accName !== '') {
|
53
|
+
// yes, whitespace only a11y names halt the algorithm
|
54
|
+
return accName;
|
55
|
+
}
|
56
|
+
return step(virtualNode, context);
|
57
|
+
}, '');
|
58
|
+
|
59
|
+
if (context.startNode === virtualNode) {
|
60
|
+
accName = text.sanitize(accName);
|
61
|
+
}
|
62
|
+
|
63
|
+
if (context.debug) {
|
64
|
+
axe.log(accName || '{empty-value}', actualNode, context);
|
65
|
+
}
|
66
|
+
return accName;
|
67
|
+
};
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Return the textContent of a node
|
71
|
+
* @param {VirtualNode} element
|
72
|
+
* @return {String} textContent value
|
73
|
+
*/
|
74
|
+
function textNodeContent({ actualNode }) {
|
75
|
+
if (actualNode.nodeType !== 3) {
|
76
|
+
return '';
|
77
|
+
}
|
78
|
+
return actualNode.textContent;
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Check if the
|
83
|
+
* @param {VirtualNode} element
|
84
|
+
* @param {Object} context
|
85
|
+
* @property {VirtualNode[]} processed
|
86
|
+
* @return {Boolean}
|
87
|
+
*/
|
88
|
+
function shouldIgnoreHidden({ actualNode }, context) {
|
89
|
+
if (
|
90
|
+
// If the parent isn't ignored, the text node should not be either
|
91
|
+
actualNode.nodeType !== 1 ||
|
92
|
+
// If the target of aria-labelledby is hidden, ignore all descendents
|
93
|
+
context.includeHidden
|
94
|
+
) {
|
95
|
+
return false;
|
96
|
+
}
|
97
|
+
|
98
|
+
return !dom.isVisible(actualNode, true);
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Apply defaults to the context
|
103
|
+
* @param {VirtualNode} element
|
104
|
+
* @param {Object} context
|
105
|
+
* @return {Object} context object with defaults applied
|
106
|
+
*/
|
107
|
+
function prepareContext(virtualNode, context) {
|
108
|
+
const { actualNode } = virtualNode;
|
109
|
+
if (!context.startNode) {
|
110
|
+
context = { startNode: virtualNode, ...context };
|
111
|
+
}
|
112
|
+
/**
|
113
|
+
* When `aria-labelledby` directly references a `hidden` element
|
114
|
+
* the element needs to be included in the accessible name.
|
115
|
+
*
|
116
|
+
* When a descendent of the `aria-labelledby` reference is `hidden`
|
117
|
+
* the element should not be included in the accessible name.
|
118
|
+
*
|
119
|
+
* This is done by setting `includeHidden` for the `aria-labelledby` reference.
|
120
|
+
*/
|
121
|
+
if (
|
122
|
+
actualNode.nodeType === 1 &&
|
123
|
+
context.inLabelledByContext &&
|
124
|
+
context.includeHidden === undefined
|
125
|
+
) {
|
126
|
+
context = {
|
127
|
+
includeHidden: !dom.isVisible(actualNode, true),
|
128
|
+
...context
|
129
|
+
};
|
130
|
+
}
|
131
|
+
return context;
|
132
|
+
}
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Check if the node is processed with this context before
|
136
|
+
* @param {VirtualNode} element
|
137
|
+
* @param {Object} context
|
138
|
+
* @property {VirtualNode[]} processed
|
139
|
+
* @return {Boolean}
|
140
|
+
*/
|
141
|
+
text.accessibleTextVirtual.alreadyProcessed = function alreadyProcessed(
|
142
|
+
virtualnode,
|
143
|
+
context
|
144
|
+
) {
|
145
|
+
context.processed = context.processed || [];
|
146
|
+
if (context.processed.includes(virtualnode)) {
|
147
|
+
return true;
|
148
|
+
}
|
149
|
+
|
150
|
+
context.processed.push(virtualnode);
|
151
|
+
return false;
|
152
|
+
};
|
@@ -0,0 +1,204 @@
|
|
1
|
+
/* global text, aria, dom */
|
2
|
+
const selectRoles = ['combobox', 'listbox'];
|
3
|
+
const rangeRoles = ['progressbar', 'scrollbar', 'slider', 'spinbutton'];
|
4
|
+
const controlValueRoles = ['textbox', ...selectRoles, ...rangeRoles];
|
5
|
+
|
6
|
+
text.formControlValueMethods = {
|
7
|
+
nativeTextboxValue,
|
8
|
+
nativeSelectValue,
|
9
|
+
ariaTextboxValue,
|
10
|
+
ariaListboxValue,
|
11
|
+
ariaComboboxValue,
|
12
|
+
ariaRangeValue
|
13
|
+
};
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Calculate value of a form control
|
17
|
+
*
|
18
|
+
* @param {VirtualNode} element The VirtualNode instance whose value we want
|
19
|
+
* @param {Object} context
|
20
|
+
* @property {Element} startNode First node in accessible name computation
|
21
|
+
* @property {String[]} unsupported List of roles where value computation is unsupported
|
22
|
+
* @property {Bool} debug Enable logging for formControlValue
|
23
|
+
* @return {string} The calculated value
|
24
|
+
*/
|
25
|
+
text.formControlValue = function formControlValue(virtualNode, context = {}) {
|
26
|
+
const { actualNode } = virtualNode;
|
27
|
+
const unsupported = text.unsupported.accessibleNameFromFieldValue || [];
|
28
|
+
const role = aria.getRole(actualNode);
|
29
|
+
|
30
|
+
if (
|
31
|
+
// For the targeted node, the accessible name is never the value:
|
32
|
+
context.startNode === virtualNode ||
|
33
|
+
// Only elements with a certain role can return their value
|
34
|
+
!controlValueRoles.includes(role) ||
|
35
|
+
// Skip unsupported roles
|
36
|
+
unsupported.includes(role)
|
37
|
+
) {
|
38
|
+
return '';
|
39
|
+
}
|
40
|
+
|
41
|
+
// Object.values:
|
42
|
+
const valueMethods = Object.keys(text.formControlValueMethods).map(
|
43
|
+
name => text.formControlValueMethods[name]
|
44
|
+
);
|
45
|
+
|
46
|
+
// Return the value of the first step that returns with text
|
47
|
+
let valueString = valueMethods.reduce((accName, step) => {
|
48
|
+
return accName || step(virtualNode, context);
|
49
|
+
}, '');
|
50
|
+
|
51
|
+
if (context.debug) {
|
52
|
+
axe.log(valueString || '{empty-value}', actualNode, context);
|
53
|
+
}
|
54
|
+
return valueString;
|
55
|
+
};
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Calculate value of a native textbox element (input and textarea)
|
59
|
+
*
|
60
|
+
* @param {VirtualNode|Element} element The element whose value we want
|
61
|
+
* @return {string} The calculated value
|
62
|
+
*/
|
63
|
+
function nativeTextboxValue(node) {
|
64
|
+
node = node.actualNode || node;
|
65
|
+
const nonTextInputTypes = [
|
66
|
+
'button',
|
67
|
+
'checkbox',
|
68
|
+
'file',
|
69
|
+
'hidden',
|
70
|
+
'image',
|
71
|
+
'password',
|
72
|
+
'radio',
|
73
|
+
'reset',
|
74
|
+
'submit',
|
75
|
+
'color'
|
76
|
+
];
|
77
|
+
const nodeName = node.nodeName.toUpperCase();
|
78
|
+
|
79
|
+
if (
|
80
|
+
nodeName === 'TEXTAREA' ||
|
81
|
+
(nodeName === 'INPUT' && !nonTextInputTypes.includes(node.type))
|
82
|
+
) {
|
83
|
+
return node.value || '';
|
84
|
+
}
|
85
|
+
return '';
|
86
|
+
}
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Calculate value of a select element
|
90
|
+
*
|
91
|
+
* @param {VirtualNode} element The VirtualNode instance whose value we want
|
92
|
+
* @return {string} The calculated value
|
93
|
+
*/
|
94
|
+
function nativeSelectValue(node) {
|
95
|
+
node = node.actualNode || node;
|
96
|
+
if (node.nodeName.toUpperCase() !== 'SELECT') {
|
97
|
+
return '';
|
98
|
+
}
|
99
|
+
return (
|
100
|
+
Array.from(node.options)
|
101
|
+
.filter(option => option.selected)
|
102
|
+
.map(option => option.text)
|
103
|
+
.join(' ') || ''
|
104
|
+
);
|
105
|
+
}
|
106
|
+
|
107
|
+
/**
|
108
|
+
* Calculate value of a an element with role=textbox
|
109
|
+
*
|
110
|
+
* @param {VirtualNode} element The VirtualNode instance whose value we want
|
111
|
+
* @return {string} The calculated value
|
112
|
+
*/
|
113
|
+
function ariaTextboxValue(virtualNode) {
|
114
|
+
const { actualNode } = virtualNode;
|
115
|
+
const role = aria.getRole(actualNode);
|
116
|
+
if (role !== 'textbox') {
|
117
|
+
return '';
|
118
|
+
}
|
119
|
+
if (!dom.isHiddenWithCSS(actualNode)) {
|
120
|
+
return text.visibleVirtual(virtualNode, true);
|
121
|
+
} else {
|
122
|
+
return actualNode.textContent;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Calculate value of an element with role=combobox or role=listbox
|
128
|
+
*
|
129
|
+
* @param {VirtualNode} element The VirtualNode instance whose value we want
|
130
|
+
* @param {Object} context The VirtualNode instance whose value we want
|
131
|
+
* @property {Element} startNode First node in accessible name computation
|
132
|
+
* @property {String[]} unsupported List of roles where value computation is unsupported
|
133
|
+
* @property {Bool} debug Enable logging for formControlValue
|
134
|
+
* @return {string} The calculated value
|
135
|
+
*/
|
136
|
+
function ariaListboxValue(virtualNode, context) {
|
137
|
+
const { actualNode } = virtualNode;
|
138
|
+
const role = aria.getRole(actualNode);
|
139
|
+
if (role !== 'listbox') {
|
140
|
+
return '';
|
141
|
+
}
|
142
|
+
|
143
|
+
const selected = aria
|
144
|
+
.getOwnedVirtual(virtualNode)
|
145
|
+
.filter(
|
146
|
+
owned =>
|
147
|
+
aria.getRole(owned) === 'option' &&
|
148
|
+
owned.actualNode.getAttribute('aria-selected') === 'true'
|
149
|
+
);
|
150
|
+
|
151
|
+
if (selected.length === 0) {
|
152
|
+
return '';
|
153
|
+
}
|
154
|
+
// Note: Even with aria-multiselectable, only the first value will be used
|
155
|
+
// in the accessible name. This isn't spec'ed out, but seems to be how all
|
156
|
+
// browser behave.
|
157
|
+
return axe.commons.text.accessibleTextVirtual(selected[0], context);
|
158
|
+
}
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Calculate value of an element with role=combobox or role=listbox
|
162
|
+
*
|
163
|
+
* @param {VirtualNode} element The VirtualNode instance whose value we want
|
164
|
+
* @param {Object} context The VirtualNode instance whose value we want
|
165
|
+
* @property {Element} startNode First node in accessible name computation
|
166
|
+
* @property {String[]} unsupported List of roles where value computation is unsupported
|
167
|
+
* @property {Bool} debug Enable logging for formControlValue
|
168
|
+
* @return {string} The calculated value
|
169
|
+
*/
|
170
|
+
function ariaComboboxValue(virtualNode, context) {
|
171
|
+
const { actualNode } = virtualNode;
|
172
|
+
const role = aria.getRole(actualNode, { noImplicit: true });
|
173
|
+
let listbox;
|
174
|
+
|
175
|
+
// For combobox, find the first owned listbox:
|
176
|
+
if (!role === 'combobox') {
|
177
|
+
return '';
|
178
|
+
}
|
179
|
+
listbox = aria
|
180
|
+
.getOwnedVirtual(virtualNode)
|
181
|
+
.filter(elm => aria.getRole(elm) === 'listbox')[0];
|
182
|
+
|
183
|
+
return listbox
|
184
|
+
? text.formControlValueMethods.ariaListboxValue(listbox, context)
|
185
|
+
: '';
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Calculate value of an element with range-type role
|
190
|
+
*
|
191
|
+
* @param {VirtualNode|Node} element The VirtualNode instance whose value we want
|
192
|
+
* @return {string} The calculated value
|
193
|
+
*/
|
194
|
+
function ariaRangeValue(node) {
|
195
|
+
node = node.actualNode || node;
|
196
|
+
const role = aria.getRole(node);
|
197
|
+
if (!rangeRoles.includes(role) || !node.hasAttribute('aria-valuenow')) {
|
198
|
+
return '';
|
199
|
+
}
|
200
|
+
// Validate the number, if not, return 0.
|
201
|
+
// Chrome 70 typecasts this, Firefox 62 does not
|
202
|
+
const valueNow = +node.getAttribute('aria-valuenow');
|
203
|
+
return !isNaN(valueNow) ? String(valueNow) : '0';
|
204
|
+
}
|