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,37 @@
|
|
1
|
+
/* exported matches */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Check if a DOM element matches a definition
|
5
|
+
*
|
6
|
+
* Example:
|
7
|
+
* ```js
|
8
|
+
* // Match a single nodeName:
|
9
|
+
* axe.commons.matches(elm, 'div')
|
10
|
+
*
|
11
|
+
* // Match one of multiple nodeNames:
|
12
|
+
* axe.commons.matches(elm, ['ul', 'ol'])
|
13
|
+
*
|
14
|
+
* // Match a node with nodeName 'button' and with aria-hidden: true:
|
15
|
+
* axe.commons.matches(elm, {
|
16
|
+
* nodeName: 'button',
|
17
|
+
* attributes: { 'aria-hidden': 'true' }
|
18
|
+
* })
|
19
|
+
*
|
20
|
+
* // Mixed input. Match button nodeName, input[type=button] and input[type=reset]
|
21
|
+
* axe.commons.matches(elm, ['button', {
|
22
|
+
* nodeName: 'input', // nodeName match isn't case sensitive
|
23
|
+
* properties: { type: ['button', 'reset'] }
|
24
|
+
* }])
|
25
|
+
* ```
|
26
|
+
*
|
27
|
+
* @namespace matches
|
28
|
+
* @memberof axe.commons
|
29
|
+
* @param {HTMLElement|VirtualNode} node node to verify attributes against constraints
|
30
|
+
* @param {Array<ElementDefinition>|String|Object|Function|Regex} definition
|
31
|
+
* @return {Boolean} true/ false based on if node passes the constraints expected
|
32
|
+
*/
|
33
|
+
function matches(node, definition) {
|
34
|
+
return matches.fromDefinition(node, definition);
|
35
|
+
}
|
36
|
+
|
37
|
+
commons.matches = matches;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/* global matches */
|
2
|
+
let isXHTMLGlobal;
|
3
|
+
/**
|
4
|
+
* Check if the nodeName of a node matches some value
|
5
|
+
*
|
6
|
+
* Note: matches.nodeName(node, matcher) can be indirectly used through
|
7
|
+
* matches(node, { nodeName: matcher })
|
8
|
+
*
|
9
|
+
* Example:
|
10
|
+
* ```js
|
11
|
+
* matches.nodeName(node, ['div', 'span'])
|
12
|
+
* ```
|
13
|
+
*
|
14
|
+
* @param {HTMLElement|VirtualNode} node
|
15
|
+
* @param {Object} Attribute matcher
|
16
|
+
* @returns {Boolean}
|
17
|
+
*/
|
18
|
+
matches.nodeName = function matchNodeName(node, matcher, { isXHTML } = {}) {
|
19
|
+
node = node.actualNode || node;
|
20
|
+
if (typeof isXHTML === 'undefined') {
|
21
|
+
// When the matcher is a string, use native .matches() function:
|
22
|
+
if (typeof matcher === 'string') {
|
23
|
+
return axe.utils.matchesSelector(node, matcher);
|
24
|
+
}
|
25
|
+
|
26
|
+
if (typeof isXHTMLGlobal === 'undefined') {
|
27
|
+
isXHTMLGlobal = axe.utils.isXHTML(node.ownerDocument);
|
28
|
+
}
|
29
|
+
isXHTML = isXHTMLGlobal;
|
30
|
+
}
|
31
|
+
|
32
|
+
const nodeName = isXHTML ? node.nodeName : node.nodeName.toLowerCase();
|
33
|
+
return matches.fromPrimative(nodeName, matcher);
|
34
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/* global matches */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Check if a node matches some attribute(s)
|
5
|
+
*
|
6
|
+
* Note: matches.properties(node, matcher) can be indirectly used through
|
7
|
+
* matches(node, { properties: matcher })
|
8
|
+
*
|
9
|
+
* Example:
|
10
|
+
* ```js
|
11
|
+
* matches.properties(node, {
|
12
|
+
* type: 'text', // Simple string match
|
13
|
+
* value: value => value.trim() !== '', // None-empty value, using a function matcher
|
14
|
+
* })
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* @param {HTMLElement|VirtualNode} node
|
18
|
+
* @param {Object} matcher
|
19
|
+
* @returns {Boolean}
|
20
|
+
*/
|
21
|
+
matches.properties = function matchesProperties(node, matcher) {
|
22
|
+
node = node.actualNode || node;
|
23
|
+
const out = matches.fromFunction(propName => node[propName], matcher);
|
24
|
+
return out;
|
25
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/* global table */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Returns all cells contained in given HTMLTableElement
|
5
|
+
* @method getAllCells
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableElement} tableElm Table Element to get cells from
|
9
|
+
* @return {Array<HTMLTableCellElement>}
|
10
|
+
*/
|
11
|
+
table.getAllCells = function(tableElm) {
|
12
|
+
var rowIndex, cellIndex, rowLength, cellLength;
|
13
|
+
var cells = [];
|
14
|
+
for (
|
15
|
+
rowIndex = 0, rowLength = tableElm.rows.length;
|
16
|
+
rowIndex < rowLength;
|
17
|
+
rowIndex++
|
18
|
+
) {
|
19
|
+
for (
|
20
|
+
cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length;
|
21
|
+
cellIndex < cellLength;
|
22
|
+
cellIndex++
|
23
|
+
) {
|
24
|
+
cells.push(tableElm.rows[rowIndex].cells[cellIndex]);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
return cells;
|
28
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/* global table, dom */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Get the x, y coordinates of a table cell; normalized for rowspan and colspan
|
5
|
+
* @method getCellPosition
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} cell The table cell of which to get the position
|
9
|
+
* @return {Object} Object with `x` and `y` properties of the coordinates
|
10
|
+
*/
|
11
|
+
table.getCellPosition = function(cell, tableGrid) {
|
12
|
+
var rowIndex, index;
|
13
|
+
if (!tableGrid) {
|
14
|
+
tableGrid = table.toGrid(dom.findUp(cell, 'table'));
|
15
|
+
}
|
16
|
+
|
17
|
+
for (rowIndex = 0; rowIndex < tableGrid.length; rowIndex++) {
|
18
|
+
if (tableGrid[rowIndex]) {
|
19
|
+
index = tableGrid[rowIndex].indexOf(cell);
|
20
|
+
if (index !== -1) {
|
21
|
+
return {
|
22
|
+
x: index,
|
23
|
+
y: rowIndex
|
24
|
+
};
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/* global table */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Get any associated table headers for a `HTMLTableCellElement`
|
5
|
+
* @method getHeaders
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} cell The cell of which to get headers
|
9
|
+
* @return {Array<HTMLTableCellElement>} Array of headers associated to the table cell
|
10
|
+
*/
|
11
|
+
table.getHeaders = function(cell) {
|
12
|
+
if (cell.hasAttribute('headers')) {
|
13
|
+
return commons.dom.idrefs(cell, 'headers');
|
14
|
+
}
|
15
|
+
|
16
|
+
var tableGrid = commons.table.toGrid(commons.dom.findUp(cell, 'table'));
|
17
|
+
var position = commons.table.getCellPosition(cell, tableGrid);
|
18
|
+
|
19
|
+
// TODO: RTL text
|
20
|
+
var rowHeaders = table
|
21
|
+
.traverse('left', position, tableGrid)
|
22
|
+
.filter(cell => table.isRowHeader(cell));
|
23
|
+
|
24
|
+
var colHeaders = table
|
25
|
+
.traverse('up', position, tableGrid)
|
26
|
+
.filter(cell => table.isColumnHeader(cell));
|
27
|
+
|
28
|
+
return [].concat(rowHeaders, colHeaders).reverse();
|
29
|
+
};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/* global table, dom */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Determine if a `HTMLTableCellElement` is a column header, if so get the scope of the header
|
5
|
+
* @method getScope
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} cell The table cell to test
|
9
|
+
* @return {Boolean|String} Returns `false` if not a column header, or the scope of the column header element
|
10
|
+
*/
|
11
|
+
table.getScope = function(cell) {
|
12
|
+
var scope = cell.getAttribute('scope');
|
13
|
+
var role = cell.getAttribute('role');
|
14
|
+
|
15
|
+
if (
|
16
|
+
cell instanceof Element === false ||
|
17
|
+
['TD', 'TH'].indexOf(cell.nodeName.toUpperCase()) === -1
|
18
|
+
) {
|
19
|
+
throw new TypeError('Expected TD or TH element');
|
20
|
+
}
|
21
|
+
|
22
|
+
if (role === 'columnheader') {
|
23
|
+
return 'col';
|
24
|
+
} else if (role === 'rowheader') {
|
25
|
+
return 'row';
|
26
|
+
} else if (scope === 'col' || scope === 'row') {
|
27
|
+
return scope;
|
28
|
+
} else if (cell.nodeName.toUpperCase() !== 'TH') {
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
var tableGrid = table.toGrid(dom.findUp(cell, 'table'));
|
32
|
+
var pos = table.getCellPosition(cell);
|
33
|
+
|
34
|
+
// The element is in a row with all th elements, that makes it a column header
|
35
|
+
var headerRow = tableGrid[pos.y].reduce((headerRow, cell) => {
|
36
|
+
return headerRow && cell.nodeName.toUpperCase() === 'TH';
|
37
|
+
}, true);
|
38
|
+
|
39
|
+
if (headerRow) {
|
40
|
+
return 'col';
|
41
|
+
}
|
42
|
+
|
43
|
+
// The element is in a column with all th elements, that makes it a row header
|
44
|
+
var headerCol = tableGrid
|
45
|
+
.map(col => col[pos.x])
|
46
|
+
.reduce((headerCol, cell) => {
|
47
|
+
return headerCol && cell && cell.nodeName.toUpperCase() === 'TH';
|
48
|
+
}, true);
|
49
|
+
|
50
|
+
if (headerCol) {
|
51
|
+
return 'row';
|
52
|
+
}
|
53
|
+
return 'auto';
|
54
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/* global table */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Determine if a `HTMLTableCellElement` is a column header
|
5
|
+
* @method isColumnHeader
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} element The table cell to test
|
9
|
+
* @return {Boolean}
|
10
|
+
*/
|
11
|
+
table.isColumnHeader = function(element) {
|
12
|
+
return ['col', 'auto'].indexOf(table.getScope(element)) !== -1;
|
13
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/* global table */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Determine if a `HTMLTableCellElement` is a data cell
|
5
|
+
* @method isDataCell
|
6
|
+
* @memberof axe.commons.table
|
7
|
+
* @instance
|
8
|
+
* @param {HTMLTableCellElement} node The table cell to test
|
9
|
+
* @return {Boolean}
|
10
|
+
*/
|
11
|
+
table.isDataCell = function(cell) {
|
12
|
+
// @see http://www.whatwg.org/specs/web-apps/current-work/multipage/tables.html#empty-cell
|
13
|
+
if (!cell.children.length && !cell.textContent.trim()) {
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
const role = cell.getAttribute('role');
|
17
|
+
if (axe.commons.aria.isValidRole(role)) {
|
18
|
+
return ['cell', 'gridcell'].includes(role);
|
19
|
+
} else {
|
20
|
+
return cell.nodeName.toUpperCase() === 'TD';
|
21
|
+
}
|
22
|
+
};
|
@@ -0,0 +1,190 @@
|
|
1
|
+
/* global table, dom */
|
2
|
+
/* eslint max-statements: ["error",70], complexity: ["error",47] */
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Determines whether a table is a data table
|
6
|
+
* @method isDataTable
|
7
|
+
* @memberof axe.commons.table
|
8
|
+
* @instance
|
9
|
+
* @param {HTMLTableElement} node The table to test
|
10
|
+
* @return {Boolean}
|
11
|
+
* @see http://asurkov.blogspot.co.uk/2011/10/data-vs-layout-table.html
|
12
|
+
*/
|
13
|
+
table.isDataTable = function(node) {
|
14
|
+
var role = (node.getAttribute('role') || '').toLowerCase();
|
15
|
+
|
16
|
+
// The element is not focusable and has role=presentation
|
17
|
+
if ((role === 'presentation' || role === 'none') && !dom.isFocusable(node)) {
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
|
21
|
+
// Table inside editable area is data table always since the table structure is crucial for table editing
|
22
|
+
if (
|
23
|
+
node.getAttribute('contenteditable') === 'true' ||
|
24
|
+
dom.findUp(node, '[contenteditable="true"]')
|
25
|
+
) {
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
|
29
|
+
// Table having ARIA table related role is data table
|
30
|
+
if (role === 'grid' || role === 'treegrid' || role === 'table') {
|
31
|
+
return true;
|
32
|
+
}
|
33
|
+
|
34
|
+
// Table having ARIA landmark role is data table
|
35
|
+
if (commons.aria.getRoleType(role) === 'landmark') {
|
36
|
+
return true;
|
37
|
+
}
|
38
|
+
|
39
|
+
// Table having datatable="0" attribute is layout table
|
40
|
+
if (node.getAttribute('datatable') === '0') {
|
41
|
+
return false;
|
42
|
+
}
|
43
|
+
|
44
|
+
// Table having summary attribute is data table
|
45
|
+
if (node.getAttribute('summary')) {
|
46
|
+
return true;
|
47
|
+
}
|
48
|
+
|
49
|
+
// Table having legitimate data table structures is data table
|
50
|
+
if (node.tHead || node.tFoot || node.caption) {
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
// colgroup / col - colgroup is magically generated
|
54
|
+
for (
|
55
|
+
var childIndex = 0, childLength = node.children.length;
|
56
|
+
childIndex < childLength;
|
57
|
+
childIndex++
|
58
|
+
) {
|
59
|
+
if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') {
|
60
|
+
return true;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
var cells = 0;
|
65
|
+
var rowLength = node.rows.length;
|
66
|
+
var row, cell;
|
67
|
+
var hasBorder = false;
|
68
|
+
for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) {
|
69
|
+
row = node.rows[rowIndex];
|
70
|
+
for (
|
71
|
+
var cellIndex = 0, cellLength = row.cells.length;
|
72
|
+
cellIndex < cellLength;
|
73
|
+
cellIndex++
|
74
|
+
) {
|
75
|
+
cell = row.cells[cellIndex];
|
76
|
+
if (cell.nodeName.toUpperCase() === 'TH') {
|
77
|
+
return true;
|
78
|
+
}
|
79
|
+
if (
|
80
|
+
!hasBorder &&
|
81
|
+
(cell.offsetWidth !== cell.clientWidth ||
|
82
|
+
cell.offsetHeight !== cell.clientHeight)
|
83
|
+
) {
|
84
|
+
hasBorder = true;
|
85
|
+
}
|
86
|
+
if (
|
87
|
+
cell.getAttribute('scope') ||
|
88
|
+
cell.getAttribute('headers') ||
|
89
|
+
cell.getAttribute('abbr')
|
90
|
+
) {
|
91
|
+
return true;
|
92
|
+
}
|
93
|
+
if (
|
94
|
+
['columnheader', 'rowheader'].includes(
|
95
|
+
(cell.getAttribute('role') || '').toLowerCase()
|
96
|
+
)
|
97
|
+
) {
|
98
|
+
return true;
|
99
|
+
}
|
100
|
+
// abbr element as a single child element of table cell
|
101
|
+
if (
|
102
|
+
cell.children.length === 1 &&
|
103
|
+
cell.children[0].nodeName.toUpperCase() === 'ABBR'
|
104
|
+
) {
|
105
|
+
return true;
|
106
|
+
}
|
107
|
+
cells++;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
// Table having nested table is layout table
|
112
|
+
if (node.getElementsByTagName('table').length) {
|
113
|
+
return false;
|
114
|
+
}
|
115
|
+
|
116
|
+
// Table having only one row or column is layout table (row)
|
117
|
+
if (rowLength < 2) {
|
118
|
+
return false;
|
119
|
+
}
|
120
|
+
|
121
|
+
// Table having only one row or column is layout table (column)
|
122
|
+
var sampleRow = node.rows[Math.ceil(rowLength / 2)];
|
123
|
+
if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) {
|
124
|
+
return false;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Table having many columns (>= 5) is data table
|
128
|
+
if (sampleRow.cells.length >= 5) {
|
129
|
+
return true;
|
130
|
+
}
|
131
|
+
|
132
|
+
// Table having borders around cells is data table
|
133
|
+
if (hasBorder) {
|
134
|
+
return true;
|
135
|
+
}
|
136
|
+
|
137
|
+
// Table having differently colored rows is data table
|
138
|
+
var bgColor, bgImage;
|
139
|
+
for (rowIndex = 0; rowIndex < rowLength; rowIndex++) {
|
140
|
+
row = node.rows[rowIndex];
|
141
|
+
if (
|
142
|
+
bgColor &&
|
143
|
+
bgColor !==
|
144
|
+
window.getComputedStyle(row).getPropertyValue('background-color')
|
145
|
+
) {
|
146
|
+
return true;
|
147
|
+
} else {
|
148
|
+
bgColor = window
|
149
|
+
.getComputedStyle(row)
|
150
|
+
.getPropertyValue('background-color');
|
151
|
+
}
|
152
|
+
if (
|
153
|
+
bgImage &&
|
154
|
+
bgImage !==
|
155
|
+
window.getComputedStyle(row).getPropertyValue('background-image')
|
156
|
+
) {
|
157
|
+
return true;
|
158
|
+
} else {
|
159
|
+
bgImage = window
|
160
|
+
.getComputedStyle(row)
|
161
|
+
.getPropertyValue('background-image');
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
// Table having many rows (>= 20) is data table
|
166
|
+
if (rowLength >= 20) {
|
167
|
+
return true;
|
168
|
+
}
|
169
|
+
|
170
|
+
// Wide table (more than 95% of the document width) is layout table
|
171
|
+
if (
|
172
|
+
dom.getElementCoordinates(node).width >
|
173
|
+
dom.getViewportSize(window).width * 0.95
|
174
|
+
) {
|
175
|
+
return false;
|
176
|
+
}
|
177
|
+
|
178
|
+
// Table having small amount of cells (<= 10) is layout table
|
179
|
+
if (cells < 10) {
|
180
|
+
return false;
|
181
|
+
}
|
182
|
+
|
183
|
+
// Table containing embed, object, applet of iframe elements (typical advertisements elements) is layout table
|
184
|
+
if (node.querySelector('object, embed, iframe, applet')) {
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
|
188
|
+
// Otherwise it's data table
|
189
|
+
return true;
|
190
|
+
};
|