govuk_publishing_components 18.1.0 → 18.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/CHANGELOG.md +741 -0
- data/node_modules/axe-core/CONTRIBUTING.md +187 -0
- data/node_modules/axe-core/LICENSE +362 -0
- data/node_modules/axe-core/README.md +147 -0
- data/node_modules/axe-core/axe.d.ts +216 -0
- data/node_modules/axe-core/axe.js +15298 -0
- data/node_modules/axe-core/axe.min.js +12 -0
- data/node_modules/axe-core/bower.json +40 -0
- data/node_modules/axe-core/doc/API.md +798 -0
- data/node_modules/axe-core/doc/accessibility-supported.md +33 -0
- data/node_modules/axe-core/doc/act-rules-format.md +37 -0
- data/node_modules/axe-core/doc/aria-supported.md +23 -0
- data/node_modules/axe-core/doc/axelogo2018.png +0 -0
- data/node_modules/axe-core/doc/code-submission-guidelines.md +178 -0
- data/node_modules/axe-core/doc/developer-guide.md +500 -0
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/README.md +13 -0
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/axe-cdp.js +81 -0
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/package.json +8 -0
- data/node_modules/axe-core/doc/examples/html-handlebars.md +164 -0
- data/node_modules/axe-core/doc/examples/jasmine/README.md +37 -0
- data/node_modules/axe-core/doc/examples/jasmine/package.json +20 -0
- data/node_modules/axe-core/doc/examples/jasmine/spec/a11y.js +36 -0
- data/node_modules/axe-core/doc/examples/jest_react/README.md +41 -0
- data/node_modules/axe-core/doc/examples/jest_react/link.js +7 -0
- data/node_modules/axe-core/doc/examples/jest_react/link.test.js +24 -0
- data/node_modules/axe-core/doc/examples/jest_react/package.json +28 -0
- data/node_modules/axe-core/doc/examples/jest_react/test-helpers.js +21 -0
- data/node_modules/axe-core/doc/examples/mocha/README.md +37 -0
- data/node_modules/axe-core/doc/examples/mocha/package.json +21 -0
- data/node_modules/axe-core/doc/examples/phantomjs/README.md +17 -0
- data/node_modules/axe-core/doc/examples/phantomjs/axe-phantom.js +51 -0
- data/node_modules/axe-core/doc/examples/phantomjs/package.json +19 -0
- data/node_modules/axe-core/doc/examples/puppeteer/README.md +12 -0
- data/node_modules/axe-core/doc/examples/puppeteer/axe-puppeteer.js +60 -0
- data/node_modules/axe-core/doc/examples/puppeteer/package.json +10 -0
- data/node_modules/axe-core/doc/examples/qunit/README.md +37 -0
- data/node_modules/axe-core/doc/examples/qunit/package.json +21 -0
- data/node_modules/axe-core/doc/plugins.md +123 -0
- data/node_modules/axe-core/doc/projects.md +44 -0
- data/node_modules/axe-core/doc/rule-descriptions.md +79 -0
- data/node_modules/axe-core/doc/rule-development.md +95 -0
- data/node_modules/axe-core/doc/rule-proposal.md +106 -0
- data/node_modules/axe-core/lib/checks/aria/abstractrole.js +1 -0
- data/node_modules/axe-core/lib/checks/aria/abstractrole.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/allowed-attr.js +39 -0
- data/node_modules/axe-core/lib/checks/aria/allowed-attr.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/aria-allowed-role.js +28 -0
- data/node_modules/axe-core/lib/checks/aria/aria-allowed-role.json +16 -0
- data/node_modules/axe-core/lib/checks/aria/aria-hidden-body.js +1 -0
- data/node_modules/axe-core/lib/checks/aria/aria-hidden-body.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/errormessage.js +33 -0
- data/node_modules/axe-core/lib/checks/aria/errormessage.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/has-widget-role.js +6 -0
- data/node_modules/axe-core/lib/checks/aria/has-widget-role.json +12 -0
- data/node_modules/axe-core/lib/checks/aria/implicit-role-fallback.js +6 -0
- data/node_modules/axe-core/lib/checks/aria/implicit-role-fallback.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/invalidrole.js +3 -0
- data/node_modules/axe-core/lib/checks/aria/invalidrole.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/required-attr.js +28 -0
- data/node_modules/axe-core/lib/checks/aria/required-attr.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/required-children.js +117 -0
- data/node_modules/axe-core/lib/checks/aria/required-children.json +15 -0
- data/node_modules/axe-core/lib/checks/aria/required-parent.js +87 -0
- data/node_modules/axe-core/lib/checks/aria/required-parent.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedattr.js +39 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedattr.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedrole.js +1 -0
- data/node_modules/axe-core/lib/checks/aria/unsupportedrole.json +11 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr-value.js +32 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr-value.json +12 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr.js +25 -0
- data/node_modules/axe-core/lib/checks/aria/valid-attr.json +12 -0
- data/node_modules/axe-core/lib/checks/aria/valid-scrollable-semantics.js +62 -0
- data/node_modules/axe-core/lib/checks/aria/valid-scrollable-semantics.json +12 -0
- data/node_modules/axe-core/lib/checks/color/color-contrast.js +70 -0
- data/node_modules/axe-core/lib/checks/color/color-contrast.json +24 -0
- data/node_modules/axe-core/lib/checks/color/link-in-text-block.js +85 -0
- data/node_modules/axe-core/lib/checks/color/link-in-text-block.json +19 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-appropriate.js +67 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-appropriate.json +11 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-valid.js +2 -0
- data/node_modules/axe-core/lib/checks/forms/autocomplete-valid.json +11 -0
- data/node_modules/axe-core/lib/checks/forms/fieldset-after.js +25 -0
- data/node_modules/axe-core/lib/checks/forms/fieldset.js +109 -0
- data/node_modules/axe-core/lib/checks/forms/fieldset.json +12 -0
- data/node_modules/axe-core/lib/checks/forms/group-labelledby-after.js +16 -0
- data/node_modules/axe-core/lib/checks/forms/group-labelledby.js +66 -0
- data/node_modules/axe-core/lib/checks/forms/group-labelledby.json +12 -0
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys-after.js +19 -0
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys.js +5 -0
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys.json +12 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-disabled.js +25 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-disabled.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-no-name.js +6 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-no-name.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-not-tabbable.js +25 -0
- data/node_modules/axe-core/lib/checks/keyboard/focusable-not-tabbable.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/landmark-is-top-level.js +18 -0
- data/node_modules/axe-core/lib/checks/keyboard/landmark-is-top-level.json +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-elm-after.js +11 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-elm.js +9 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-heading-one.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-has-main.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-banner.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-contentinfo.json +15 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-main.json +14 -0
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate.js +22 -0
- data/node_modules/axe-core/lib/checks/keyboard/tabindex.js +1 -0
- data/node_modules/axe-core/lib/checks/keyboard/tabindex.json +11 -0
- data/node_modules/axe-core/lib/checks/label/alt-space-value.js +2 -0
- data/node_modules/axe-core/lib/checks/label/alt-space-value.json +11 -0
- data/node_modules/axe-core/lib/checks/label/duplicate-img-label.js +19 -0
- data/node_modules/axe-core/lib/checks/label/duplicate-img-label.json +11 -0
- data/node_modules/axe-core/lib/checks/label/explicit.js +15 -0
- data/node_modules/axe-core/lib/checks/label/explicit.json +11 -0
- data/node_modules/axe-core/lib/checks/label/help-same-as-label.js +23 -0
- data/node_modules/axe-core/lib/checks/label/help-same-as-label.json +12 -0
- data/node_modules/axe-core/lib/checks/label/hidden-explicit-label.js +12 -0
- data/node_modules/axe-core/lib/checks/label/hidden-explicit-label.json +11 -0
- data/node_modules/axe-core/lib/checks/label/implicit.js +7 -0
- data/node_modules/axe-core/lib/checks/label/implicit.json +11 -0
- data/node_modules/axe-core/lib/checks/label/label-content-name-mismatch.js +49 -0
- data/node_modules/axe-core/lib/checks/label/label-content-name-mismatch.json +11 -0
- data/node_modules/axe-core/lib/checks/label/multiple-label.js +29 -0
- data/node_modules/axe-core/lib/checks/label/multiple-label.json +11 -0
- data/node_modules/axe-core/lib/checks/label/title-only.js +5 -0
- data/node_modules/axe-core/lib/checks/label/title-only.json +11 -0
- data/node_modules/axe-core/lib/checks/language/has-lang.js +5 -0
- data/node_modules/axe-core/lib/checks/language/has-lang.json +11 -0
- data/node_modules/axe-core/lib/checks/language/valid-lang.js +26 -0
- data/node_modules/axe-core/lib/checks/language/valid-lang.json +11 -0
- data/node_modules/axe-core/lib/checks/language/xml-lang-mismatch.js +5 -0
- data/node_modules/axe-core/lib/checks/language/xml-lang-mismatch.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/dlitem.js +23 -0
- data/node_modules/axe-core/lib/checks/lists/dlitem.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/listitem.js +18 -0
- data/node_modules/axe-core/lib/checks/lists/listitem.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/only-dlitems.js +42 -0
- data/node_modules/axe-core/lib/checks/lists/only-dlitems.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/only-listitems.js +68 -0
- data/node_modules/axe-core/lib/checks/lists/only-listitems.json +11 -0
- data/node_modules/axe-core/lib/checks/lists/structured-dlitems.js +22 -0
- data/node_modules/axe-core/lib/checks/lists/structured-dlitems.json +11 -0
- data/node_modules/axe-core/lib/checks/media/caption.js +8 -0
- data/node_modules/axe-core/lib/checks/media/caption.json +11 -0
- data/node_modules/axe-core/lib/checks/media/description.js +8 -0
- data/node_modules/axe-core/lib/checks/media/description.json +11 -0
- data/node_modules/axe-core/lib/checks/media/frame-tested.js +28 -0
- data/node_modules/axe-core/lib/checks/media/frame-tested.json +15 -0
- data/node_modules/axe-core/lib/checks/mobile/css-orientation-lock.js +132 -0
- data/node_modules/axe-core/lib/checks/mobile/css-orientation-lock.json +12 -0
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-large.json +15 -0
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js +38 -0
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport.json +14 -0
- data/node_modules/axe-core/lib/checks/navigation/header-present.js +4 -0
- data/node_modules/axe-core/lib/checks/navigation/header-present.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/heading-order-after.js +14 -0
- data/node_modules/axe-core/lib/checks/navigation/heading-order.js +15 -0
- data/node_modules/axe-core/lib/checks/navigation/heading-order.json +12 -0
- data/node_modules/axe-core/lib/checks/navigation/internal-link-present.js +4 -0
- data/node_modules/axe-core/lib/checks/navigation/internal-link-present.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/landmark.js +3 -0
- data/node_modules/axe-core/lib/checks/navigation/landmark.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/meta-refresh.js +4 -0
- data/node_modules/axe-core/lib/checks/navigation/meta-refresh.json +11 -0
- data/node_modules/axe-core/lib/checks/navigation/p-as-heading.js +93 -0
- data/node_modules/axe-core/lib/checks/navigation/p-as-heading.json +30 -0
- data/node_modules/axe-core/lib/checks/navigation/region-after.js +1 -0
- data/node_modules/axe-core/lib/checks/navigation/region.js +85 -0
- data/node_modules/axe-core/lib/checks/navigation/region.json +12 -0
- data/node_modules/axe-core/lib/checks/navigation/skip-link.js +5 -0
- data/node_modules/axe-core/lib/checks/navigation/skip-link.json +12 -0
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title-after.js +9 -0
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title.js +6 -0
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title.json +12 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-active.json +12 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-after.js +8 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-aria.json +12 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id.js +17 -0
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id.json +12 -0
- data/node_modules/axe-core/lib/checks/shared/aria-label.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/aria-label.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/aria-labelledby.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/aria-labelledby.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/button-has-visible-text.js +12 -0
- data/node_modules/axe-core/lib/checks/shared/button-has-visible-text.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/doc-has-title.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/doc-has-title.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/exists.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/exists.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/has-alt.js +4 -0
- data/node_modules/axe-core/lib/checks/shared/has-alt.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/has-visible-text.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/has-visible-text.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/is-on-screen.js +4 -0
- data/node_modules/axe-core/lib/checks/shared/is-on-screen.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-alt.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-alt.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-if-present.js +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-if-present.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-title.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-title.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-value.js +2 -0
- data/node_modules/axe-core/lib/checks/shared/non-empty-value.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/role-none.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/role-none.json +11 -0
- data/node_modules/axe-core/lib/checks/shared/role-presentation.js +1 -0
- data/node_modules/axe-core/lib/checks/shared/role-presentation.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/caption-faked.js +10 -0
- data/node_modules/axe-core/lib/checks/tables/caption-faked.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/has-caption.js +1 -0
- data/node_modules/axe-core/lib/checks/tables/has-caption.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/has-summary.js +1 -0
- data/node_modules/axe-core/lib/checks/tables/has-summary.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/has-th.js +31 -0
- data/node_modules/axe-core/lib/checks/tables/has-th.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/headers-visible-text.js +30 -0
- data/node_modules/axe-core/lib/checks/tables/html5-scope.js +5 -0
- data/node_modules/axe-core/lib/checks/tables/html5-scope.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/same-caption-summary.js +7 -0
- data/node_modules/axe-core/lib/checks/tables/same-caption-summary.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/scope-value.js +5 -0
- data/node_modules/axe-core/lib/checks/tables/scope-value.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/td-has-header.js +29 -0
- data/node_modules/axe-core/lib/checks/tables/td-has-header.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/td-headers-attr.js +62 -0
- data/node_modules/axe-core/lib/checks/tables/td-headers-attr.json +11 -0
- data/node_modules/axe-core/lib/checks/tables/th-has-data-cells.js +76 -0
- data/node_modules/axe-core/lib/checks/tables/th-has-data-cells.json +12 -0
- data/node_modules/axe-core/lib/checks/tables/th-single-row-column.js +39 -0
- data/node_modules/axe-core/lib/checks/visibility/hidden-content.js +21 -0
- data/node_modules/axe-core/lib/checks/visibility/hidden-content.json +12 -0
- data/node_modules/axe-core/lib/commons/aria/arialabel-text.js +15 -0
- data/node_modules/axe-core/lib/commons/aria/arialabelledby-text.js +52 -0
- data/node_modules/axe-core/lib/commons/aria/attributes.js +45 -0
- data/node_modules/axe-core/lib/commons/aria/get-element-unallowed-roles.js +92 -0
- data/node_modules/axe-core/lib/commons/aria/get-owned-virtual.js +24 -0
- data/node_modules/axe-core/lib/commons/aria/get-role.js +44 -0
- data/node_modules/axe-core/lib/commons/aria/index.js +2417 -0
- data/node_modules/axe-core/lib/commons/aria/is-accessible-ref.js +55 -0
- data/node_modules/axe-core/lib/commons/aria/is-aria-role-allowed-on-element.js +41 -0
- data/node_modules/axe-core/lib/commons/aria/is-unsupported-role.js +14 -0
- data/node_modules/axe-core/lib/commons/aria/label-virtual.js +54 -0
- data/node_modules/axe-core/lib/commons/aria/named-from-contents.js +39 -0
- data/node_modules/axe-core/lib/commons/aria/roles.js +208 -0
- data/node_modules/axe-core/lib/commons/aria/validate-attr-value.js +63 -0
- data/node_modules/axe-core/lib/commons/color/contrast.js +172 -0
- data/node_modules/axe-core/lib/commons/color/element-is-distinct.js +88 -0
- data/node_modules/axe-core/lib/commons/color/get-background-color.js +411 -0
- data/node_modules/axe-core/lib/commons/color/get-foreground-color.js +32 -0
- data/node_modules/axe-core/lib/commons/color/incomplete-data.js +50 -0
- data/node_modules/axe-core/lib/commons/color/index.js +8 -0
- data/node_modules/axe-core/lib/commons/dom/elements-below-floating.js +39 -0
- data/node_modules/axe-core/lib/commons/dom/find-elms-in-context.js +28 -0
- data/node_modules/axe-core/lib/commons/dom/find-up.js +63 -0
- data/node_modules/axe-core/lib/commons/dom/get-composed-parent.js +25 -0
- data/node_modules/axe-core/lib/commons/dom/get-element-by-reference.js +34 -0
- data/node_modules/axe-core/lib/commons/dom/get-element-coordinates.js +38 -0
- data/node_modules/axe-core/lib/commons/dom/get-root-node.js +12 -0
- data/node_modules/axe-core/lib/commons/dom/get-scroll-offset.js +34 -0
- data/node_modules/axe-core/lib/commons/dom/get-tabbable-elements.js +24 -0
- data/node_modules/axe-core/lib/commons/dom/get-viewport-size.js +37 -0
- data/node_modules/axe-core/lib/commons/dom/has-content-virtual.js +73 -0
- data/node_modules/axe-core/lib/commons/dom/idrefs.js +36 -0
- data/node_modules/axe-core/lib/commons/dom/index.js +9 -0
- data/node_modules/axe-core/lib/commons/dom/is-focusable.js +90 -0
- data/node_modules/axe-core/lib/commons/dom/is-hidden-with-css.js +60 -0
- data/node_modules/axe-core/lib/commons/dom/is-html5.js +17 -0
- data/node_modules/axe-core/lib/commons/dom/is-in-text-block.js +95 -0
- data/node_modules/axe-core/lib/commons/dom/is-node.js +13 -0
- data/node_modules/axe-core/lib/commons/dom/is-offscreen.js +62 -0
- data/node_modules/axe-core/lib/commons/dom/is-visible.js +77 -0
- data/node_modules/axe-core/lib/commons/dom/is-visual-content.js +50 -0
- data/node_modules/axe-core/lib/commons/dom/shadow-elements-from-point.js +41 -0
- data/node_modules/axe-core/lib/commons/dom/visually-contains.js +62 -0
- data/node_modules/axe-core/lib/commons/dom/visually-overlaps.js +47 -0
- data/node_modules/axe-core/lib/commons/index.js +11 -0
- data/node_modules/axe-core/lib/commons/intro.stub +1 -0
- data/node_modules/axe-core/lib/commons/matches/attributes.js +23 -0
- data/node_modules/axe-core/lib/commons/matches/condition.js +19 -0
- data/node_modules/axe-core/lib/commons/matches/from-definition.js +47 -0
- data/node_modules/axe-core/lib/commons/matches/from-function.js +38 -0
- data/node_modules/axe-core/lib/commons/matches/from-primative.js +30 -0
- data/node_modules/axe-core/lib/commons/matches/index.js +37 -0
- data/node_modules/axe-core/lib/commons/matches/node-name.js +34 -0
- data/node_modules/axe-core/lib/commons/matches/properties.js +25 -0
- data/node_modules/axe-core/lib/commons/outro.stub +2 -0
- data/node_modules/axe-core/lib/commons/table/get-all-cells.js +28 -0
- data/node_modules/axe-core/lib/commons/table/get-cell-position.js +28 -0
- data/node_modules/axe-core/lib/commons/table/get-headers.js +29 -0
- data/node_modules/axe-core/lib/commons/table/get-scope.js +54 -0
- data/node_modules/axe-core/lib/commons/table/index.js +9 -0
- data/node_modules/axe-core/lib/commons/table/is-column-header.js +13 -0
- data/node_modules/axe-core/lib/commons/table/is-data-cell.js +22 -0
- data/node_modules/axe-core/lib/commons/table/is-data-table.js +190 -0
- data/node_modules/axe-core/lib/commons/table/is-header.js +22 -0
- data/node_modules/axe-core/lib/commons/table/is-row-header.js +13 -0
- data/node_modules/axe-core/lib/commons/table/to-grid.js +38 -0
- data/node_modules/axe-core/lib/commons/table/traverse.js +78 -0
- data/node_modules/axe-core/lib/commons/text/accessible-text-virtual.js +152 -0
- data/node_modules/axe-core/lib/commons/text/form-control-value.js +204 -0
- data/node_modules/axe-core/lib/commons/text/index.js +8 -0
- data/node_modules/axe-core/lib/commons/text/is-human-interpretable.js +51 -0
- data/node_modules/axe-core/lib/commons/text/is-valid-autocomplete.js +118 -0
- data/node_modules/axe-core/lib/commons/text/label-text.js +58 -0
- data/node_modules/axe-core/lib/commons/text/label-virtual.js +53 -0
- data/node_modules/axe-core/lib/commons/text/native-element-types.js +100 -0
- data/node_modules/axe-core/lib/commons/text/native-text-alternative.js +50 -0
- data/node_modules/axe-core/lib/commons/text/native-text-methods.js +122 -0
- data/node_modules/axe-core/lib/commons/text/sanitize.js +18 -0
- data/node_modules/axe-core/lib/commons/text/subtree-text.js +89 -0
- data/node_modules/axe-core/lib/commons/text/title-text.js +33 -0
- data/node_modules/axe-core/lib/commons/text/unicode.js +117 -0
- data/node_modules/axe-core/lib/commons/text/unsupported.js +5 -0
- data/node_modules/axe-core/lib/commons/text/visible-virtual.js +46 -0
- data/node_modules/axe-core/lib/commons/utils/index.js +10 -0
- data/node_modules/axe-core/lib/core/base/audit.js +684 -0
- data/node_modules/axe-core/lib/core/base/check-result.js +33 -0
- data/node_modules/axe-core/lib/core/base/check.js +123 -0
- data/node_modules/axe-core/lib/core/base/context.js +273 -0
- data/node_modules/axe-core/lib/core/base/rule-result.js +39 -0
- data/node_modules/axe-core/lib/core/base/rule.js +383 -0
- data/node_modules/axe-core/lib/core/constants.js +68 -0
- data/node_modules/axe-core/lib/core/imports/index.js +26 -0
- data/node_modules/axe-core/lib/core/index.js +45 -0
- data/node_modules/axe-core/lib/core/log.js +12 -0
- data/node_modules/axe-core/lib/core/public/cleanup-plugins.js +53 -0
- data/node_modules/axe-core/lib/core/public/configure.js +57 -0
- data/node_modules/axe-core/lib/core/public/get-rules.js +29 -0
- data/node_modules/axe-core/lib/core/public/load.js +66 -0
- data/node_modules/axe-core/lib/core/public/plugins.js +47 -0
- data/node_modules/axe-core/lib/core/public/reporter.js +24 -0
- data/node_modules/axe-core/lib/core/public/reset.js +12 -0
- data/node_modules/axe-core/lib/core/public/run-rules.js +94 -0
- data/node_modules/axe-core/lib/core/public/run.js +148 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/failure-summary.js +35 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/get-environment-data.js +39 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/incomplete-fallback-msg.js +11 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/index.js +3 -0
- data/node_modules/axe-core/lib/core/reporters/helpers/process-aggregate.js +102 -0
- data/node_modules/axe-core/lib/core/reporters/na.js +20 -0
- data/node_modules/axe-core/lib/core/reporters/no-passes.js +18 -0
- data/node_modules/axe-core/lib/core/reporters/raw.js +8 -0
- data/node_modules/axe-core/lib/core/reporters/v1.js +26 -0
- data/node_modules/axe-core/lib/core/reporters/v2.js +22 -0
- data/node_modules/axe-core/lib/core/utils/aggregate.js +19 -0
- data/node_modules/axe-core/lib/core/utils/aggregateChecks.js +85 -0
- data/node_modules/axe-core/lib/core/utils/aggregateNodeResults.js +61 -0
- data/node_modules/axe-core/lib/core/utils/aggregateResult.js +37 -0
- data/node_modules/axe-core/lib/core/utils/are-styles-set.js +24 -0
- data/node_modules/axe-core/lib/core/utils/check-helper.js +38 -0
- data/node_modules/axe-core/lib/core/utils/clone.js +27 -0
- data/node_modules/axe-core/lib/core/utils/collect-results-from-frames.js +127 -0
- data/node_modules/axe-core/lib/core/utils/contains.js +30 -0
- data/node_modules/axe-core/lib/core/utils/css-parser.js +5 -0
- data/node_modules/axe-core/lib/core/utils/dq-element.js +97 -0
- data/node_modules/axe-core/lib/core/utils/element-matches.js +39 -0
- data/node_modules/axe-core/lib/core/utils/escape-selector.js +79 -0
- data/node_modules/axe-core/lib/core/utils/extend-meta-data.js +17 -0
- data/node_modules/axe-core/lib/core/utils/finalize-result.js +11 -0
- data/node_modules/axe-core/lib/core/utils/find-by.js +14 -0
- data/node_modules/axe-core/lib/core/utils/flattened-tree.js +170 -0
- data/node_modules/axe-core/lib/core/utils/get-all-checks.js +12 -0
- data/node_modules/axe-core/lib/core/utils/get-base-lang.js +16 -0
- data/node_modules/axe-core/lib/core/utils/get-check-option.js +40 -0
- data/node_modules/axe-core/lib/core/utils/get-friendly-uri-end.js +144 -0
- data/node_modules/axe-core/lib/core/utils/get-root-node.js +17 -0
- data/node_modules/axe-core/lib/core/utils/get-selector.js +406 -0
- data/node_modules/axe-core/lib/core/utils/get-xpath.js +84 -0
- data/node_modules/axe-core/lib/core/utils/index.js +10 -0
- data/node_modules/axe-core/lib/core/utils/inject-style.js +38 -0
- data/node_modules/axe-core/lib/core/utils/is-hidden.js +40 -0
- data/node_modules/axe-core/lib/core/utils/is-html-element.js +135 -0
- data/node_modules/axe-core/lib/core/utils/is-shadow-root.js +40 -0
- data/node_modules/axe-core/lib/core/utils/is-xhtml.js +14 -0
- data/node_modules/axe-core/lib/core/utils/merge-results.js +116 -0
- data/node_modules/axe-core/lib/core/utils/node-sorter.js +21 -0
- data/node_modules/axe-core/lib/core/utils/performance-timer.js +121 -0
- data/node_modules/axe-core/lib/core/utils/pollyfills.js +299 -0
- data/node_modules/axe-core/lib/core/utils/preload-cssom.js +456 -0
- data/node_modules/axe-core/lib/core/utils/preload.js +109 -0
- data/node_modules/axe-core/lib/core/utils/publish-metadata.js +93 -0
- data/node_modules/axe-core/lib/core/utils/qsa.js +322 -0
- data/node_modules/axe-core/lib/core/utils/queue.js +138 -0
- data/node_modules/axe-core/lib/core/utils/respondable.js +243 -0
- data/node_modules/axe-core/lib/core/utils/rule-should-run.js +83 -0
- data/node_modules/axe-core/lib/core/utils/scroll-state.js +70 -0
- data/node_modules/axe-core/lib/core/utils/select.js +146 -0
- data/node_modules/axe-core/lib/core/utils/to-array.js +21 -0
- data/node_modules/axe-core/lib/core/utils/token-list.js +15 -0
- data/node_modules/axe-core/lib/core/utils/uuid.js +242 -0
- data/node_modules/axe-core/lib/core/utils/valid-input-type.js +35 -0
- data/node_modules/axe-core/lib/core/utils/valid-langs.js +8152 -0
- data/node_modules/axe-core/lib/intro.stub +15 -0
- data/node_modules/axe-core/lib/misc/any-failure-summary.json +6 -0
- data/node_modules/axe-core/lib/misc/incomplete-fallback.json +3 -0
- data/node_modules/axe-core/lib/misc/none-failure-summary.json +6 -0
- data/node_modules/axe-core/lib/outro.stub +2 -0
- data/node_modules/axe-core/lib/rules/accesskeys.json +13 -0
- data/node_modules/axe-core/lib/rules/area-alt.json +19 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-attr-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-role-matches.js +7 -0
- data/node_modules/axe-core/lib/rules/aria-allowed-role.json +14 -0
- data/node_modules/axe-core/lib/rules/aria-dpub-role-fallback-matches.js +10 -0
- data/node_modules/axe-core/lib/rules/aria-dpub-role-fallback.json +13 -0
- data/node_modules/axe-core/lib/rules/aria-has-attr-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/aria-hidden-body.json +13 -0
- data/node_modules/axe-core/lib/rules/aria-hidden-focus-matches.js +18 -0
- data/node_modules/axe-core/lib/rules/aria-hidden-focus.json +14 -0
- data/node_modules/axe-core/lib/rules/aria-required-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-required-children.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-required-parent.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-roles.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-valid-attr-value.json +12 -0
- data/node_modules/axe-core/lib/rules/aria-valid-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/audio-caption.json +20 -0
- data/node_modules/axe-core/lib/rules/autocomplete-matches.js +45 -0
- data/node_modules/axe-core/lib/rules/autocomplete-valid.json +12 -0
- data/node_modules/axe-core/lib/rules/blink.json +19 -0
- data/node_modules/axe-core/lib/rules/button-name.json +27 -0
- data/node_modules/axe-core/lib/rules/bypass-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/bypass.json +20 -0
- data/node_modules/axe-core/lib/rules/checkboxgroup.json +12 -0
- data/node_modules/axe-core/lib/rules/color-contrast-matches.js +120 -0
- data/node_modules/axe-core/lib/rules/color-contrast.json +16 -0
- data/node_modules/axe-core/lib/rules/css-orientation-lock.json +13 -0
- data/node_modules/axe-core/lib/rules/data-table-large-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/data-table-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/definition-list.json +13 -0
- data/node_modules/axe-core/lib/rules/dlitem.json +13 -0
- data/node_modules/axe-core/lib/rules/document-title.json +13 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-active-matches.js +8 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-active.json +14 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-aria-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-aria.json +14 -0
- data/node_modules/axe-core/lib/rules/duplicate-id-misc-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/duplicate-id.json +14 -0
- data/node_modules/axe-core/lib/rules/empty-heading.json +13 -0
- data/node_modules/axe-core/lib/rules/focus-order-semantics.json +13 -0
- data/node_modules/axe-core/lib/rules/form-field-multiple-labels.json +13 -0
- data/node_modules/axe-core/lib/rules/frame-tested.json +12 -0
- data/node_modules/axe-core/lib/rules/frame-title-has-text.js +2 -0
- data/node_modules/axe-core/lib/rules/frame-title-unique.json +13 -0
- data/node_modules/axe-core/lib/rules/frame-title.json +25 -0
- data/node_modules/axe-core/lib/rules/heading-matches.js +15 -0
- data/node_modules/axe-core/lib/rules/heading-order.json +13 -0
- data/node_modules/axe-core/lib/rules/hidden-content.json +13 -0
- data/node_modules/axe-core/lib/rules/html-has-lang.json +12 -0
- data/node_modules/axe-core/lib/rules/html-lang-valid.json +12 -0
- data/node_modules/axe-core/lib/rules/html-xml-lang-mismatch.json +13 -0
- data/node_modules/axe-core/lib/rules/image-alt.json +25 -0
- data/node_modules/axe-core/lib/rules/img-redundant-alt.json +12 -0
- data/node_modules/axe-core/lib/rules/input-image-alt.json +18 -0
- data/node_modules/axe-core/lib/rules/inserted-into-focus-order-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/label-content-name-mismatch-matches.js +42 -0
- data/node_modules/axe-core/lib/rules/label-content-name-mismatch.json +12 -0
- data/node_modules/axe-core/lib/rules/label-matches.js +11 -0
- data/node_modules/axe-core/lib/rules/label-title-only.json +13 -0
- data/node_modules/axe-core/lib/rules/label.json +26 -0
- data/node_modules/axe-core/lib/rules/landmark-banner-is-top-level.json +13 -0
- data/node_modules/axe-core/lib/rules/landmark-complementary-is-top-level.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-contentinfo-is-top-level.json +13 -0
- data/node_modules/axe-core/lib/rules/landmark-has-body-context.js +8 -0
- data/node_modules/axe-core/lib/rules/landmark-main-is-top-level.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-banner.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-contentinfo.json +12 -0
- data/node_modules/axe-core/lib/rules/landmark-one-main.json +12 -0
- data/node_modules/axe-core/lib/rules/layout-table-matches.js +8 -0
- data/node_modules/axe-core/lib/rules/layout-table.json +13 -0
- data/node_modules/axe-core/lib/rules/link-in-text-block-matches.js +14 -0
- data/node_modules/axe-core/lib/rules/link-in-text-block.json +14 -0
- data/node_modules/axe-core/lib/rules/link-name.json +26 -0
- data/node_modules/axe-core/lib/rules/list.json +13 -0
- data/node_modules/axe-core/lib/rules/listitem.json +13 -0
- data/node_modules/axe-core/lib/rules/marquee.json +13 -0
- data/node_modules/axe-core/lib/rules/meta-refresh.json +13 -0
- data/node_modules/axe-core/lib/rules/meta-viewport-large.json +13 -0
- data/node_modules/axe-core/lib/rules/meta-viewport.json +13 -0
- data/node_modules/axe-core/lib/rules/no-role-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/not-html-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/object-alt.json +25 -0
- data/node_modules/axe-core/lib/rules/p-as-heading-matches.js +17 -0
- data/node_modules/axe-core/lib/rules/p-as-heading.json +13 -0
- data/node_modules/axe-core/lib/rules/page-has-heading-one.json +12 -0
- data/node_modules/axe-core/lib/rules/radiogroup.json +12 -0
- data/node_modules/axe-core/lib/rules/region.json +13 -0
- data/node_modules/axe-core/lib/rules/role-not-button-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/scope-attr-valid.json +12 -0
- data/node_modules/axe-core/lib/rules/server-side-image-map.json +18 -0
- data/node_modules/axe-core/lib/rules/skip-link-matches.js +1 -0
- data/node_modules/axe-core/lib/rules/skip-link.json +13 -0
- data/node_modules/axe-core/lib/rules/tabindex.json +12 -0
- data/node_modules/axe-core/lib/rules/table-duplicate-name.json +12 -0
- data/node_modules/axe-core/lib/rules/table-fake-caption.json +20 -0
- data/node_modules/axe-core/lib/rules/td-has-header.json +20 -0
- data/node_modules/axe-core/lib/rules/td-headers-attr.json +12 -0
- data/node_modules/axe-core/lib/rules/th-has-data-cells.json +13 -0
- data/node_modules/axe-core/lib/rules/valid-lang.json +13 -0
- data/node_modules/axe-core/lib/rules/video-caption.json +19 -0
- data/node_modules/axe-core/lib/rules/video-description.json +19 -0
- data/node_modules/axe-core/lib/rules/window-is-top.js +3 -0
- data/node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js +12 -0
- data/node_modules/axe-core/locales/de.json +627 -0
- data/node_modules/axe-core/locales/fr.json +667 -0
- data/node_modules/axe-core/locales/ja.json +728 -0
- data/node_modules/axe-core/locales/nl.json +36 -0
- data/node_modules/axe-core/package.json +215 -0
- data/node_modules/axe-core/sri-history.json +138 -0
- data/node_modules/axe-core/typings/axe-core/axe-core-tests.ts +180 -0
- metadata +511 -1
@@ -0,0 +1,70 @@
|
|
1
|
+
/**
|
2
|
+
* Return the scroll position of scrollable elements
|
3
|
+
*/
|
4
|
+
function getScroll(elm) {
|
5
|
+
const style = window.getComputedStyle(elm);
|
6
|
+
const visibleOverflowY = style.getPropertyValue('overflow-y') === 'visible';
|
7
|
+
const visibleOverflowX = style.getPropertyValue('overflow-x') === 'visible';
|
8
|
+
|
9
|
+
if (
|
10
|
+
// See if the element hides overflowing content
|
11
|
+
(!visibleOverflowY && elm.scrollHeight > elm.clientHeight) ||
|
12
|
+
(!visibleOverflowX && elm.scrollWidth > elm.clientWidth)
|
13
|
+
) {
|
14
|
+
return { elm, top: elm.scrollTop, left: elm.scrollLeft };
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* set the scroll position of an element
|
20
|
+
*/
|
21
|
+
function setScroll(elm, top, left) {
|
22
|
+
if (elm === window) {
|
23
|
+
return elm.scroll(top, left);
|
24
|
+
} else {
|
25
|
+
elm.scrollTop = top;
|
26
|
+
elm.scrollLeft = left;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Create an array scroll positions from descending elements
|
32
|
+
*/
|
33
|
+
function getElmScrollRecursive(root) {
|
34
|
+
return Array.from(root.children).reduce((scrolls, elm) => {
|
35
|
+
const scroll = getScroll(elm);
|
36
|
+
if (scroll) {
|
37
|
+
scrolls.push(scroll);
|
38
|
+
}
|
39
|
+
return scrolls.concat(getElmScrollRecursive(elm));
|
40
|
+
}, []);
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Get the scroll position of all scrollable elements in a page
|
45
|
+
*/
|
46
|
+
axe.utils.getScrollState = function getScrollState(win = window) {
|
47
|
+
const root = win.document.documentElement;
|
48
|
+
const windowScroll = [
|
49
|
+
win.pageXOffset !== undefined
|
50
|
+
? {
|
51
|
+
elm: win,
|
52
|
+
top: win.pageYOffset,
|
53
|
+
left: win.pageXOffset
|
54
|
+
}
|
55
|
+
: {
|
56
|
+
elm: root,
|
57
|
+
top: root.scrollTop,
|
58
|
+
left: root.scrollLeft
|
59
|
+
}
|
60
|
+
];
|
61
|
+
|
62
|
+
return windowScroll.concat(getElmScrollRecursive(document.body));
|
63
|
+
};
|
64
|
+
|
65
|
+
/**
|
66
|
+
* set the scroll position of all items in the scrollState array
|
67
|
+
*/
|
68
|
+
axe.utils.setScrollState = function setScrollState(scrollState) {
|
69
|
+
scrollState.forEach(({ elm, top, left }) => setScroll(elm, top, left));
|
70
|
+
};
|
@@ -0,0 +1,146 @@
|
|
1
|
+
/**
|
2
|
+
* Get the deepest node in a given collection
|
3
|
+
* @private
|
4
|
+
* @param {Array} collection Array of nodes to test
|
5
|
+
* @return {Node} The deepest node
|
6
|
+
*/
|
7
|
+
function getDeepest(collection) {
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
return collection.sort(function(a, b) {
|
11
|
+
if (axe.utils.contains(a, b)) {
|
12
|
+
return 1;
|
13
|
+
}
|
14
|
+
return -1;
|
15
|
+
})[0];
|
16
|
+
}
|
17
|
+
|
18
|
+
/**
|
19
|
+
* Determines if a node is included or excluded in a given context
|
20
|
+
* @private
|
21
|
+
* @param {Node} node The node to test
|
22
|
+
* @param {Object} context "Resolved" context object, @see resolveContext
|
23
|
+
* @return {Boolean} [description]
|
24
|
+
*/
|
25
|
+
function isNodeInContext(node, context) {
|
26
|
+
'use strict';
|
27
|
+
|
28
|
+
var include =
|
29
|
+
context.include &&
|
30
|
+
getDeepest(
|
31
|
+
context.include.filter(function(candidate) {
|
32
|
+
return axe.utils.contains(candidate, node);
|
33
|
+
})
|
34
|
+
);
|
35
|
+
var exclude =
|
36
|
+
context.exclude &&
|
37
|
+
getDeepest(
|
38
|
+
context.exclude.filter(function(candidate) {
|
39
|
+
return axe.utils.contains(candidate, node);
|
40
|
+
})
|
41
|
+
);
|
42
|
+
if (
|
43
|
+
(!exclude && include) ||
|
44
|
+
(exclude && axe.utils.contains(exclude, include))
|
45
|
+
) {
|
46
|
+
return true;
|
47
|
+
}
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Pushes unique nodes that are in context to an array
|
53
|
+
* @private
|
54
|
+
* @param {Array} result The array to push to
|
55
|
+
* @param {Array} nodes The list of nodes to push
|
56
|
+
* @param {Object} context The "resolved" context object, @see resolveContext
|
57
|
+
*/
|
58
|
+
function pushNode(result, nodes) {
|
59
|
+
'use strict';
|
60
|
+
|
61
|
+
var temp;
|
62
|
+
|
63
|
+
if (result.length === 0) {
|
64
|
+
return nodes;
|
65
|
+
}
|
66
|
+
if (result.length < nodes.length) {
|
67
|
+
// switch so the comparison is shortest
|
68
|
+
temp = result;
|
69
|
+
result = nodes;
|
70
|
+
nodes = temp;
|
71
|
+
}
|
72
|
+
for (var i = 0, l = nodes.length; i < l; i++) {
|
73
|
+
if (!result.includes(nodes[i])) {
|
74
|
+
result.push(nodes[i]);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
return result;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* reduces the includes list to only the outermost includes
|
82
|
+
* @param {Array} the array of include nodes
|
83
|
+
* @return {Array} the modified array of nodes
|
84
|
+
*/
|
85
|
+
function reduceIncludes(includes) {
|
86
|
+
return includes.reduce((res, el) => {
|
87
|
+
if (
|
88
|
+
!res.length ||
|
89
|
+
!res[res.length - 1].actualNode.contains(el.actualNode)
|
90
|
+
) {
|
91
|
+
res.push(el);
|
92
|
+
}
|
93
|
+
return res;
|
94
|
+
}, []);
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Selects elements which match `selector` that are included and excluded via the `Context` object
|
99
|
+
* @param {String} selector CSS selector of the HTMLElements to select
|
100
|
+
* @param {Context} context The "resolved" context object, @see Context
|
101
|
+
* @return {Array} Matching virtual DOM nodes sorted by DOM order
|
102
|
+
*/
|
103
|
+
/*eslint max-statements:["error", 20]*/
|
104
|
+
axe.utils.select = function select(selector, context) {
|
105
|
+
'use strict';
|
106
|
+
|
107
|
+
var result = [],
|
108
|
+
candidate;
|
109
|
+
if (axe._selectCache) {
|
110
|
+
// if used outside of run, it will still work
|
111
|
+
for (var j = 0, l = axe._selectCache.length; j < l; j++) {
|
112
|
+
// First see whether the item exists in the cache
|
113
|
+
let item = axe._selectCache[j];
|
114
|
+
if (item.selector === selector) {
|
115
|
+
return item.result;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
var curried = (function(context) {
|
120
|
+
return function(node) {
|
121
|
+
return isNodeInContext(node, context);
|
122
|
+
};
|
123
|
+
})(context);
|
124
|
+
var reducedIncludes = reduceIncludes(context.include);
|
125
|
+
for (var i = 0; i < reducedIncludes.length; i++) {
|
126
|
+
candidate = reducedIncludes[i];
|
127
|
+
if (
|
128
|
+
candidate.actualNode.nodeType === candidate.actualNode.ELEMENT_NODE &&
|
129
|
+
axe.utils.matchesSelector(candidate.actualNode, selector) &&
|
130
|
+
curried(candidate)
|
131
|
+
) {
|
132
|
+
result = pushNode(result, [candidate]);
|
133
|
+
}
|
134
|
+
result = pushNode(
|
135
|
+
result,
|
136
|
+
axe.utils.querySelectorAllFilter(candidate, selector, curried)
|
137
|
+
);
|
138
|
+
}
|
139
|
+
if (axe._selectCache) {
|
140
|
+
axe._selectCache.push({
|
141
|
+
selector: selector,
|
142
|
+
result: result
|
143
|
+
});
|
144
|
+
}
|
145
|
+
return result;
|
146
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* Converts array-like (numerical indicies and `length` property) structures to actual, real arrays
|
3
|
+
* @param {Mixed} thing Array-like thing to convert
|
4
|
+
* @return {Array}
|
5
|
+
*/
|
6
|
+
axe.utils.toArray = function(thing) {
|
7
|
+
'use strict';
|
8
|
+
return Array.prototype.slice.call(thing);
|
9
|
+
};
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Creates an array without duplicate values from 2 array inputs
|
13
|
+
* @param {Array} arr1 First array
|
14
|
+
* @param {Array} arr2 Second array
|
15
|
+
* @return {Array}
|
16
|
+
*/
|
17
|
+
axe.utils.uniqueArray = (arr1, arr2) => {
|
18
|
+
return arr1.concat(arr2).filter((elem, pos, arr) => {
|
19
|
+
return arr.indexOf(elem) === pos;
|
20
|
+
});
|
21
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* Converts space delimited token list to an Array
|
3
|
+
* @method tokenList
|
4
|
+
* @memberof axe.utils
|
5
|
+
* @param {String} str
|
6
|
+
* @return {Array}
|
7
|
+
*/
|
8
|
+
axe.utils.tokenList = function(str) {
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
return str
|
12
|
+
.trim()
|
13
|
+
.replace(/\s{2,}/g, ' ')
|
14
|
+
.split(' ');
|
15
|
+
};
|
@@ -0,0 +1,242 @@
|
|
1
|
+
/*eslint no-bitwise: 0, eqeqeq: 0, curly: 0, strict: 0, no-eq-null: 0,
|
2
|
+
max-statements: 0, complexity: 0, no-shadow: 0, no-undef: 0 */
|
3
|
+
// uuid.js
|
4
|
+
//
|
5
|
+
// Copyright (c) 2010-2012 Robert Kieffer
|
6
|
+
// MIT License - http://opensource.org/licenses/mit-license.php
|
7
|
+
var uuid;
|
8
|
+
(function(_global) {
|
9
|
+
// Unique ID creation requires a high quality random # generator. We feature
|
10
|
+
// detect to determine the best RNG source, normalizing to a function that
|
11
|
+
// returns 128-bits of randomness, since that's what's usually required
|
12
|
+
var _rng;
|
13
|
+
|
14
|
+
// Allow for MSIE11 msCrypto
|
15
|
+
var _crypto = _global.crypto || _global.msCrypto;
|
16
|
+
|
17
|
+
if (!_rng && _crypto && _crypto.getRandomValues) {
|
18
|
+
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
|
19
|
+
//
|
20
|
+
// Moderately fast, high quality
|
21
|
+
var _rnds8 = new Uint8Array(16);
|
22
|
+
_rng = function whatwgRNG() {
|
23
|
+
_crypto.getRandomValues(_rnds8);
|
24
|
+
return _rnds8;
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
if (!_rng) {
|
29
|
+
// Math.random()-based (RNG)
|
30
|
+
//
|
31
|
+
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
32
|
+
// quality.
|
33
|
+
var _rnds = new Array(16);
|
34
|
+
_rng = function() {
|
35
|
+
for (var i = 0, r; i < 16; i++) {
|
36
|
+
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
37
|
+
_rnds[i] = (r >>> ((i & 0x03) << 3)) & 0xff;
|
38
|
+
}
|
39
|
+
|
40
|
+
return _rnds;
|
41
|
+
};
|
42
|
+
}
|
43
|
+
|
44
|
+
// Buffer class to use
|
45
|
+
var BufferClass =
|
46
|
+
typeof _global.Buffer == 'function' ? _global.Buffer : Array;
|
47
|
+
|
48
|
+
// Maps for number <-> hex string conversion
|
49
|
+
var _byteToHex = [];
|
50
|
+
var _hexToByte = {};
|
51
|
+
for (var i = 0; i < 256; i++) {
|
52
|
+
_byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
53
|
+
_hexToByte[_byteToHex[i]] = i;
|
54
|
+
}
|
55
|
+
|
56
|
+
// **`parse()` - Parse a UUID into it's component bytes**
|
57
|
+
function parse(s, buf, offset) {
|
58
|
+
var i = (buf && offset) || 0,
|
59
|
+
ii = 0;
|
60
|
+
|
61
|
+
buf = buf || [];
|
62
|
+
s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
|
63
|
+
if (ii < 16) {
|
64
|
+
// Don't overflow!
|
65
|
+
buf[i + ii++] = _hexToByte[oct];
|
66
|
+
}
|
67
|
+
});
|
68
|
+
|
69
|
+
// Zero out remaining bytes if string was short
|
70
|
+
while (ii < 16) {
|
71
|
+
buf[i + ii++] = 0;
|
72
|
+
}
|
73
|
+
|
74
|
+
return buf;
|
75
|
+
}
|
76
|
+
|
77
|
+
// **`unparse()` - Convert UUID byte array (ala parse()) into a string**
|
78
|
+
function unparse(buf, offset) {
|
79
|
+
var i = offset || 0,
|
80
|
+
bth = _byteToHex;
|
81
|
+
return (
|
82
|
+
bth[buf[i++]] +
|
83
|
+
bth[buf[i++]] +
|
84
|
+
bth[buf[i++]] +
|
85
|
+
bth[buf[i++]] +
|
86
|
+
'-' +
|
87
|
+
bth[buf[i++]] +
|
88
|
+
bth[buf[i++]] +
|
89
|
+
'-' +
|
90
|
+
bth[buf[i++]] +
|
91
|
+
bth[buf[i++]] +
|
92
|
+
'-' +
|
93
|
+
bth[buf[i++]] +
|
94
|
+
bth[buf[i++]] +
|
95
|
+
'-' +
|
96
|
+
bth[buf[i++]] +
|
97
|
+
bth[buf[i++]] +
|
98
|
+
bth[buf[i++]] +
|
99
|
+
bth[buf[i++]] +
|
100
|
+
bth[buf[i++]] +
|
101
|
+
bth[buf[i++]]
|
102
|
+
);
|
103
|
+
}
|
104
|
+
|
105
|
+
// **`v1()` - Generate time-based UUID**
|
106
|
+
//
|
107
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
108
|
+
// and http://docs.python.org/library/uuid.html
|
109
|
+
|
110
|
+
// random #'s we need to init node and clockseq
|
111
|
+
var _seedBytes = _rng();
|
112
|
+
|
113
|
+
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
114
|
+
var _nodeId = [
|
115
|
+
_seedBytes[0] | 0x01,
|
116
|
+
_seedBytes[1],
|
117
|
+
_seedBytes[2],
|
118
|
+
_seedBytes[3],
|
119
|
+
_seedBytes[4],
|
120
|
+
_seedBytes[5]
|
121
|
+
];
|
122
|
+
|
123
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
124
|
+
var _clockseq = ((_seedBytes[6] << 8) | _seedBytes[7]) & 0x3fff;
|
125
|
+
|
126
|
+
// Previous uuid creation time
|
127
|
+
var _lastMSecs = 0,
|
128
|
+
_lastNSecs = 0;
|
129
|
+
|
130
|
+
// See https://github.com/broofa/node-uuid for API details
|
131
|
+
function v1(options, buf, offset) {
|
132
|
+
var i = (buf && offset) || 0;
|
133
|
+
var b = buf || [];
|
134
|
+
|
135
|
+
options = options || {};
|
136
|
+
|
137
|
+
var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
|
138
|
+
|
139
|
+
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
140
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
141
|
+
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
142
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
143
|
+
var msecs = options.msecs != null ? options.msecs : new Date().getTime();
|
144
|
+
|
145
|
+
// Per 4.2.1.2, use count of uuid's generated during the current clock
|
146
|
+
// cycle to simulate higher resolution clock
|
147
|
+
var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
|
148
|
+
|
149
|
+
// Time since last uuid creation (in msecs)
|
150
|
+
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
|
151
|
+
|
152
|
+
// Per 4.2.1.2, Bump clockseq on clock regression
|
153
|
+
if (dt < 0 && options.clockseq == null) {
|
154
|
+
clockseq = (clockseq + 1) & 0x3fff;
|
155
|
+
}
|
156
|
+
|
157
|
+
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
158
|
+
// time interval
|
159
|
+
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
|
160
|
+
nsecs = 0;
|
161
|
+
}
|
162
|
+
|
163
|
+
// Per 4.2.1.2 Throw error if too many uuids are requested
|
164
|
+
if (nsecs >= 10000) {
|
165
|
+
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
166
|
+
}
|
167
|
+
|
168
|
+
_lastMSecs = msecs;
|
169
|
+
_lastNSecs = nsecs;
|
170
|
+
_clockseq = clockseq;
|
171
|
+
|
172
|
+
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
173
|
+
msecs += 12219292800000;
|
174
|
+
|
175
|
+
// `time_low`
|
176
|
+
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
177
|
+
b[i++] = (tl >>> 24) & 0xff;
|
178
|
+
b[i++] = (tl >>> 16) & 0xff;
|
179
|
+
b[i++] = (tl >>> 8) & 0xff;
|
180
|
+
b[i++] = tl & 0xff;
|
181
|
+
|
182
|
+
// `time_mid`
|
183
|
+
var tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff;
|
184
|
+
b[i++] = (tmh >>> 8) & 0xff;
|
185
|
+
b[i++] = tmh & 0xff;
|
186
|
+
|
187
|
+
// `time_high_and_version`
|
188
|
+
b[i++] = ((tmh >>> 24) & 0xf) | 0x10; // include version
|
189
|
+
b[i++] = (tmh >>> 16) & 0xff;
|
190
|
+
|
191
|
+
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
192
|
+
b[i++] = (clockseq >>> 8) | 0x80;
|
193
|
+
|
194
|
+
// `clock_seq_low`
|
195
|
+
b[i++] = clockseq & 0xff;
|
196
|
+
|
197
|
+
// `node`
|
198
|
+
var node = options.node || _nodeId;
|
199
|
+
for (var n = 0; n < 6; n++) {
|
200
|
+
b[i + n] = node[n];
|
201
|
+
}
|
202
|
+
|
203
|
+
return buf ? buf : unparse(b);
|
204
|
+
}
|
205
|
+
|
206
|
+
// **`v4()` - Generate random UUID**
|
207
|
+
|
208
|
+
// See https://github.com/broofa/node-uuid for API details
|
209
|
+
function v4(options, buf, offset) {
|
210
|
+
// Deprecated - 'format' argument, as supported in v1.2
|
211
|
+
var i = (buf && offset) || 0;
|
212
|
+
|
213
|
+
if (typeof options == 'string') {
|
214
|
+
buf = options == 'binary' ? new BufferClass(16) : null;
|
215
|
+
options = null;
|
216
|
+
}
|
217
|
+
options = options || {};
|
218
|
+
|
219
|
+
var rnds = options.random || (options.rng || _rng)();
|
220
|
+
|
221
|
+
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
222
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
223
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
224
|
+
|
225
|
+
// Copy bytes to buffer, if provided
|
226
|
+
if (buf) {
|
227
|
+
for (var ii = 0; ii < 16; ii++) {
|
228
|
+
buf[i + ii] = rnds[ii];
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
return buf || unparse(rnds);
|
233
|
+
}
|
234
|
+
|
235
|
+
// Export public API
|
236
|
+
uuid = v4;
|
237
|
+
uuid.v1 = v1;
|
238
|
+
uuid.v4 = v4;
|
239
|
+
uuid.parse = parse;
|
240
|
+
uuid.unparse = unparse;
|
241
|
+
uuid.BufferClass = BufferClass;
|
242
|
+
})(window);
|