govuk_publishing_components 16.6.0 → 16.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/component_guide/accessibility-test.js +6 -12
- data/app/assets/javascripts/component_guide/vendor/bind-polyfill.js +8 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +16 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -27
- data/app/views/govuk_publishing_components/components/_fieldset.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_input.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/docs/input.yml +7 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/package.json +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
- data/node_modules/govuk-frontend/all.js +19 -14
- data/node_modules/govuk-frontend/components/error-summary/error-summary.js +1 -3
- data/node_modules/govuk-frontend/components/summary-list/macro-options.json +12 -6
- data/node_modules/govuk-frontend/components/summary-list/template.njk +1 -1
- data/node_modules/govuk-frontend/components/tabs/_tabs.scss +1 -1
- data/node_modules/govuk-frontend/helpers/_typography.scss +3 -2
- data/node_modules/govuk-frontend/objects/_main-wrapper.scss +10 -2
- data/node_modules/govuk-frontend/package.json +10 -10
- data/node_modules/govuk-frontend/settings/_typography-font.scss +12 -0
- metadata +513 -3
- data/app/assets/javascripts/component_guide/vendor/axe.min.js +0 -41
@@ -0,0 +1,51 @@
|
|
1
|
+
/* global text */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Determines if a given text is human friendly and interpretable
|
5
|
+
*
|
6
|
+
* @method isHumanInterpretable
|
7
|
+
* @memberof axe.commons.text
|
8
|
+
* @instance
|
9
|
+
* @param {String} str text to be validated
|
10
|
+
* @returns {Number} Between 0 and 1, (0 -> not interpretable, 1 -> interpretable)
|
11
|
+
*/
|
12
|
+
text.isHumanInterpretable = function(str) {
|
13
|
+
/**
|
14
|
+
* Steps:
|
15
|
+
* 1) Check for single character edge cases
|
16
|
+
* a) handle if character is alphanumeric & within the given icon mapping
|
17
|
+
* eg: x (close), i (info)
|
18
|
+
*
|
19
|
+
* 3) handle unicode from astral (non bilingual multi plane) unicode, emoji & punctuations
|
20
|
+
* eg: Windings font
|
21
|
+
* eg: '💪'
|
22
|
+
* eg: I saw a shooting 💫
|
23
|
+
* eg: ? (help), > (next arrow), < (back arrow), need help ?
|
24
|
+
*/
|
25
|
+
|
26
|
+
if (!str.length) {
|
27
|
+
return 0;
|
28
|
+
}
|
29
|
+
|
30
|
+
// Step 1
|
31
|
+
const alphaNumericIconMap = [
|
32
|
+
'x', // close
|
33
|
+
'i' // info
|
34
|
+
];
|
35
|
+
// Step 1a
|
36
|
+
if (alphaNumericIconMap.includes(str)) {
|
37
|
+
return 0;
|
38
|
+
}
|
39
|
+
|
40
|
+
// Step 2
|
41
|
+
const noUnicodeStr = text.removeUnicode(str, {
|
42
|
+
emoji: true,
|
43
|
+
nonBmp: true,
|
44
|
+
punctuations: true
|
45
|
+
});
|
46
|
+
if (!text.sanitize(noUnicodeStr)) {
|
47
|
+
return 0;
|
48
|
+
}
|
49
|
+
|
50
|
+
return 1;
|
51
|
+
};
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/* global text */
|
2
|
+
const autocomplete = {
|
3
|
+
stateTerms: ['on', 'off'],
|
4
|
+
standaloneTerms: [
|
5
|
+
'name',
|
6
|
+
'honorific-prefix',
|
7
|
+
'given-name',
|
8
|
+
'additional-name',
|
9
|
+
'family-name',
|
10
|
+
'honorific-suffix',
|
11
|
+
'nickname',
|
12
|
+
'username',
|
13
|
+
'new-password',
|
14
|
+
'current-password',
|
15
|
+
'organization-title',
|
16
|
+
'organization',
|
17
|
+
'street-address',
|
18
|
+
'address-line1',
|
19
|
+
'address-line2',
|
20
|
+
'address-line3',
|
21
|
+
'address-level4',
|
22
|
+
'address-level3',
|
23
|
+
'address-level2',
|
24
|
+
'address-level1',
|
25
|
+
'country',
|
26
|
+
'country-name',
|
27
|
+
'postal-code',
|
28
|
+
'cc-name',
|
29
|
+
'cc-given-name',
|
30
|
+
'cc-additional-name',
|
31
|
+
'cc-family-name',
|
32
|
+
'cc-number',
|
33
|
+
'cc-exp',
|
34
|
+
'cc-exp-month',
|
35
|
+
'cc-exp-year',
|
36
|
+
'cc-csc',
|
37
|
+
'cc-type',
|
38
|
+
'transaction-currency',
|
39
|
+
'transaction-amount',
|
40
|
+
'language',
|
41
|
+
'bday',
|
42
|
+
'bday-day',
|
43
|
+
'bday-month',
|
44
|
+
'bday-year',
|
45
|
+
'sex',
|
46
|
+
'url',
|
47
|
+
'photo'
|
48
|
+
],
|
49
|
+
qualifiers: ['home', 'work', 'mobile', 'fax', 'pager'],
|
50
|
+
qualifiedTerms: [
|
51
|
+
'tel',
|
52
|
+
'tel-country-code',
|
53
|
+
'tel-national',
|
54
|
+
'tel-area-code',
|
55
|
+
'tel-local',
|
56
|
+
'tel-local-prefix',
|
57
|
+
'tel-local-suffix',
|
58
|
+
'tel-extension',
|
59
|
+
'email',
|
60
|
+
'impp'
|
61
|
+
],
|
62
|
+
locations: ['billing', 'shipping']
|
63
|
+
};
|
64
|
+
text.autocomplete = autocomplete;
|
65
|
+
|
66
|
+
text.isValidAutocomplete = function isValidAutocomplete(
|
67
|
+
autocomplete,
|
68
|
+
{
|
69
|
+
looseTyped = false,
|
70
|
+
stateTerms = [],
|
71
|
+
locations = [],
|
72
|
+
qualifiers = [],
|
73
|
+
standaloneTerms = [],
|
74
|
+
qualifiedTerms = []
|
75
|
+
} = {}
|
76
|
+
) {
|
77
|
+
/*eslint max-statements: ["error", 23] */
|
78
|
+
autocomplete = autocomplete.toLowerCase().trim();
|
79
|
+
stateTerms = stateTerms.concat(text.autocomplete.stateTerms);
|
80
|
+
if (stateTerms.includes(autocomplete) || autocomplete === '') {
|
81
|
+
return true;
|
82
|
+
}
|
83
|
+
|
84
|
+
qualifiers = qualifiers.concat(text.autocomplete.qualifiers);
|
85
|
+
locations = locations.concat(text.autocomplete.locations);
|
86
|
+
standaloneTerms = standaloneTerms.concat(text.autocomplete.standaloneTerms);
|
87
|
+
qualifiedTerms = qualifiedTerms.concat(text.autocomplete.qualifiedTerms);
|
88
|
+
|
89
|
+
const autocompleteTerms = autocomplete.split(/\s+/g);
|
90
|
+
if (!looseTyped) {
|
91
|
+
if (
|
92
|
+
autocompleteTerms[0].length > 8 &&
|
93
|
+
autocompleteTerms[0].substr(0, 8) === 'section-'
|
94
|
+
) {
|
95
|
+
autocompleteTerms.shift();
|
96
|
+
}
|
97
|
+
|
98
|
+
if (locations.includes(autocompleteTerms[0])) {
|
99
|
+
autocompleteTerms.shift();
|
100
|
+
}
|
101
|
+
|
102
|
+
if (qualifiers.includes(autocompleteTerms[0])) {
|
103
|
+
autocompleteTerms.shift();
|
104
|
+
// only quantifiers allowed at this point
|
105
|
+
standaloneTerms = [];
|
106
|
+
}
|
107
|
+
|
108
|
+
if (autocompleteTerms.length !== 1) {
|
109
|
+
return false;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
const purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
|
114
|
+
return (
|
115
|
+
standaloneTerms.includes(purposeTerm) ||
|
116
|
+
qualifiedTerms.includes(purposeTerm)
|
117
|
+
);
|
118
|
+
};
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/* global dom, text */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Return accessible text for an implicit and/or explicit HTML label element
|
5
|
+
* @param {VirtualNode} element
|
6
|
+
* @param {Object} context
|
7
|
+
* @property {Bool} inControlContext
|
8
|
+
* @property {Bool} inLabelledByContext
|
9
|
+
* @return {String} Label text
|
10
|
+
*/
|
11
|
+
text.labelText = function labelText(virtualNode, context = {}) {
|
12
|
+
const { alreadyProcessed } = text.accessibleTextVirtual
|
13
|
+
if (
|
14
|
+
context.inControlContext ||
|
15
|
+
context.inLabelledByContext ||
|
16
|
+
alreadyProcessed(virtualNode, context)
|
17
|
+
) {
|
18
|
+
return '';
|
19
|
+
}
|
20
|
+
if (!context.startNode) {
|
21
|
+
context.startNode = virtualNode;
|
22
|
+
}
|
23
|
+
|
24
|
+
const labelContext = { inControlContext: true, ...context };
|
25
|
+
const explicitLabels = getExplicitLabels(virtualNode);
|
26
|
+
const implicitLabel = dom.findUpVirtual(virtualNode, 'label');
|
27
|
+
|
28
|
+
let labels;
|
29
|
+
if (implicitLabel) {
|
30
|
+
labels = [...explicitLabels, implicitLabel];
|
31
|
+
labels.sort(axe.utils.nodeSorter);
|
32
|
+
} else {
|
33
|
+
labels = explicitLabels;
|
34
|
+
}
|
35
|
+
|
36
|
+
return labels
|
37
|
+
.map(label => text.accessibleText(label, labelContext))
|
38
|
+
.filter(text => text !== '')
|
39
|
+
.join(' ');
|
40
|
+
};
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Find a non-ARIA label for an element
|
44
|
+
* @private
|
45
|
+
* @param {VirtualNode} element The VirtualNode instance whose label we are seeking
|
46
|
+
* @return {HTMLElement} The label element, or null if none is found
|
47
|
+
*/
|
48
|
+
function getExplicitLabels({ actualNode }) {
|
49
|
+
if (!actualNode.id) {
|
50
|
+
return [];
|
51
|
+
}
|
52
|
+
return dom.findElmsInContext({
|
53
|
+
elm: 'label',
|
54
|
+
attr: 'for',
|
55
|
+
value: actualNode.id,
|
56
|
+
context: actualNode
|
57
|
+
});
|
58
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/* global text, dom, axe, aria */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Gets the visible text of a label for a given input
|
5
|
+
* @see http://www.w3.org/WAI/PF/aria/roles#namecalculation
|
6
|
+
* @method labelVirtual
|
7
|
+
* @memberof axe.commons.text
|
8
|
+
* @instance
|
9
|
+
* @param {VirtualNode} node The virtual node mapping to the input to test
|
10
|
+
* @return {Mixed} String of visible text, or `null` if no label is found
|
11
|
+
*/
|
12
|
+
text.labelVirtual = function(node) {
|
13
|
+
var ref, candidate, doc;
|
14
|
+
|
15
|
+
candidate = aria.labelVirtual(node);
|
16
|
+
if (candidate) {
|
17
|
+
return candidate;
|
18
|
+
}
|
19
|
+
|
20
|
+
// explicit label
|
21
|
+
if (node.actualNode.id) {
|
22
|
+
const id = axe.utils.escapeSelector(node.actualNode.getAttribute('id'));
|
23
|
+
doc = axe.commons.dom.getRootNode(node.actualNode);
|
24
|
+
ref = doc.querySelector('label[for="' + id + '"]');
|
25
|
+
candidate = ref && text.visible(ref, true);
|
26
|
+
if (candidate) {
|
27
|
+
return candidate;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
ref = dom.findUpVirtual(node, 'label');
|
32
|
+
candidate = ref && text.visible(ref, true);
|
33
|
+
if (candidate) {
|
34
|
+
return candidate;
|
35
|
+
}
|
36
|
+
|
37
|
+
return null;
|
38
|
+
};
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Finds virtual node and calls labelVirtual()
|
42
|
+
* IMPORTANT: This method requires the composed tree at axe._tree
|
43
|
+
* @see axe.commons.text.virtualLabel
|
44
|
+
* @method label
|
45
|
+
* @memberof axe.commons.text
|
46
|
+
* @instance
|
47
|
+
* @param {Element} node The virtual node mapping to the input to test
|
48
|
+
* @return {Mixed} String of visible text, or `null` if no label is found
|
49
|
+
*/
|
50
|
+
text.label = function(node) {
|
51
|
+
node = axe.utils.getNodeFromTree(axe._tree[0], node);
|
52
|
+
return text.labelVirtual(node);
|
53
|
+
};
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/* global text */
|
2
|
+
text.nativeElementType = [
|
3
|
+
{
|
4
|
+
// 5.1 input type="text", input type="password", input type="search", input type="tel", input type="url" and textarea Element
|
5
|
+
matches: [
|
6
|
+
{
|
7
|
+
nodeName: 'textarea'
|
8
|
+
},
|
9
|
+
{
|
10
|
+
nodeName: 'input',
|
11
|
+
properties: {
|
12
|
+
type: ['text', 'password', 'search', 'tel', 'email', 'url']
|
13
|
+
}
|
14
|
+
}
|
15
|
+
],
|
16
|
+
namingMethods: 'labelText'
|
17
|
+
},
|
18
|
+
{
|
19
|
+
// 5.2 input type="button", input type="submit" and input type="reset"
|
20
|
+
matches: {
|
21
|
+
nodeName: 'input',
|
22
|
+
properties: {
|
23
|
+
type: ['button', 'submit', 'reset']
|
24
|
+
}
|
25
|
+
},
|
26
|
+
namingMethods: ['valueText', 'titleText', 'buttonDefaultText']
|
27
|
+
},
|
28
|
+
{
|
29
|
+
// 5.3 input type="image"
|
30
|
+
matches: {
|
31
|
+
nodeName: 'input',
|
32
|
+
properties: {
|
33
|
+
type: 'image'
|
34
|
+
}
|
35
|
+
},
|
36
|
+
namingMethods: [
|
37
|
+
'altText',
|
38
|
+
'valueText',
|
39
|
+
'labelText',
|
40
|
+
'titleText',
|
41
|
+
'buttonDefaultText'
|
42
|
+
]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
// 5.4 button Element
|
46
|
+
matches: 'button',
|
47
|
+
namingMethods: 'subtreeText'
|
48
|
+
},
|
49
|
+
{
|
50
|
+
// 5.5 fieldset and legend Elements
|
51
|
+
matches: 'fieldset',
|
52
|
+
namingMethods: 'fieldsetLegendText'
|
53
|
+
},
|
54
|
+
{
|
55
|
+
// 5.6 output Element
|
56
|
+
matches: 'OUTPUT',
|
57
|
+
namingMethods: 'subtreeText'
|
58
|
+
},
|
59
|
+
{
|
60
|
+
// 5.7 Other Form Elements
|
61
|
+
matches: [
|
62
|
+
{
|
63
|
+
nodeName: 'select'
|
64
|
+
},
|
65
|
+
{
|
66
|
+
nodeName: 'input',
|
67
|
+
properties: {
|
68
|
+
// Regex: Everything other than these
|
69
|
+
type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
|
70
|
+
}
|
71
|
+
}
|
72
|
+
],
|
73
|
+
namingMethods: 'labelText'
|
74
|
+
},
|
75
|
+
{
|
76
|
+
// 5.8 summary Element
|
77
|
+
matches: 'summary',
|
78
|
+
namingMethods: 'subtreeText'
|
79
|
+
},
|
80
|
+
{
|
81
|
+
// 5.9 figure and figcaption Elements
|
82
|
+
matches: 'figure',
|
83
|
+
namingMethods: ['figureText', 'titleText']
|
84
|
+
},
|
85
|
+
{
|
86
|
+
// 5.10 img Element
|
87
|
+
matches: 'img',
|
88
|
+
namingMethods: 'altText'
|
89
|
+
},
|
90
|
+
{
|
91
|
+
// 5.11 table Element
|
92
|
+
matches: 'table',
|
93
|
+
namingMethods: ['tableCaptionText', 'tableSummaryText']
|
94
|
+
},
|
95
|
+
{
|
96
|
+
matches: ['hr', 'br'],
|
97
|
+
namingMethods: ['titleText', 'singleSpace']
|
98
|
+
}
|
99
|
+
// All else defaults to just title
|
100
|
+
];
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/* global text, aria */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Get the accessible text using native HTML methods only
|
5
|
+
* @param {VirtualNode} element
|
6
|
+
* @param {Object} context
|
7
|
+
* @property {Bool} debug Enable logging for formControlValue
|
8
|
+
* @return {String} Accessible text
|
9
|
+
*/
|
10
|
+
text.nativeTextAlternative = function nativeTextAlternative(
|
11
|
+
virtualNode,
|
12
|
+
context = {}
|
13
|
+
) {
|
14
|
+
const { actualNode } = virtualNode;
|
15
|
+
if (
|
16
|
+
actualNode.nodeType !== 1 ||
|
17
|
+
['presentation', 'none'].includes(aria.getRole(actualNode))
|
18
|
+
) {
|
19
|
+
return '';
|
20
|
+
}
|
21
|
+
|
22
|
+
const textMethods = findTextMethods(virtualNode);
|
23
|
+
// Find the first step that returns a non-empty string
|
24
|
+
let accName = textMethods.reduce((accName, step) => {
|
25
|
+
return accName || step(virtualNode, context);
|
26
|
+
}, '');
|
27
|
+
|
28
|
+
if (context.debug) {
|
29
|
+
axe.log(accName || '{empty-value}', actualNode, context);
|
30
|
+
}
|
31
|
+
return accName;
|
32
|
+
};
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Get accessible text functions for a specific native HTML element
|
36
|
+
* @private
|
37
|
+
* @param {VirtualNode} element
|
38
|
+
* @return {Function[]} Array of native accessible name computation methods
|
39
|
+
*/
|
40
|
+
function findTextMethods(virtualNode) {
|
41
|
+
const { nativeElementType, nativeTextMethods } = text;
|
42
|
+
const nativeType = nativeElementType.find(({ matches }) => {
|
43
|
+
return axe.commons.matches(virtualNode, matches);
|
44
|
+
});
|
45
|
+
|
46
|
+
// Use concat because namingMethods can be a string or an array of strings
|
47
|
+
const methods = nativeType ? [].concat(nativeType.namingMethods) : [];
|
48
|
+
|
49
|
+
return methods.map(methodName => nativeTextMethods[methodName]);
|
50
|
+
}
|
@@ -0,0 +1,122 @@
|
|
1
|
+
/* global text */
|
2
|
+
|
3
|
+
const defaultButtonValues = {
|
4
|
+
submit: 'Submit',
|
5
|
+
image: 'Submit',
|
6
|
+
reset: 'Reset',
|
7
|
+
button: '' // No default for "button"
|
8
|
+
};
|
9
|
+
|
10
|
+
text.nativeTextMethods = {
|
11
|
+
/**
|
12
|
+
* Return the value of a DOM node
|
13
|
+
* @param {VirtualNode} element
|
14
|
+
* @return {String} value text
|
15
|
+
*/
|
16
|
+
valueText: ({ actualNode }) => actualNode.value || '',
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Return default value of a button
|
20
|
+
* @param {VirtualNode} element
|
21
|
+
* @return {String} default button text
|
22
|
+
*/
|
23
|
+
buttonDefaultText: ({ actualNode }) =>
|
24
|
+
defaultButtonValues[actualNode.type] || '',
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Return caption text of an HTML table element
|
28
|
+
* @param {VirtualNode} element
|
29
|
+
* @param {Object} context
|
30
|
+
* @return {String} caption text
|
31
|
+
*/
|
32
|
+
tableCaptionText: descendantText.bind(null, 'caption'),
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Return figcaption text of an HTML figure element
|
36
|
+
* @param {VirtualNode} element
|
37
|
+
* @param {Object} context
|
38
|
+
* @return {String} figcaption text
|
39
|
+
*/
|
40
|
+
figureText: descendantText.bind(null, 'figcaption'),
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Return legend text of an HTML fieldset element
|
44
|
+
* @param {VirtualNode} element
|
45
|
+
* @param {Object} context
|
46
|
+
* @return {String} legend text
|
47
|
+
*/
|
48
|
+
fieldsetLegendText: descendantText.bind(null, 'legend'),
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Return the alt text
|
52
|
+
* @param {VirtualNode} element
|
53
|
+
* @return {String} alt text
|
54
|
+
*/
|
55
|
+
altText: attrText.bind(null, 'alt'),
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Return summary text for an HTML table element
|
59
|
+
* @param {VirtualNode} element
|
60
|
+
* @return {String} summary text
|
61
|
+
*/
|
62
|
+
tableSummaryText: attrText.bind(null, 'summary'),
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Return the title text
|
66
|
+
* @param {VirtualNode} element
|
67
|
+
* @return {String} title text
|
68
|
+
*/
|
69
|
+
titleText: function titleText(virtualNode, context) {
|
70
|
+
return text.titleText(virtualNode, context);
|
71
|
+
},
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Return accessible text of the subtree
|
75
|
+
* @param {VirtualNode} element
|
76
|
+
* @param {Object} context
|
77
|
+
* @return {String} Subtree text
|
78
|
+
*/
|
79
|
+
subtreeText: function subtreeText(virtualNode, context) {
|
80
|
+
return text.subtreeText(virtualNode, context);
|
81
|
+
},
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Return accessible text for an implicit and/or explicit HTML label element
|
85
|
+
* @param {VirtualNode} element
|
86
|
+
* @param {Object} context
|
87
|
+
* @return {String} Label text
|
88
|
+
*/
|
89
|
+
labelText: function labelText(virtualNode, context) {
|
90
|
+
return text.labelText(virtualNode, context);
|
91
|
+
},
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Return a single space
|
95
|
+
* @return {String} Returns ` `
|
96
|
+
*/
|
97
|
+
singleSpace: function singleSpace() {
|
98
|
+
return ' '
|
99
|
+
}
|
100
|
+
};
|
101
|
+
|
102
|
+
function attrText(attr, { actualNode }) {
|
103
|
+
return actualNode.getAttribute(attr) || '';
|
104
|
+
}
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Get the accessible text of first matching node
|
108
|
+
* IMPORTANT: This method does not look at the composed tree
|
109
|
+
* @private
|
110
|
+
*/
|
111
|
+
function descendantText(nodeName, { actualNode }, context) {
|
112
|
+
nodeName = nodeName.toLowerCase();
|
113
|
+
// Prevent accidently getting the nested element, like:
|
114
|
+
// fieldset > fielset > legend (1st fieldset has no legend)
|
115
|
+
const nodeNames = [nodeName, actualNode.nodeName.toLowerCase()].join(',');
|
116
|
+
const candidate = actualNode.querySelector(nodeNames);
|
117
|
+
|
118
|
+
if (!candidate || candidate.nodeName.toLowerCase() !== nodeName) {
|
119
|
+
return '';
|
120
|
+
}
|
121
|
+
return text.accessibleText(candidate, context);
|
122
|
+
}
|