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,97 @@
|
|
1
|
+
/*exported DqElement */
|
2
|
+
|
3
|
+
function truncate(str, maxLength) {
|
4
|
+
maxLength = maxLength || 300;
|
5
|
+
|
6
|
+
if (str.length > maxLength) {
|
7
|
+
var index = str.indexOf('>');
|
8
|
+
str = str.substring(0, index + 1);
|
9
|
+
}
|
10
|
+
|
11
|
+
return str;
|
12
|
+
}
|
13
|
+
|
14
|
+
function getSource(element) {
|
15
|
+
var source = element.outerHTML;
|
16
|
+
if (!source && typeof XMLSerializer === 'function') {
|
17
|
+
source = new XMLSerializer().serializeToString(element);
|
18
|
+
}
|
19
|
+
return truncate(source || '');
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* "Serialized" `HTMLElement`. It will calculate the CSS selector,
|
24
|
+
* grab the source (outerHTML) and offer an array for storing frame paths
|
25
|
+
* @param {HTMLElement} element The element to serialize
|
26
|
+
* @param {Object} spec Properties to use in place of the element when instantiated on Elements from other frames
|
27
|
+
*/
|
28
|
+
function DqElement(element, options, spec) {
|
29
|
+
this._fromFrame = !!spec;
|
30
|
+
|
31
|
+
this.spec = spec || {};
|
32
|
+
if (options && options.absolutePaths) {
|
33
|
+
this._options = { toRoot: true };
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The generated HTML source code of the element
|
38
|
+
* @type {String}
|
39
|
+
*/
|
40
|
+
this.source =
|
41
|
+
this.spec.source !== undefined ? this.spec.source : getSource(element);
|
42
|
+
|
43
|
+
/**
|
44
|
+
* The element which this object is based off or the containing frame, used for sorting.
|
45
|
+
* Excluded in toJSON method.
|
46
|
+
* @type {HTMLElement}
|
47
|
+
*/
|
48
|
+
this._element = element;
|
49
|
+
}
|
50
|
+
|
51
|
+
DqElement.prototype = {
|
52
|
+
/**
|
53
|
+
* A unique CSS selector for the element
|
54
|
+
* @return {String}
|
55
|
+
*/
|
56
|
+
get selector() {
|
57
|
+
return (
|
58
|
+
this.spec.selector || [axe.utils.getSelector(this.element, this._options)]
|
59
|
+
);
|
60
|
+
},
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Xpath to the element
|
64
|
+
* @return {String}
|
65
|
+
*/
|
66
|
+
get xpath() {
|
67
|
+
return this.spec.xpath || [axe.utils.getXpath(this.element)];
|
68
|
+
},
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Direct reference to the `HTMLElement` wrapped by this `DQElement`.
|
72
|
+
*/
|
73
|
+
get element() {
|
74
|
+
return this._element;
|
75
|
+
},
|
76
|
+
|
77
|
+
get fromFrame() {
|
78
|
+
return this._fromFrame;
|
79
|
+
},
|
80
|
+
|
81
|
+
toJSON: function() {
|
82
|
+
'use strict';
|
83
|
+
return {
|
84
|
+
selector: this.selector,
|
85
|
+
source: this.source,
|
86
|
+
xpath: this.xpath
|
87
|
+
};
|
88
|
+
}
|
89
|
+
};
|
90
|
+
|
91
|
+
DqElement.fromFrame = function(node, options, frame) {
|
92
|
+
node.selector.unshift(frame.selector);
|
93
|
+
node.xpath.unshift(frame.xpath);
|
94
|
+
return new axe.utils.DqElement(frame.element, options, node);
|
95
|
+
};
|
96
|
+
|
97
|
+
axe.utils.DqElement = DqElement;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Polyfill for Element#matches
|
3
|
+
* @param {HTMLElement} node The element to test
|
4
|
+
* @param {String} selector The selector to test element against
|
5
|
+
* @return {Boolean}
|
6
|
+
*/
|
7
|
+
axe.utils.matchesSelector = (function() {
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
var method;
|
11
|
+
|
12
|
+
function getMethod(node) {
|
13
|
+
var index,
|
14
|
+
candidate,
|
15
|
+
candidates = [
|
16
|
+
'matches',
|
17
|
+
'matchesSelector',
|
18
|
+
'mozMatchesSelector',
|
19
|
+
'webkitMatchesSelector',
|
20
|
+
'msMatchesSelector'
|
21
|
+
],
|
22
|
+
length = candidates.length;
|
23
|
+
|
24
|
+
for (index = 0; index < length; index++) {
|
25
|
+
candidate = candidates[index];
|
26
|
+
if (node[candidate]) {
|
27
|
+
return candidate;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
return function(node, selector) {
|
33
|
+
if (!method || !node[method]) {
|
34
|
+
method = getMethod(node);
|
35
|
+
}
|
36
|
+
|
37
|
+
return node[method](selector);
|
38
|
+
};
|
39
|
+
})();
|
@@ -0,0 +1,79 @@
|
|
1
|
+
/**
|
2
|
+
* Escapes a property value of a CSS selector
|
3
|
+
* @see https://github.com/mathiasbynens/CSS.escape/
|
4
|
+
* @see http://dev.w3.org/csswg/cssom/#serialize-an-identifier
|
5
|
+
* @param {String} value The piece of the selector to escape
|
6
|
+
* @return {String} The escaped selector
|
7
|
+
*/
|
8
|
+
axe.utils.escapeSelector = function(value) {
|
9
|
+
'use strict';
|
10
|
+
/*eslint no-bitwise: 0, eqeqeq: 0, complexity: ["error",27],
|
11
|
+
max-statements:["error", 25], one-var: 0, -W041: 0 */
|
12
|
+
var string = String(value);
|
13
|
+
var length = string.length;
|
14
|
+
var index = -1;
|
15
|
+
var codeUnit;
|
16
|
+
var result = '';
|
17
|
+
var firstCodeUnit = string.charCodeAt(0);
|
18
|
+
while (++index < length) {
|
19
|
+
codeUnit = string.charCodeAt(index);
|
20
|
+
// Note: there’s no need to special-case astral symbols, surrogate
|
21
|
+
// pairs, or lone surrogates.
|
22
|
+
|
23
|
+
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
|
24
|
+
// (U+FFFD).
|
25
|
+
if (codeUnit == 0x0000) {
|
26
|
+
result += '\uFFFD';
|
27
|
+
continue;
|
28
|
+
}
|
29
|
+
|
30
|
+
if (
|
31
|
+
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
|
32
|
+
// U+007F, […]
|
33
|
+
(codeUnit >= 0x0001 && codeUnit <= 0x001f) ||
|
34
|
+
codeUnit == 0x007f ||
|
35
|
+
// If the character is the first character and is in the range [0-9]
|
36
|
+
// (U+0030 to U+0039), […]
|
37
|
+
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
|
38
|
+
// If the character is the second character and is in the range [0-9]
|
39
|
+
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
|
40
|
+
(index == 1 &&
|
41
|
+
codeUnit >= 0x0030 &&
|
42
|
+
codeUnit <= 0x0039 &&
|
43
|
+
firstCodeUnit == 0x002d)
|
44
|
+
) {
|
45
|
+
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
|
46
|
+
result += '\\' + codeUnit.toString(16) + ' ';
|
47
|
+
continue;
|
48
|
+
}
|
49
|
+
|
50
|
+
// If the character is the first character and is a `-` (U+002D), and
|
51
|
+
// there is no second character, […]
|
52
|
+
if (index == 0 && length == 1 && codeUnit == 0x002d) {
|
53
|
+
result += '\\' + string.charAt(index);
|
54
|
+
continue;
|
55
|
+
}
|
56
|
+
|
57
|
+
// If the character is not handled by one of the above rules and is
|
58
|
+
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
|
59
|
+
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
|
60
|
+
// U+005A), or [a-z] (U+0061 to U+007A), […]
|
61
|
+
if (
|
62
|
+
codeUnit >= 0x0080 ||
|
63
|
+
codeUnit == 0x002d ||
|
64
|
+
codeUnit == 0x005f ||
|
65
|
+
(codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
|
66
|
+
(codeUnit >= 0x0041 && codeUnit <= 0x005a) ||
|
67
|
+
(codeUnit >= 0x0061 && codeUnit <= 0x007a)
|
68
|
+
) {
|
69
|
+
// the character itself
|
70
|
+
result += string.charAt(index);
|
71
|
+
continue;
|
72
|
+
}
|
73
|
+
|
74
|
+
// Otherwise, the escaped character.
|
75
|
+
// https://drafts.csswg.org/cssom/#escape-a-character
|
76
|
+
result += '\\' + string.charAt(index);
|
77
|
+
}
|
78
|
+
return result;
|
79
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/*eslint no-empty: 0*/
|
2
|
+
/**
|
3
|
+
* Extends metadata onto result object and executes any functions
|
4
|
+
* @param {Object} to The target of the extend
|
5
|
+
* @param {Object} from Metadata to extend
|
6
|
+
*/
|
7
|
+
axe.utils.extendMetaData = function(to, from) {
|
8
|
+
Object.assign(to, from);
|
9
|
+
Object.keys(from)
|
10
|
+
.filter(prop => typeof from[prop] === 'function')
|
11
|
+
.forEach(prop => {
|
12
|
+
to[prop] = null;
|
13
|
+
try {
|
14
|
+
to[prop] = from[prop](to);
|
15
|
+
} catch (e) {}
|
16
|
+
});
|
17
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* Process rule results, grouping them by outcome
|
3
|
+
* @param ruleResult {object}
|
4
|
+
* @return {object}
|
5
|
+
*/
|
6
|
+
axe.utils.finalizeRuleResult = function(ruleResult) {
|
7
|
+
Object.assign(ruleResult, axe.utils.aggregateNodeResults(ruleResult.nodes));
|
8
|
+
delete ruleResult.nodes;
|
9
|
+
|
10
|
+
return ruleResult;
|
11
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* Iterates an array of objects looking for a property with a specific value
|
3
|
+
* @method findBy
|
4
|
+
* @memberof axe.utils
|
5
|
+
* @param {Array} array The array of objects to iterate
|
6
|
+
* @param {String} key The property name to test against
|
7
|
+
* @param {Mixed} value The value to find
|
8
|
+
* @return {Object} The first matching object or `undefined` if no match
|
9
|
+
*/
|
10
|
+
axe.utils.findBy = function(array, key, value) {
|
11
|
+
if (Array.isArray(array)) {
|
12
|
+
return array.find(obj => typeof obj === 'object' && obj[key] === value);
|
13
|
+
}
|
14
|
+
};
|
@@ -0,0 +1,170 @@
|
|
1
|
+
/*eslint no-use-before-define: 0*/
|
2
|
+
var axe = axe || { utils: {} };
|
3
|
+
|
4
|
+
/**
|
5
|
+
* This implemnts the flatten-tree algorithm specified:
|
6
|
+
* Originally here https://drafts.csswg.org/css-scoping/#flat-tree
|
7
|
+
* Hopefully soon published here: https://www.w3.org/TR/css-scoping-1/#flat-tree
|
8
|
+
*
|
9
|
+
* Some notable information:
|
10
|
+
******* NOTE: as of Chrome 59, this is broken in Chrome so that tests fail completely
|
11
|
+
******* removed functionality for now
|
12
|
+
* 1. <slot> elements do not have boxes by default (i.e. they do not get rendered and
|
13
|
+
* their CSS properties are ignored)
|
14
|
+
* 2. <slot> elements can be made to have a box by overriding the display property
|
15
|
+
* which is 'contents' by default
|
16
|
+
* 3. Even boxed <slot> elements do not show up in the accessibility tree until
|
17
|
+
* they have a tabindex applied to them OR they have a role applied to them AND
|
18
|
+
* they have a box (this is observed behavior in Safari on OS X, I cannot find
|
19
|
+
* the spec for this)
|
20
|
+
*/
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Wrap the real node and provide list of the flattened children
|
24
|
+
*
|
25
|
+
* @param node {Node} - the node in question
|
26
|
+
* @param shadowId {String} - the ID of the shadow DOM to which this node belongs
|
27
|
+
* @return {Object} - the wrapped node
|
28
|
+
*/
|
29
|
+
function virtualDOMfromNode(node, shadowId) {
|
30
|
+
const vNodeCache = {};
|
31
|
+
return {
|
32
|
+
shadowId: shadowId,
|
33
|
+
children: [],
|
34
|
+
actualNode: node,
|
35
|
+
get isFocusable() {
|
36
|
+
if (!vNodeCache._isFocusable) {
|
37
|
+
vNodeCache._isFocusable = axe.commons.dom.isFocusable(node);
|
38
|
+
}
|
39
|
+
return vNodeCache._isFocusable;
|
40
|
+
},
|
41
|
+
get tabbableElements() {
|
42
|
+
if (!vNodeCache._tabbableElements) {
|
43
|
+
vNodeCache._tabbableElements = axe.commons.dom.getTabbableElements(
|
44
|
+
this
|
45
|
+
);
|
46
|
+
}
|
47
|
+
return vNodeCache._tabbableElements;
|
48
|
+
}
|
49
|
+
};
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* find all the fallback content for a <slot> and return these as an array
|
54
|
+
* this array will also include any #text nodes
|
55
|
+
*
|
56
|
+
* @param node {Node} - the slot Node
|
57
|
+
* @return Array{Nodes}
|
58
|
+
*/
|
59
|
+
function getSlotChildren(node) {
|
60
|
+
var retVal = [];
|
61
|
+
|
62
|
+
node = node.firstChild;
|
63
|
+
while (node) {
|
64
|
+
retVal.push(node);
|
65
|
+
node = node.nextSibling;
|
66
|
+
}
|
67
|
+
return retVal;
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Recursvely returns an array of the virtual DOM nodes at this level
|
72
|
+
* excluding comment nodes and the shadow DOM nodes <content> and <slot>
|
73
|
+
*
|
74
|
+
* @param {Node} node the current node
|
75
|
+
* @param {String} shadowId, optional ID of the shadow DOM that is the closest shadow
|
76
|
+
* ancestor of the node
|
77
|
+
*/
|
78
|
+
axe.utils.getFlattenedTree = function(node, shadowId) {
|
79
|
+
// using a closure here and therefore cannot easily refactor toreduce the statements
|
80
|
+
/*eslint max-statements: ["error", 31] */
|
81
|
+
var retVal, realArray, nodeName;
|
82
|
+
function reduceShadowDOM(res, child) {
|
83
|
+
var replacements = axe.utils.getFlattenedTree(child, shadowId);
|
84
|
+
if (replacements) {
|
85
|
+
res = res.concat(replacements);
|
86
|
+
}
|
87
|
+
return res;
|
88
|
+
}
|
89
|
+
|
90
|
+
if (node.documentElement) {
|
91
|
+
// document
|
92
|
+
node = node.documentElement;
|
93
|
+
}
|
94
|
+
nodeName = node.nodeName.toLowerCase();
|
95
|
+
|
96
|
+
if (axe.utils.isShadowRoot(node)) {
|
97
|
+
// generate an ID for this shadow root and overwrite the current
|
98
|
+
// closure shadowId with this value so that it cascades down the tree
|
99
|
+
retVal = virtualDOMfromNode(node, shadowId);
|
100
|
+
shadowId =
|
101
|
+
'a' +
|
102
|
+
Math.random()
|
103
|
+
.toString()
|
104
|
+
.substring(2);
|
105
|
+
realArray = Array.from(node.shadowRoot.childNodes);
|
106
|
+
retVal.children = realArray.reduce(reduceShadowDOM, []);
|
107
|
+
return [retVal];
|
108
|
+
} else {
|
109
|
+
if (nodeName === 'content') {
|
110
|
+
realArray = Array.from(node.getDistributedNodes());
|
111
|
+
return realArray.reduce(reduceShadowDOM, []);
|
112
|
+
} else if (
|
113
|
+
nodeName === 'slot' &&
|
114
|
+
typeof node.assignedNodes === 'function'
|
115
|
+
) {
|
116
|
+
realArray = Array.from(node.assignedNodes());
|
117
|
+
if (!realArray.length) {
|
118
|
+
// fallback content
|
119
|
+
realArray = getSlotChildren(node);
|
120
|
+
}
|
121
|
+
var styl = window.getComputedStyle(node);
|
122
|
+
// check the display property
|
123
|
+
if (false && styl.display !== 'contents') {
|
124
|
+
// intentionally commented out
|
125
|
+
// has a box
|
126
|
+
retVal = virtualDOMfromNode(node, shadowId);
|
127
|
+
retVal.children = realArray.reduce(reduceShadowDOM, []);
|
128
|
+
return [retVal];
|
129
|
+
} else {
|
130
|
+
return realArray.reduce(reduceShadowDOM, []);
|
131
|
+
}
|
132
|
+
} else {
|
133
|
+
if (node.nodeType === 1) {
|
134
|
+
retVal = virtualDOMfromNode(node, shadowId);
|
135
|
+
realArray = Array.from(node.childNodes);
|
136
|
+
retVal.children = realArray.reduce(reduceShadowDOM, []);
|
137
|
+
return [retVal];
|
138
|
+
} else if (node.nodeType === 3) {
|
139
|
+
// text
|
140
|
+
return [virtualDOMfromNode(node)];
|
141
|
+
}
|
142
|
+
return undefined;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
};
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Recursively return a single node from a virtual dom tree
|
149
|
+
*
|
150
|
+
* @param {Object} vNode The flattened, virtual DOM tree
|
151
|
+
* @param {Node} node The HTML DOM node
|
152
|
+
*/
|
153
|
+
axe.utils.getNodeFromTree = function(vNode, node) {
|
154
|
+
var found;
|
155
|
+
|
156
|
+
if (vNode.actualNode === node) {
|
157
|
+
return vNode;
|
158
|
+
}
|
159
|
+
vNode.children.forEach(candidate => {
|
160
|
+
if (found) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
if (candidate.actualNode === node) {
|
164
|
+
found = candidate;
|
165
|
+
} else {
|
166
|
+
found = axe.utils.getNodeFromTree(candidate, node);
|
167
|
+
}
|
168
|
+
});
|
169
|
+
return found;
|
170
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* Gets all Checks (or CheckResults) for a given Rule or RuleResult
|
3
|
+
* @param {RuleResult|Rule} rule
|
4
|
+
*/
|
5
|
+
axe.utils.getAllChecks = function getAllChecks(object) {
|
6
|
+
'use strict';
|
7
|
+
var result = [];
|
8
|
+
return result
|
9
|
+
.concat(object.any || [])
|
10
|
+
.concat(object.all || [])
|
11
|
+
.concat(object.none || []);
|
12
|
+
};
|