govuk_publishing_components 30.4.1 → 30.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +20 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +63 -51
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +8 -8
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +11 -10
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +27 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +2 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +2 -4
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +28 -27
- data/config/locales/en.yml +8 -8
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/README.md +83 -53
- data/node_modules/axe-core/axe.d.ts +403 -224
- data/node_modules/axe-core/axe.js +23281 -21919
- data/node_modules/axe-core/axe.min.js +3 -3
- data/node_modules/axe-core/locales/da.json +795 -780
- data/node_modules/axe-core/locales/de.json +932 -621
- data/node_modules/axe-core/locales/es.json +786 -771
- data/node_modules/axe-core/locales/eu.json +787 -0
- data/node_modules/axe-core/locales/fr.json +982 -840
- data/node_modules/axe-core/locales/ja.json +988 -880
- data/node_modules/axe-core/locales/ko.json +999 -775
- data/node_modules/axe-core/locales/nl.json +46 -34
- data/node_modules/axe-core/locales/pl.json +965 -0
- data/node_modules/axe-core/locales/pt_BR.json +966 -880
- data/node_modules/axe-core/package.json +189 -145
- data/node_modules/axe-core/sri-history.json +312 -192
- data/node_modules/govuk-frontend/govuk/all.js +64 -44
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +3 -13
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +12 -12
- data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +5 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/details/details.js +8 -20
- data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/details/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +9 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +59 -20
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +40 -0
- data/node_modules/govuk-frontend/govuk/components/footer/template.njk +17 -7
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +14 -21
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +11 -11
- data/node_modules/govuk-frontend/govuk/components/header/header.js +53 -11
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +9 -10
- data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/inset-text/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/panel/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +6 -0
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +15 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +37 -10
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +69 -4
- data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +3 -3
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +13 -13
- data/node_modules/govuk-frontend/govuk/components/tabs/template.njk +5 -1
- data/node_modules/govuk-frontend/govuk/helpers/_typography.scss +14 -7
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +56 -12
- data/node_modules/govuk-frontend/govuk/settings/_spacing.scss +4 -8
- data/node_modules/govuk-frontend/govuk/template.njk +5 -5
- data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +3 -13
- data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +8 -20
- data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +53 -11
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +7 -584
- data/node_modules/axe-core/CHANGELOG.md +0 -1053
- data/node_modules/axe-core/CONTRIBUTING.md +0 -187
- data/node_modules/axe-core/bower.json +0 -40
- data/node_modules/axe-core/doc/API.md +0 -889
- data/node_modules/axe-core/doc/accessibility-supported.md +0 -33
- data/node_modules/axe-core/doc/act-rules-format.md +0 -37
- data/node_modules/axe-core/doc/aria-supported.md +0 -13
- data/node_modules/axe-core/doc/backwards-compatibility-doc.md +0 -94
- data/node_modules/axe-core/doc/check-message-template.md +0 -124
- data/node_modules/axe-core/doc/code-submission-guidelines.md +0 -178
- data/node_modules/axe-core/doc/developer-guide.md +0 -514
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/README.md +0 -13
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/axe-cdp.js +0 -81
- data/node_modules/axe-core/doc/examples/chrome-debugging-protocol/package.json +0 -11
- data/node_modules/axe-core/doc/examples/html-handlebars.md +0 -164
- data/node_modules/axe-core/doc/examples/jasmine/README.md +0 -35
- data/node_modules/axe-core/doc/examples/jasmine/karma.conf.js +0 -29
- data/node_modules/axe-core/doc/examples/jasmine/package.json +0 -21
- data/node_modules/axe-core/doc/examples/jasmine/spec/a11y.js +0 -36
- data/node_modules/axe-core/doc/examples/jest_react/README.md +0 -41
- data/node_modules/axe-core/doc/examples/jest_react/link.js +0 -7
- data/node_modules/axe-core/doc/examples/jest_react/link.test.js +0 -24
- data/node_modules/axe-core/doc/examples/jest_react/package.json +0 -28
- data/node_modules/axe-core/doc/examples/jest_react/test-helpers.js +0 -21
- data/node_modules/axe-core/doc/examples/jsdom/package.json +0 -15
- data/node_modules/axe-core/doc/examples/mocha/README.md +0 -35
- data/node_modules/axe-core/doc/examples/mocha/karma.conf.js +0 -29
- data/node_modules/axe-core/doc/examples/mocha/package.json +0 -22
- data/node_modules/axe-core/doc/examples/phantomjs/README.md +0 -17
- data/node_modules/axe-core/doc/examples/phantomjs/axe-phantom.js +0 -53
- data/node_modules/axe-core/doc/examples/phantomjs/package.json +0 -19
- data/node_modules/axe-core/doc/examples/puppeteer/README.md +0 -12
- data/node_modules/axe-core/doc/examples/puppeteer/axe-puppeteer.js +0 -60
- data/node_modules/axe-core/doc/examples/puppeteer/package.json +0 -13
- data/node_modules/axe-core/doc/examples/qunit/README.md +0 -37
- data/node_modules/axe-core/doc/examples/qunit/package.json +0 -21
- data/node_modules/axe-core/doc/examples/test-examples.js +0 -32
- data/node_modules/axe-core/doc/plugins.md +0 -123
- data/node_modules/axe-core/doc/projects.md +0 -48
- data/node_modules/axe-core/doc/rule-descriptions.md +0 -129
- data/node_modules/axe-core/doc/rule-development.md +0 -123
- data/node_modules/axe-core/doc/rule-proposal.md +0 -106
- data/node_modules/axe-core/lib/checks/aria/abstractrole.js +0 -10
- data/node_modules/axe-core/lib/checks/aria/abstractrole.json +0 -14
- data/node_modules/axe-core/lib/checks/aria/allowed-attr.js +0 -39
- data/node_modules/axe-core/lib/checks/aria/allowed-attr.json +0 -14
- data/node_modules/axe-core/lib/checks/aria/aria-allowed-role.js +0 -28
- data/node_modules/axe-core/lib/checks/aria/aria-allowed-role.json +0 -22
- data/node_modules/axe-core/lib/checks/aria/aria-hidden-body.js +0 -1
- data/node_modules/axe-core/lib/checks/aria/aria-hidden-body.json +0 -11
- data/node_modules/axe-core/lib/checks/aria/aria-roledescription.js +0 -14
- data/node_modules/axe-core/lib/checks/aria/aria-roledescription.json +0 -23
- data/node_modules/axe-core/lib/checks/aria/errormessage.js +0 -33
- data/node_modules/axe-core/lib/checks/aria/errormessage.json +0 -14
- data/node_modules/axe-core/lib/checks/aria/fallbackrole.js +0 -1
- data/node_modules/axe-core/lib/checks/aria/fallbackrole.json +0 -11
- data/node_modules/axe-core/lib/checks/aria/has-widget-role.js +0 -6
- data/node_modules/axe-core/lib/checks/aria/has-widget-role.json +0 -12
- data/node_modules/axe-core/lib/checks/aria/implicit-role-fallback.js +0 -6
- data/node_modules/axe-core/lib/checks/aria/implicit-role-fallback.json +0 -12
- data/node_modules/axe-core/lib/checks/aria/invalidrole.js +0 -17
- data/node_modules/axe-core/lib/checks/aria/invalidrole.json +0 -14
- data/node_modules/axe-core/lib/checks/aria/no-implicit-explicit-label.js +0 -21
- data/node_modules/axe-core/lib/checks/aria/no-implicit-explicit-label.json +0 -11
- data/node_modules/axe-core/lib/checks/aria/required-attr.js +0 -53
- data/node_modules/axe-core/lib/checks/aria/required-attr.json +0 -14
- data/node_modules/axe-core/lib/checks/aria/required-children.js +0 -154
- data/node_modules/axe-core/lib/checks/aria/required-children.json +0 -32
- data/node_modules/axe-core/lib/checks/aria/required-parent.js +0 -87
- data/node_modules/axe-core/lib/checks/aria/required-parent.json +0 -14
- data/node_modules/axe-core/lib/checks/aria/unsupportedattr.js +0 -39
- data/node_modules/axe-core/lib/checks/aria/unsupportedattr.json +0 -11
- data/node_modules/axe-core/lib/checks/aria/unsupportedrole.js +0 -1
- data/node_modules/axe-core/lib/checks/aria/unsupportedrole.json +0 -11
- data/node_modules/axe-core/lib/checks/aria/valid-attr-value.js +0 -80
- data/node_modules/axe-core/lib/checks/aria/valid-attr-value.json +0 -19
- data/node_modules/axe-core/lib/checks/aria/valid-attr.js +0 -25
- data/node_modules/axe-core/lib/checks/aria/valid-attr.json +0 -15
- data/node_modules/axe-core/lib/checks/aria/valid-scrollable-semantics.js +0 -62
- data/node_modules/axe-core/lib/checks/aria/valid-scrollable-semantics.json +0 -12
- data/node_modules/axe-core/lib/checks/color/color-contrast.js +0 -86
- data/node_modules/axe-core/lib/checks/color/color-contrast.json +0 -30
- data/node_modules/axe-core/lib/checks/color/link-in-text-block.js +0 -85
- data/node_modules/axe-core/lib/checks/color/link-in-text-block.json +0 -19
- data/node_modules/axe-core/lib/checks/forms/autocomplete-appropriate.js +0 -67
- data/node_modules/axe-core/lib/checks/forms/autocomplete-appropriate.json +0 -11
- data/node_modules/axe-core/lib/checks/forms/autocomplete-valid.js +0 -2
- data/node_modules/axe-core/lib/checks/forms/autocomplete-valid.json +0 -11
- data/node_modules/axe-core/lib/checks/forms/fieldset-after.js +0 -25
- data/node_modules/axe-core/lib/checks/forms/fieldset.js +0 -109
- data/node_modules/axe-core/lib/checks/forms/fieldset.json +0 -20
- data/node_modules/axe-core/lib/checks/forms/group-labelledby-after.js +0 -16
- data/node_modules/axe-core/lib/checks/forms/group-labelledby.js +0 -66
- data/node_modules/axe-core/lib/checks/forms/group-labelledby.json +0 -17
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys-after.js +0 -19
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys.js +0 -5
- data/node_modules/axe-core/lib/checks/keyboard/accesskeys.json +0 -12
- data/node_modules/axe-core/lib/checks/keyboard/focusable-content.js +0 -16
- data/node_modules/axe-core/lib/checks/keyboard/focusable-content.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/focusable-disabled.js +0 -30
- data/node_modules/axe-core/lib/checks/keyboard/focusable-disabled.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/focusable-element.js +0 -12
- data/node_modules/axe-core/lib/checks/keyboard/focusable-element.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/focusable-modal-open.js +0 -14
- data/node_modules/axe-core/lib/checks/keyboard/focusable-modal-open.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/focusable-no-name.js +0 -6
- data/node_modules/axe-core/lib/checks/keyboard/focusable-no-name.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/focusable-not-tabbable.js +0 -30
- data/node_modules/axe-core/lib/checks/keyboard/focusable-not-tabbable.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/landmark-is-top-level.js +0 -18
- data/node_modules/axe-core/lib/checks/keyboard/landmark-is-top-level.json +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/page-has-elm-after.js +0 -11
- data/node_modules/axe-core/lib/checks/keyboard/page-has-elm.js +0 -13
- data/node_modules/axe-core/lib/checks/keyboard/page-has-heading-one.json +0 -15
- data/node_modules/axe-core/lib/checks/keyboard/page-has-main.json +0 -15
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-after.js +0 -2
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-banner.json +0 -16
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-contentinfo.json +0 -16
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate-main.json +0 -15
- data/node_modules/axe-core/lib/checks/keyboard/page-no-duplicate.js +0 -36
- data/node_modules/axe-core/lib/checks/keyboard/tabindex.js +0 -6
- data/node_modules/axe-core/lib/checks/keyboard/tabindex.json +0 -11
- data/node_modules/axe-core/lib/checks/label/alt-space-value.js +0 -3
- data/node_modules/axe-core/lib/checks/label/alt-space-value.json +0 -11
- data/node_modules/axe-core/lib/checks/label/duplicate-img-label.js +0 -22
- data/node_modules/axe-core/lib/checks/label/duplicate-img-label.json +0 -11
- data/node_modules/axe-core/lib/checks/label/explicit.js +0 -15
- data/node_modules/axe-core/lib/checks/label/explicit.json +0 -11
- data/node_modules/axe-core/lib/checks/label/help-same-as-label.js +0 -23
- data/node_modules/axe-core/lib/checks/label/help-same-as-label.json +0 -12
- data/node_modules/axe-core/lib/checks/label/hidden-explicit-label.js +0 -12
- data/node_modules/axe-core/lib/checks/label/hidden-explicit-label.json +0 -11
- data/node_modules/axe-core/lib/checks/label/implicit.js +0 -7
- data/node_modules/axe-core/lib/checks/label/implicit.json +0 -11
- data/node_modules/axe-core/lib/checks/label/label-content-name-mismatch.js +0 -59
- data/node_modules/axe-core/lib/checks/label/label-content-name-mismatch.json +0 -15
- data/node_modules/axe-core/lib/checks/label/multiple-label.js +0 -39
- data/node_modules/axe-core/lib/checks/label/multiple-label.json +0 -11
- data/node_modules/axe-core/lib/checks/label/title-only.js +0 -5
- data/node_modules/axe-core/lib/checks/label/title-only.json +0 -11
- data/node_modules/axe-core/lib/checks/landmarks/landmark-is-unique-after.js +0 -23
- data/node_modules/axe-core/lib/checks/landmarks/landmark-is-unique.js +0 -7
- data/node_modules/axe-core/lib/checks/landmarks/landmark-is-unique.json +0 -12
- data/node_modules/axe-core/lib/checks/language/has-lang.js +0 -20
- data/node_modules/axe-core/lib/checks/language/has-lang.json +0 -14
- data/node_modules/axe-core/lib/checks/language/valid-lang.js +0 -26
- data/node_modules/axe-core/lib/checks/language/valid-lang.json +0 -11
- data/node_modules/axe-core/lib/checks/language/xml-lang-mismatch.js +0 -5
- data/node_modules/axe-core/lib/checks/language/xml-lang-mismatch.json +0 -11
- data/node_modules/axe-core/lib/checks/lists/dlitem.js +0 -23
- data/node_modules/axe-core/lib/checks/lists/dlitem.json +0 -11
- data/node_modules/axe-core/lib/checks/lists/listitem.js +0 -21
- data/node_modules/axe-core/lib/checks/lists/listitem.json +0 -14
- data/node_modules/axe-core/lib/checks/lists/only-dlitems.js +0 -42
- data/node_modules/axe-core/lib/checks/lists/only-dlitems.json +0 -11
- data/node_modules/axe-core/lib/checks/lists/only-listitems.js +0 -58
- data/node_modules/axe-core/lib/checks/lists/only-listitems.json +0 -14
- data/node_modules/axe-core/lib/checks/lists/structured-dlitems.js +0 -22
- data/node_modules/axe-core/lib/checks/lists/structured-dlitems.json +0 -11
- data/node_modules/axe-core/lib/checks/media/caption.js +0 -8
- data/node_modules/axe-core/lib/checks/media/caption.json +0 -11
- data/node_modules/axe-core/lib/checks/media/description.js +0 -8
- data/node_modules/axe-core/lib/checks/media/description.json +0 -11
- data/node_modules/axe-core/lib/checks/media/frame-tested.js +0 -28
- data/node_modules/axe-core/lib/checks/media/frame-tested.json +0 -15
- data/node_modules/axe-core/lib/checks/media/no-autoplay-audio.js +0 -93
- data/node_modules/axe-core/lib/checks/media/no-autoplay-audio.json +0 -15
- data/node_modules/axe-core/lib/checks/mobile/css-orientation-lock.js +0 -251
- data/node_modules/axe-core/lib/checks/mobile/css-orientation-lock.json +0 -15
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-large.json +0 -15
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport-scale.js +0 -55
- data/node_modules/axe-core/lib/checks/mobile/meta-viewport.json +0 -14
- data/node_modules/axe-core/lib/checks/navigation/header-present.js +0 -4
- data/node_modules/axe-core/lib/checks/navigation/header-present.json +0 -11
- data/node_modules/axe-core/lib/checks/navigation/heading-order-after.js +0 -14
- data/node_modules/axe-core/lib/checks/navigation/heading-order.js +0 -15
- data/node_modules/axe-core/lib/checks/navigation/heading-order.json +0 -12
- data/node_modules/axe-core/lib/checks/navigation/identical-links-same-purpose-after.js +0 -100
- data/node_modules/axe-core/lib/checks/navigation/identical-links-same-purpose.js +0 -31
- data/node_modules/axe-core/lib/checks/navigation/identical-links-same-purpose.json +0 -12
- data/node_modules/axe-core/lib/checks/navigation/internal-link-present.js +0 -4
- data/node_modules/axe-core/lib/checks/navigation/internal-link-present.json +0 -11
- data/node_modules/axe-core/lib/checks/navigation/landmark.js +0 -3
- data/node_modules/axe-core/lib/checks/navigation/landmark.json +0 -11
- data/node_modules/axe-core/lib/checks/navigation/meta-refresh.js +0 -4
- data/node_modules/axe-core/lib/checks/navigation/meta-refresh.json +0 -11
- data/node_modules/axe-core/lib/checks/navigation/p-as-heading.js +0 -93
- data/node_modules/axe-core/lib/checks/navigation/p-as-heading.json +0 -30
- data/node_modules/axe-core/lib/checks/navigation/region.js +0 -107
- data/node_modules/axe-core/lib/checks/navigation/region.json +0 -11
- data/node_modules/axe-core/lib/checks/navigation/skip-link.js +0 -5
- data/node_modules/axe-core/lib/checks/navigation/skip-link.json +0 -12
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title-after.js +0 -9
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title.js +0 -6
- data/node_modules/axe-core/lib/checks/navigation/unique-frame-title.json +0 -12
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-active.json +0 -12
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-after.js +0 -8
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id-aria.json +0 -12
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id.js +0 -17
- data/node_modules/axe-core/lib/checks/parsing/duplicate-id.json +0 -12
- data/node_modules/axe-core/lib/checks/shared/aria-label.js +0 -2
- data/node_modules/axe-core/lib/checks/shared/aria-label.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/aria-labelledby.js +0 -2
- data/node_modules/axe-core/lib/checks/shared/aria-labelledby.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/avoid-inline-spacing.js +0 -18
- data/node_modules/axe-core/lib/checks/shared/avoid-inline-spacing.json +0 -14
- data/node_modules/axe-core/lib/checks/shared/button-has-visible-text.js +0 -12
- data/node_modules/axe-core/lib/checks/shared/button-has-visible-text.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/doc-has-title.js +0 -2
- data/node_modules/axe-core/lib/checks/shared/doc-has-title.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/exists.js +0 -1
- data/node_modules/axe-core/lib/checks/shared/exists.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/has-alt.js +0 -6
- data/node_modules/axe-core/lib/checks/shared/has-alt.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/has-visible-text.js +0 -1
- data/node_modules/axe-core/lib/checks/shared/has-visible-text.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/is-on-screen.js +0 -4
- data/node_modules/axe-core/lib/checks/shared/is-on-screen.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/non-empty-alt.js +0 -2
- data/node_modules/axe-core/lib/checks/shared/non-empty-alt.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/non-empty-if-present.js +0 -15
- data/node_modules/axe-core/lib/checks/shared/non-empty-if-present.json +0 -14
- data/node_modules/axe-core/lib/checks/shared/non-empty-title.js +0 -2
- data/node_modules/axe-core/lib/checks/shared/non-empty-title.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/non-empty-value.js +0 -2
- data/node_modules/axe-core/lib/checks/shared/non-empty-value.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/role-none.js +0 -1
- data/node_modules/axe-core/lib/checks/shared/role-none.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/role-presentation.js +0 -1
- data/node_modules/axe-core/lib/checks/shared/role-presentation.json +0 -11
- data/node_modules/axe-core/lib/checks/shared/svg-non-empty-title.js +0 -4
- data/node_modules/axe-core/lib/checks/shared/svg-non-empty-title.json +0 -11
- data/node_modules/axe-core/lib/checks/tables/caption-faked.js +0 -10
- data/node_modules/axe-core/lib/checks/tables/caption-faked.json +0 -11
- data/node_modules/axe-core/lib/checks/tables/has-caption.js +0 -1
- data/node_modules/axe-core/lib/checks/tables/has-caption.json +0 -12
- data/node_modules/axe-core/lib/checks/tables/has-summary.js +0 -1
- data/node_modules/axe-core/lib/checks/tables/has-summary.json +0 -12
- data/node_modules/axe-core/lib/checks/tables/has-th.js +0 -31
- data/node_modules/axe-core/lib/checks/tables/has-th.json +0 -12
- data/node_modules/axe-core/lib/checks/tables/headers-visible-text.js +0 -30
- data/node_modules/axe-core/lib/checks/tables/html5-scope.js +0 -5
- data/node_modules/axe-core/lib/checks/tables/html5-scope.json +0 -11
- data/node_modules/axe-core/lib/checks/tables/same-caption-summary.js +0 -7
- data/node_modules/axe-core/lib/checks/tables/same-caption-summary.json +0 -11
- data/node_modules/axe-core/lib/checks/tables/scope-value.js +0 -5
- data/node_modules/axe-core/lib/checks/tables/scope-value.json +0 -11
- data/node_modules/axe-core/lib/checks/tables/td-has-header.js +0 -30
- data/node_modules/axe-core/lib/checks/tables/td-has-header.json +0 -11
- data/node_modules/axe-core/lib/checks/tables/td-headers-attr.js +0 -61
- data/node_modules/axe-core/lib/checks/tables/td-headers-attr.json +0 -12
- data/node_modules/axe-core/lib/checks/tables/th-has-data-cells.js +0 -76
- data/node_modules/axe-core/lib/checks/tables/th-has-data-cells.json +0 -12
- data/node_modules/axe-core/lib/checks/tables/th-single-row-column.js +0 -39
- data/node_modules/axe-core/lib/checks/visibility/hidden-content.js +0 -21
- data/node_modules/axe-core/lib/checks/visibility/hidden-content.json +0 -12
- data/node_modules/axe-core/lib/commons/aria/arialabel-text.js +0 -18
- data/node_modules/axe-core/lib/commons/aria/arialabelledby-text.js +0 -52
- data/node_modules/axe-core/lib/commons/aria/attributes.js +0 -45
- data/node_modules/axe-core/lib/commons/aria/get-element-unallowed-roles.js +0 -113
- data/node_modules/axe-core/lib/commons/aria/get-owned-virtual.js +0 -24
- data/node_modules/axe-core/lib/commons/aria/get-role.js +0 -44
- data/node_modules/axe-core/lib/commons/aria/index.js +0 -2424
- data/node_modules/axe-core/lib/commons/aria/is-accessible-ref.js +0 -59
- data/node_modules/axe-core/lib/commons/aria/is-aria-role-allowed-on-element.js +0 -41
- data/node_modules/axe-core/lib/commons/aria/is-unsupported-role.js +0 -14
- data/node_modules/axe-core/lib/commons/aria/label-virtual.js +0 -54
- data/node_modules/axe-core/lib/commons/aria/named-from-contents.js +0 -39
- data/node_modules/axe-core/lib/commons/aria/roles.js +0 -208
- data/node_modules/axe-core/lib/commons/aria/validate-attr-value.js +0 -62
- data/node_modules/axe-core/lib/commons/color/center-point-of-rect.js +0 -30
- data/node_modules/axe-core/lib/commons/color/contrast.js +0 -178
- data/node_modules/axe-core/lib/commons/color/element-has-image.js +0 -36
- data/node_modules/axe-core/lib/commons/color/element-is-distinct.js +0 -88
- data/node_modules/axe-core/lib/commons/color/get-background-color.js +0 -285
- data/node_modules/axe-core/lib/commons/color/get-foreground-color.js +0 -61
- data/node_modules/axe-core/lib/commons/color/get-own-background-color.js +0 -22
- data/node_modules/axe-core/lib/commons/color/incomplete-data.js +0 -50
- data/node_modules/axe-core/lib/commons/color/index.js +0 -8
- data/node_modules/axe-core/lib/commons/dom/elements-below-floating.js +0 -39
- data/node_modules/axe-core/lib/commons/dom/find-elms-in-context.js +0 -28
- data/node_modules/axe-core/lib/commons/dom/find-up.js +0 -63
- data/node_modules/axe-core/lib/commons/dom/get-composed-parent.js +0 -25
- data/node_modules/axe-core/lib/commons/dom/get-element-by-reference.js +0 -34
- data/node_modules/axe-core/lib/commons/dom/get-element-coordinates.js +0 -38
- data/node_modules/axe-core/lib/commons/dom/get-element-stack.js +0 -589
- data/node_modules/axe-core/lib/commons/dom/get-root-node.js +0 -12
- data/node_modules/axe-core/lib/commons/dom/get-scroll-offset.js +0 -33
- data/node_modules/axe-core/lib/commons/dom/get-tabbable-elements.js +0 -24
- data/node_modules/axe-core/lib/commons/dom/get-viewport-size.js +0 -37
- data/node_modules/axe-core/lib/commons/dom/has-content-virtual.js +0 -75
- data/node_modules/axe-core/lib/commons/dom/idrefs.js +0 -36
- data/node_modules/axe-core/lib/commons/dom/index.js +0 -9
- data/node_modules/axe-core/lib/commons/dom/is-focusable.js +0 -95
- data/node_modules/axe-core/lib/commons/dom/is-hidden-with-css.js +0 -73
- data/node_modules/axe-core/lib/commons/dom/is-html5.js +0 -17
- data/node_modules/axe-core/lib/commons/dom/is-in-text-block.js +0 -94
- data/node_modules/axe-core/lib/commons/dom/is-modal-open.js +0 -98
- data/node_modules/axe-core/lib/commons/dom/is-node.js +0 -13
- data/node_modules/axe-core/lib/commons/dom/is-offscreen.js +0 -62
- data/node_modules/axe-core/lib/commons/dom/is-skip-link.js +0 -45
- data/node_modules/axe-core/lib/commons/dom/is-visible.js +0 -176
- data/node_modules/axe-core/lib/commons/dom/is-visual-content.js +0 -49
- data/node_modules/axe-core/lib/commons/dom/shadow-elements-from-point.js +0 -42
- data/node_modules/axe-core/lib/commons/dom/url-props-from-attribute.js +0 -152
- data/node_modules/axe-core/lib/commons/dom/visually-contains.js +0 -111
- data/node_modules/axe-core/lib/commons/dom/visually-overlaps.js +0 -46
- data/node_modules/axe-core/lib/commons/forms/index.js +0 -8
- data/node_modules/axe-core/lib/commons/forms/is-aria-combobox.js +0 -13
- data/node_modules/axe-core/lib/commons/forms/is-aria-listbox.js +0 -13
- data/node_modules/axe-core/lib/commons/forms/is-aria-range.js +0 -14
- data/node_modules/axe-core/lib/commons/forms/is-aria-textbox.js +0 -13
- data/node_modules/axe-core/lib/commons/forms/is-native-select.js +0 -13
- data/node_modules/axe-core/lib/commons/forms/is-native-textbox.js +0 -28
- data/node_modules/axe-core/lib/commons/index.js +0 -11
- data/node_modules/axe-core/lib/commons/intro.stub +0 -1
- data/node_modules/axe-core/lib/commons/matches/attributes.js +0 -27
- data/node_modules/axe-core/lib/commons/matches/condition.js +0 -19
- data/node_modules/axe-core/lib/commons/matches/from-definition.js +0 -52
- data/node_modules/axe-core/lib/commons/matches/from-function.js +0 -38
- data/node_modules/axe-core/lib/commons/matches/from-primative.js +0 -30
- data/node_modules/axe-core/lib/commons/matches/index.js +0 -39
- data/node_modules/axe-core/lib/commons/matches/node-name.js +0 -24
- data/node_modules/axe-core/lib/commons/matches/properties.js +0 -28
- data/node_modules/axe-core/lib/commons/outro.stub +0 -2
- data/node_modules/axe-core/lib/commons/table/get-all-cells.js +0 -28
- data/node_modules/axe-core/lib/commons/table/get-cell-position.js +0 -28
- data/node_modules/axe-core/lib/commons/table/get-headers.js +0 -79
- data/node_modules/axe-core/lib/commons/table/get-scope.js +0 -54
- data/node_modules/axe-core/lib/commons/table/index.js +0 -9
- data/node_modules/axe-core/lib/commons/table/is-column-header.js +0 -13
- data/node_modules/axe-core/lib/commons/table/is-data-cell.js +0 -22
- data/node_modules/axe-core/lib/commons/table/is-data-table.js +0 -189
- data/node_modules/axe-core/lib/commons/table/is-header.js +0 -22
- data/node_modules/axe-core/lib/commons/table/is-row-header.js +0 -13
- data/node_modules/axe-core/lib/commons/table/to-grid.js +0 -38
- data/node_modules/axe-core/lib/commons/table/traverse.js +0 -78
- data/node_modules/axe-core/lib/commons/text/accessible-text-virtual.js +0 -152
- data/node_modules/axe-core/lib/commons/text/form-control-value.js +0 -192
- data/node_modules/axe-core/lib/commons/text/index.js +0 -8
- data/node_modules/axe-core/lib/commons/text/is-human-interpretable.js +0 -51
- data/node_modules/axe-core/lib/commons/text/is-icon-ligature.js +0 -210
- data/node_modules/axe-core/lib/commons/text/is-valid-autocomplete.js +0 -117
- data/node_modules/axe-core/lib/commons/text/label-text.js +0 -58
- data/node_modules/axe-core/lib/commons/text/label-virtual.js +0 -53
- data/node_modules/axe-core/lib/commons/text/native-element-types.js +0 -100
- data/node_modules/axe-core/lib/commons/text/native-text-alternative.js +0 -50
- data/node_modules/axe-core/lib/commons/text/native-text-methods.js +0 -122
- data/node_modules/axe-core/lib/commons/text/sanitize.js +0 -18
- data/node_modules/axe-core/lib/commons/text/subtree-text.js +0 -89
- data/node_modules/axe-core/lib/commons/text/title-text.js +0 -33
- data/node_modules/axe-core/lib/commons/text/unicode.js +0 -147
- data/node_modules/axe-core/lib/commons/text/unsupported.js +0 -5
- data/node_modules/axe-core/lib/commons/text/visible-text-nodes.js +0 -25
- data/node_modules/axe-core/lib/commons/text/visible-virtual.js +0 -46
- data/node_modules/axe-core/lib/commons/utils/index.js +0 -10
- data/node_modules/axe-core/lib/core/base/audit.js +0 -781
- data/node_modules/axe-core/lib/core/base/cache.js +0 -33
- data/node_modules/axe-core/lib/core/base/check-result.js +0 -33
- data/node_modules/axe-core/lib/core/base/check.js +0 -170
- data/node_modules/axe-core/lib/core/base/context.js +0 -274
- data/node_modules/axe-core/lib/core/base/rule-result.js +0 -39
- data/node_modules/axe-core/lib/core/base/rule.js +0 -560
- data/node_modules/axe-core/lib/core/base/virtual-node/abstract-virtual-node.js +0 -40
- data/node_modules/axe-core/lib/core/base/virtual-node/serial-virtual-node.js +0 -88
- data/node_modules/axe-core/lib/core/base/virtual-node/virtual-node.js +0 -136
- data/node_modules/axe-core/lib/core/constants.js +0 -76
- data/node_modules/axe-core/lib/core/imports/index.js +0 -51
- data/node_modules/axe-core/lib/core/index.js +0 -43
- data/node_modules/axe-core/lib/core/log.js +0 -12
- data/node_modules/axe-core/lib/core/public/cleanup-plugins.js +0 -53
- data/node_modules/axe-core/lib/core/public/configure.js +0 -110
- data/node_modules/axe-core/lib/core/public/get-rules.js +0 -29
- data/node_modules/axe-core/lib/core/public/load.js +0 -66
- data/node_modules/axe-core/lib/core/public/plugins.js +0 -47
- data/node_modules/axe-core/lib/core/public/reporter.js +0 -24
- data/node_modules/axe-core/lib/core/public/reset.js +0 -12
- data/node_modules/axe-core/lib/core/public/run-rules.js +0 -96
- data/node_modules/axe-core/lib/core/public/run-virtual-rule.js +0 -50
- data/node_modules/axe-core/lib/core/public/run.js +0 -159
- data/node_modules/axe-core/lib/core/reporters/helpers/failure-summary.js +0 -35
- data/node_modules/axe-core/lib/core/reporters/helpers/get-environment-data.js +0 -39
- data/node_modules/axe-core/lib/core/reporters/helpers/incomplete-fallback-msg.js +0 -13
- data/node_modules/axe-core/lib/core/reporters/helpers/index.js +0 -3
- data/node_modules/axe-core/lib/core/reporters/helpers/process-aggregate.js +0 -102
- data/node_modules/axe-core/lib/core/reporters/na.js +0 -24
- data/node_modules/axe-core/lib/core/reporters/no-passes.js +0 -18
- data/node_modules/axe-core/lib/core/reporters/raw-env.js +0 -12
- data/node_modules/axe-core/lib/core/reporters/raw.js +0 -32
- data/node_modules/axe-core/lib/core/reporters/v1.js +0 -29
- data/node_modules/axe-core/lib/core/reporters/v2.js +0 -22
- data/node_modules/axe-core/lib/core/utils/aggregate.js +0 -19
- data/node_modules/axe-core/lib/core/utils/aggregateChecks.js +0 -85
- data/node_modules/axe-core/lib/core/utils/aggregateNodeResults.js +0 -61
- data/node_modules/axe-core/lib/core/utils/aggregateResult.js +0 -37
- data/node_modules/axe-core/lib/core/utils/are-styles-set.js +0 -21
- data/node_modules/axe-core/lib/core/utils/assert.js +0 -12
- data/node_modules/axe-core/lib/core/utils/check-helper.js +0 -38
- data/node_modules/axe-core/lib/core/utils/clone.js +0 -27
- data/node_modules/axe-core/lib/core/utils/collect-results-from-frames.js +0 -127
- data/node_modules/axe-core/lib/core/utils/contains.js +0 -44
- data/node_modules/axe-core/lib/core/utils/css-parser.js +0 -7
- data/node_modules/axe-core/lib/core/utils/dq-element.js +0 -97
- data/node_modules/axe-core/lib/core/utils/element-matches.js +0 -43
- data/node_modules/axe-core/lib/core/utils/escape-selector.js +0 -78
- data/node_modules/axe-core/lib/core/utils/extend-meta-data.js +0 -17
- data/node_modules/axe-core/lib/core/utils/finalize-result.js +0 -11
- data/node_modules/axe-core/lib/core/utils/find-by.js +0 -14
- data/node_modules/axe-core/lib/core/utils/flattened-tree.js +0 -156
- data/node_modules/axe-core/lib/core/utils/get-all-checks.js +0 -12
- data/node_modules/axe-core/lib/core/utils/get-base-lang.js +0 -16
- data/node_modules/axe-core/lib/core/utils/get-check-message.js +0 -21
- data/node_modules/axe-core/lib/core/utils/get-check-option.js +0 -39
- data/node_modules/axe-core/lib/core/utils/get-friendly-uri-end.js +0 -144
- data/node_modules/axe-core/lib/core/utils/get-node-attributes.js +0 -21
- data/node_modules/axe-core/lib/core/utils/get-root-node.js +0 -17
- data/node_modules/axe-core/lib/core/utils/get-scroll.js +0 -39
- data/node_modules/axe-core/lib/core/utils/get-selector.js +0 -409
- data/node_modules/axe-core/lib/core/utils/get-stylesheet-factory.js +0 -51
- data/node_modules/axe-core/lib/core/utils/get-xpath.js +0 -83
- data/node_modules/axe-core/lib/core/utils/index.js +0 -10
- data/node_modules/axe-core/lib/core/utils/inject-style.js +0 -38
- data/node_modules/axe-core/lib/core/utils/is-hidden.js +0 -52
- data/node_modules/axe-core/lib/core/utils/is-html-element.js +0 -135
- data/node_modules/axe-core/lib/core/utils/is-shadow-root.js +0 -40
- data/node_modules/axe-core/lib/core/utils/is-xhtml.js +0 -14
- data/node_modules/axe-core/lib/core/utils/matches.js +0 -263
- data/node_modules/axe-core/lib/core/utils/memoize.js +0 -17
- data/node_modules/axe-core/lib/core/utils/merge-results.js +0 -116
- data/node_modules/axe-core/lib/core/utils/node-sorter.js +0 -21
- data/node_modules/axe-core/lib/core/utils/parse-crossorigin-stylesheet.js +0 -54
- data/node_modules/axe-core/lib/core/utils/parse-sameorigin-stylesheet.js +0 -96
- data/node_modules/axe-core/lib/core/utils/parse-stylesheet.js +0 -70
- data/node_modules/axe-core/lib/core/utils/performance-timer.js +0 -126
- data/node_modules/axe-core/lib/core/utils/pollyfills.js +0 -299
- data/node_modules/axe-core/lib/core/utils/preload-cssom.js +0 -253
- data/node_modules/axe-core/lib/core/utils/preload-media.js +0 -65
- data/node_modules/axe-core/lib/core/utils/preload.js +0 -144
- data/node_modules/axe-core/lib/core/utils/process-message.js +0 -72
- data/node_modules/axe-core/lib/core/utils/publish-metadata.js +0 -106
- data/node_modules/axe-core/lib/core/utils/qsa.js +0 -110
- data/node_modules/axe-core/lib/core/utils/queue.js +0 -138
- data/node_modules/axe-core/lib/core/utils/respondable.js +0 -261
- data/node_modules/axe-core/lib/core/utils/rule-should-run.js +0 -82
- data/node_modules/axe-core/lib/core/utils/scroll-state.js +0 -57
- data/node_modules/axe-core/lib/core/utils/select.js +0 -135
- data/node_modules/axe-core/lib/core/utils/to-array.js +0 -21
- data/node_modules/axe-core/lib/core/utils/token-list.js +0 -15
- data/node_modules/axe-core/lib/core/utils/uuid.js +0 -244
- data/node_modules/axe-core/lib/core/utils/valid-input-type.js +0 -35
- data/node_modules/axe-core/lib/core/utils/valid-langs.js +0 -8152
- data/node_modules/axe-core/lib/intro.stub +0 -15
- data/node_modules/axe-core/lib/misc/any-failure-summary.json +0 -6
- data/node_modules/axe-core/lib/misc/incomplete-fallback.json +0 -3
- data/node_modules/axe-core/lib/misc/none-failure-summary.json +0 -6
- data/node_modules/axe-core/lib/outro.stub +0 -2
- data/node_modules/axe-core/lib/rules/accesskeys.json +0 -13
- data/node_modules/axe-core/lib/rules/area-alt.json +0 -21
- data/node_modules/axe-core/lib/rules/aria-allowed-attr-matches.js +0 -11
- data/node_modules/axe-core/lib/rules/aria-allowed-attr.json +0 -12
- data/node_modules/axe-core/lib/rules/aria-allowed-role-matches.js +0 -7
- data/node_modules/axe-core/lib/rules/aria-allowed-role.json +0 -14
- data/node_modules/axe-core/lib/rules/aria-dpub-role-fallback-matches.js +0 -10
- data/node_modules/axe-core/lib/rules/aria-dpub-role-fallback.json +0 -14
- data/node_modules/axe-core/lib/rules/aria-form-field-name-matches.js +0 -50
- data/node_modules/axe-core/lib/rules/aria-has-attr-matches.js +0 -11
- data/node_modules/axe-core/lib/rules/aria-hidden-body.json +0 -13
- data/node_modules/axe-core/lib/rules/aria-hidden-focus-matches.js +0 -18
- data/node_modules/axe-core/lib/rules/aria-hidden-focus.json +0 -18
- data/node_modules/axe-core/lib/rules/aria-input-field-name.json +0 -13
- data/node_modules/axe-core/lib/rules/aria-required-attr.json +0 -12
- data/node_modules/axe-core/lib/rules/aria-required-children.json +0 -12
- data/node_modules/axe-core/lib/rules/aria-required-parent.json +0 -12
- data/node_modules/axe-core/lib/rules/aria-roledescription.json +0 -12
- data/node_modules/axe-core/lib/rules/aria-roles.json +0 -13
- data/node_modules/axe-core/lib/rules/aria-toggle-field-name.json +0 -18
- data/node_modules/axe-core/lib/rules/aria-valid-attr-value.json +0 -12
- data/node_modules/axe-core/lib/rules/aria-valid-attr.json +0 -12
- data/node_modules/axe-core/lib/rules/audio-caption.json +0 -20
- data/node_modules/axe-core/lib/rules/autocomplete-matches.js +0 -49
- data/node_modules/axe-core/lib/rules/autocomplete-valid.json +0 -12
- data/node_modules/axe-core/lib/rules/avoid-inline-spacing.json +0 -12
- data/node_modules/axe-core/lib/rules/blink.json +0 -19
- data/node_modules/axe-core/lib/rules/button-name.json +0 -25
- data/node_modules/axe-core/lib/rules/bypass-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/bypass.json +0 -20
- data/node_modules/axe-core/lib/rules/checkboxgroup.json +0 -13
- data/node_modules/axe-core/lib/rules/color-contrast-matches.js +0 -161
- data/node_modules/axe-core/lib/rules/color-contrast.json +0 -13
- data/node_modules/axe-core/lib/rules/css-orientation-lock.json +0 -13
- data/node_modules/axe-core/lib/rules/data-table-large-matches.js +0 -11
- data/node_modules/axe-core/lib/rules/data-table-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/definition-list.json +0 -13
- data/node_modules/axe-core/lib/rules/dlitem.json +0 -13
- data/node_modules/axe-core/lib/rules/document-title.json +0 -13
- data/node_modules/axe-core/lib/rules/duplicate-id-active-matches.js +0 -8
- data/node_modules/axe-core/lib/rules/duplicate-id-active.json +0 -14
- data/node_modules/axe-core/lib/rules/duplicate-id-aria-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/duplicate-id-aria.json +0 -14
- data/node_modules/axe-core/lib/rules/duplicate-id-misc-matches.js +0 -11
- data/node_modules/axe-core/lib/rules/duplicate-id.json +0 -14
- data/node_modules/axe-core/lib/rules/empty-heading.json +0 -13
- data/node_modules/axe-core/lib/rules/focus-order-semantics.json +0 -13
- data/node_modules/axe-core/lib/rules/form-field-multiple-labels.json +0 -13
- data/node_modules/axe-core/lib/rules/frame-tested.json +0 -12
- data/node_modules/axe-core/lib/rules/frame-title-has-text.js +0 -2
- data/node_modules/axe-core/lib/rules/frame-title-unique.json +0 -13
- data/node_modules/axe-core/lib/rules/frame-title.json +0 -25
- data/node_modules/axe-core/lib/rules/heading-matches.js +0 -15
- data/node_modules/axe-core/lib/rules/heading-order.json +0 -13
- data/node_modules/axe-core/lib/rules/hidden-content.json +0 -13
- data/node_modules/axe-core/lib/rules/html-has-lang.json +0 -13
- data/node_modules/axe-core/lib/rules/html-lang-valid.json +0 -12
- data/node_modules/axe-core/lib/rules/html-namespace-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/html-xml-lang-mismatch.json +0 -13
- data/node_modules/axe-core/lib/rules/identical-links-same-purpose-matches.js +0 -13
- data/node_modules/axe-core/lib/rules/identical-links-same-purpose.json +0 -14
- data/node_modules/axe-core/lib/rules/image-alt.json +0 -25
- data/node_modules/axe-core/lib/rules/img-redundant-alt.json +0 -12
- data/node_modules/axe-core/lib/rules/input-button-name.json +0 -26
- data/node_modules/axe-core/lib/rules/input-image-alt.json +0 -18
- data/node_modules/axe-core/lib/rules/inserted-into-focus-order-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/label-content-name-mismatch-matches.js +0 -45
- data/node_modules/axe-core/lib/rules/label-content-name-mismatch.json +0 -12
- data/node_modules/axe-core/lib/rules/label-matches.js +0 -11
- data/node_modules/axe-core/lib/rules/label-title-only.json +0 -13
- data/node_modules/axe-core/lib/rules/label.json +0 -26
- data/node_modules/axe-core/lib/rules/landmark-banner-is-top-level.json +0 -13
- data/node_modules/axe-core/lib/rules/landmark-complementary-is-top-level.json +0 -12
- data/node_modules/axe-core/lib/rules/landmark-contentinfo-is-top-level.json +0 -13
- data/node_modules/axe-core/lib/rules/landmark-has-body-context.js +0 -8
- data/node_modules/axe-core/lib/rules/landmark-main-is-top-level.json +0 -12
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-banner.json +0 -12
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-contentinfo.json +0 -12
- data/node_modules/axe-core/lib/rules/landmark-no-duplicate-main.json +0 -12
- data/node_modules/axe-core/lib/rules/landmark-one-main.json +0 -12
- data/node_modules/axe-core/lib/rules/landmark-unique-matches.js +0 -41
- data/node_modules/axe-core/lib/rules/landmark-unique.json +0 -13
- data/node_modules/axe-core/lib/rules/layout-table-matches.js +0 -8
- data/node_modules/axe-core/lib/rules/layout-table.json +0 -14
- data/node_modules/axe-core/lib/rules/link-in-text-block-matches.js +0 -14
- data/node_modules/axe-core/lib/rules/link-in-text-block.json +0 -14
- data/node_modules/axe-core/lib/rules/link-name.json +0 -25
- data/node_modules/axe-core/lib/rules/list.json +0 -13
- data/node_modules/axe-core/lib/rules/listitem.json +0 -13
- data/node_modules/axe-core/lib/rules/marquee.json +0 -13
- data/node_modules/axe-core/lib/rules/meta-refresh.json +0 -20
- data/node_modules/axe-core/lib/rules/meta-viewport-large.json +0 -13
- data/node_modules/axe-core/lib/rules/meta-viewport.json +0 -13
- data/node_modules/axe-core/lib/rules/no-autoplay-audio-matches.js +0 -18
- data/node_modules/axe-core/lib/rules/no-autoplay-audio.json +0 -15
- data/node_modules/axe-core/lib/rules/no-empty-role-matches.js +0 -9
- data/node_modules/axe-core/lib/rules/no-role-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/not-html-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/object-alt.json +0 -25
- data/node_modules/axe-core/lib/rules/p-as-heading-matches.js +0 -17
- data/node_modules/axe-core/lib/rules/p-as-heading.json +0 -13
- data/node_modules/axe-core/lib/rules/page-has-heading-one.json +0 -12
- data/node_modules/axe-core/lib/rules/radiogroup.json +0 -13
- data/node_modules/axe-core/lib/rules/region.json +0 -12
- data/node_modules/axe-core/lib/rules/role-img-alt.json +0 -19
- data/node_modules/axe-core/lib/rules/scope-attr-valid.json +0 -12
- data/node_modules/axe-core/lib/rules/scrollable-region-focusable-matches.js +0 -30
- data/node_modules/axe-core/lib/rules/scrollable-region-focusable.json +0 -12
- data/node_modules/axe-core/lib/rules/server-side-image-map.json +0 -18
- data/node_modules/axe-core/lib/rules/skip-link-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/skip-link.json +0 -13
- data/node_modules/axe-core/lib/rules/svg-img-alt.json +0 -24
- data/node_modules/axe-core/lib/rules/svg-namespace-matches.js +0 -1
- data/node_modules/axe-core/lib/rules/tabindex.json +0 -12
- data/node_modules/axe-core/lib/rules/table-duplicate-name.json +0 -12
- data/node_modules/axe-core/lib/rules/table-fake-caption.json +0 -20
- data/node_modules/axe-core/lib/rules/td-has-header.json +0 -20
- data/node_modules/axe-core/lib/rules/td-headers-attr.json +0 -12
- data/node_modules/axe-core/lib/rules/th-has-data-cells.json +0 -13
- data/node_modules/axe-core/lib/rules/valid-lang.json +0 -13
- data/node_modules/axe-core/lib/rules/video-caption.json +0 -19
- data/node_modules/axe-core/lib/rules/video-description.json +0 -21
- data/node_modules/axe-core/lib/rules/window-is-top.js +0 -3
- data/node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js +0 -12
- data/node_modules/axe-core/typings/axe-core/axe-core-tests.ts +0 -188
@@ -1,889 +0,0 @@
|
|
1
|
-
# Axe Javascript Accessibility API
|
2
|
-
|
3
|
-
## Table of Contents
|
4
|
-
|
5
|
-
1. [Section 1: Introduction](#section-1-introduction)
|
6
|
-
1. [Get Started](#getting-started)
|
7
|
-
1. [Section 2: API Reference](#section-2-api-reference)
|
8
|
-
1. [Overview](#overview)
|
9
|
-
1. [Required Globals](#required-globals)
|
10
|
-
1. [API Notes](#api-notes)
|
11
|
-
1. [API Name: axe.getRules](#api-name-axegetrules)
|
12
|
-
1. [API Name: axe.configure](#api-name-axeconfigure)
|
13
|
-
1. [API Name: axe.reset](#api-name-axereset)
|
14
|
-
1. [API Name: axe.run](#api-name-axerun)
|
15
|
-
1. [Parameters axe.run](#parameters-axerun)
|
16
|
-
1. [Context Parameter](#context-parameter)
|
17
|
-
2. [Options Parameter](#options-parameter)
|
18
|
-
3. [Callback Parameter](#callback-parameter)
|
19
|
-
1. [Return Promise](#return-promise)
|
20
|
-
1. [Error result](#error-result)
|
21
|
-
1. [Results Object](#results-object)
|
22
|
-
1. [API Name: axe.registerPlugin](#api-name-axeregisterplugin)
|
23
|
-
1. [API Name: axe.cleanup](#api-name-axecleanup)
|
24
|
-
1. [Virtual DOM Utilities](#virtual-dom-utilities)
|
25
|
-
1. [API Name: axe.utils.querySelectorAll](#api-name-axeutilsqueryselectorall)
|
26
|
-
1. [Common Functions](#common-functions)
|
27
|
-
1. [Section 3: Example Reference](#section-3-example-reference)
|
28
|
-
1. [Section 4: Performance](#section-4-performance)
|
29
|
-
|
30
|
-
## Section 1: Introduction
|
31
|
-
|
32
|
-
The axe API is designed to be an improvement over the previous generation of accessibility APIs. It provides the following benefits:
|
33
|
-
|
34
|
-
- Runs in any modern browser
|
35
|
-
- Designed to work with existing testing infrastructure
|
36
|
-
- Runs locally, no connection to a third-party server is necessary
|
37
|
-
- Performs violation checking on multiple levels of nested iframes
|
38
|
-
- Provides list of rules and elements that passed accessibility checking, ensuring rules have been run against entire document
|
39
|
-
- Only checks rendered content to minimize false positives (that includes visually-hidden content)
|
40
|
-
|
41
|
-
### Getting Started
|
42
|
-
|
43
|
-
This section gives a quick description of how to use the axe APIs to analyze web page content and return a JSON object that lists any accessibility violations found.
|
44
|
-
|
45
|
-
The axe API can be used as part of a broader process that is performed on many, if not all, pages of a website. The API is used to analyze web page content and return a JSON object that lists any accessibility violations found. Here is how to get started:
|
46
|
-
|
47
|
-
1. Load page in testing system
|
48
|
-
2. Optionally, set configuration options for the javascript API (`axe.configure`)
|
49
|
-
3. Call analyze javascript API (`axe.run`)
|
50
|
-
4. Either assert against results or save them for later processing
|
51
|
-
5. Repeat for any inactive or non-rendered content after making it visible
|
52
|
-
|
53
|
-
## Section 2: API Reference
|
54
|
-
|
55
|
-
### Overview
|
56
|
-
|
57
|
-
The axe APIs are provided in the javascript file axe.js. It must be included in the web page under test. Parameters are sent as javascript function parameters. Results are returned in JSON format.
|
58
|
-
|
59
|
-
### Required Globals
|
60
|
-
|
61
|
-
Axe requires a handful of global variables and interfaces to be available in order to run. See the [jsdom example](https://github.com/dequelabs/axe-core/blob/develop/doc/examples/jsdom/test/a11y.js) for how to set these up in a non-browser environment.
|
62
|
-
|
63
|
-
- `window`
|
64
|
-
- `document`
|
65
|
-
- [`navigator`](https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator)
|
66
|
-
- [`Node`](https://developer.mozilla.org/en-US/docs/Web/API/Node)
|
67
|
-
- [`NodeList`](https://developer.mozilla.org/en-US/docs/Web/API/NodeList)
|
68
|
-
- [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element)
|
69
|
-
- [`Document`](https://developer.mozilla.org/en-US/docs/Web/API/Document)
|
70
|
-
|
71
|
-
### Full API Reference for Developers
|
72
|
-
|
73
|
-
For a full listing of API offered by axe, clone the repository and run `npm run api-docs`. This generates `jsdoc` documentation under `doc/api` which can be viewed using the browser.
|
74
|
-
|
75
|
-
### API Notes
|
76
|
-
|
77
|
-
- A Rule test is made up of sub-tests. Each sub-test is returned in an array of 'checks'
|
78
|
-
- The `"helpUrl"` in the results object is a link to a broader description of the accessibility issue and suggested remediation. These links point to Deque University help pages, which do not require a login.
|
79
|
-
- Axe does not test hidden regions, such as inactive menus or modal windows. To test those for accessibility, write tests that activate or render the regions visible and run the analysis again.
|
80
|
-
|
81
|
-
### API Name: axe.getRules
|
82
|
-
|
83
|
-
#### Purpose
|
84
|
-
|
85
|
-
To get information on all the rules in the system.
|
86
|
-
|
87
|
-
#### Description
|
88
|
-
|
89
|
-
Returns a list of all rules with their ID and description
|
90
|
-
|
91
|
-
#### Synopsis
|
92
|
-
|
93
|
-
`axe.getRules([Tag Name 1, Tag Name 2...]);`
|
94
|
-
|
95
|
-
#### Parameters
|
96
|
-
|
97
|
-
- `tags` - **optional** Array of tags used to filter returned rules. If omitted, it will return all rules.
|
98
|
-
|
99
|
-
**Returns:** Array of rules that match the input filter with each entry having a format of `{ruleId: <id>, description: <desc>}`
|
100
|
-
|
101
|
-
The current set of tags supported are listed in the following table:
|
102
|
-
|
103
|
-
| Tag Name | Accessibility Standard/Purpose |
|
104
|
-
| --------------- | :-----------------------------------------: |
|
105
|
-
| `wcag2a` | WCAG 2.0 & WCAG 2.1 Level A |
|
106
|
-
| `wcag2aa` | WCAG 2.0 & WCAG 2.1 Level AA |
|
107
|
-
| `wcag21a` | WCAG 2.1 Level A |
|
108
|
-
| `wcag21aa` | WCAG 2.1 Level AA |
|
109
|
-
| `section508` | Section 508 |
|
110
|
-
| `best-practice` | Best practices endorsed by Deque |
|
111
|
-
| `experimental` | Cutting-edge techniques |
|
112
|
-
| `cat` | Category mappings used by Deque (see below) |
|
113
|
-
|
114
|
-
| Category name |
|
115
|
-
| ----------------------------- |
|
116
|
-
| `cat.aria` |
|
117
|
-
| `cat.color` |
|
118
|
-
| `cat.forms` |
|
119
|
-
| `cat.keyboard` |
|
120
|
-
| `cat.language` |
|
121
|
-
| `cat.name-role-value` |
|
122
|
-
| `cat.parsing` |
|
123
|
-
| `cat.semantics` |
|
124
|
-
| `cat.sensory-and-visual-cues` |
|
125
|
-
| `cat.structure` |
|
126
|
-
| `cat.tables` |
|
127
|
-
| `cat.text-alternatives` |
|
128
|
-
| `cat.time-and-media` |
|
129
|
-
|
130
|
-
#### Example 1
|
131
|
-
|
132
|
-
In this example, we pass in the WCAG 2 A and AA tags into `axe.getRules` to retrieve only those rules. The function call returns an array of rules.
|
133
|
-
|
134
|
-
**Call:** `axe.getRules(['wcag2aa', 'wcag2a']);`
|
135
|
-
|
136
|
-
**Returned Data:**
|
137
|
-
|
138
|
-
```js
|
139
|
-
[
|
140
|
-
{ ruleId: "area-alt", description: "Checks the <area> elements of image…" },
|
141
|
-
{ ruleId: "aria-allowed-attr", description: "Checks all attributes that start…" },
|
142
|
-
{ ruleId: "aria-required-attr", description: "Checks all elements that contain…" },
|
143
|
-
…
|
144
|
-
]
|
145
|
-
```
|
146
|
-
|
147
|
-
### API Name: axe.configure
|
148
|
-
|
149
|
-
#### Purpose
|
150
|
-
|
151
|
-
To configure the format of the data used by axe. This can be used to add new rules, which must be registered with the library to execute.
|
152
|
-
|
153
|
-
#### Description
|
154
|
-
|
155
|
-
User specifies the format of the JSON structure passed to the callback of `axe.run`
|
156
|
-
|
157
|
-
#### Synopsis
|
158
|
-
|
159
|
-
```js
|
160
|
-
axe.configure({
|
161
|
-
branding: {
|
162
|
-
brand: String,
|
163
|
-
application: String
|
164
|
-
},
|
165
|
-
reporter: 'option',
|
166
|
-
checks: [Object],
|
167
|
-
rules: [Object],
|
168
|
-
locale: Object,
|
169
|
-
axeVersion: String
|
170
|
-
});
|
171
|
-
```
|
172
|
-
|
173
|
-
#### Parameters
|
174
|
-
|
175
|
-
- `configurationOptions` - Options object; where the valid name, value pairs are:
|
176
|
-
- `branding` - mixed(optional) Used to set the branding of the helpUrls
|
177
|
-
- `brand` - string(optional) sets the brand string - default "axe"
|
178
|
-
- `application` - string(optional) sets the application string - default "axeAPI"
|
179
|
-
- `reporter` - Used to set the output format that the axe.run function will pass to the callback function
|
180
|
-
- `v1` to use the previous version's format: `axe.configure({ reporter: "v1" });`
|
181
|
-
- `v2` to use the current version's format: `axe.configure({ reporter: "v2" });`
|
182
|
-
- `raw` to return the raw result data without formating: `axe.configure({ reporter: "raw" });`
|
183
|
-
- `raw-env` to return the raw result data with environment data: `axe.configure({ reporter: "raw-env" });`
|
184
|
-
- `no-passes` to return only violation results: `axe.configure({ reporter: "no-passes" });`
|
185
|
-
- `checks` - Used to add checks to the list of checks used by rules, or to override the properties of existing checks
|
186
|
-
- The checks attribute is an array of check objects
|
187
|
-
- Each check object can contain the following attributes
|
188
|
-
- `id` - string(required). This uniquely identifies the check. If the check already exists, this will result in any supplied check properties being overridden. The properties below that are marked required if new are optional when the check is being overridden.
|
189
|
-
- `evaluate` - function(required for new). This is the function that implements the check's functionality.
|
190
|
-
- `after` - function(optional). This is the function that gets called for checks that operate on a page-level basis, to process the results from the iframes.
|
191
|
-
- `options` - mixed(optional). This is the options structure that is passed to the evaluate function and is intended to be used to configure checks. It is the most common property that is intended to be overridden for existing checks.
|
192
|
-
- `enabled` - boolean(optional, default `true`). This is used to indicate whether the check is on or off by default. Checks that are off are not evaluated, even when included in a rule. Overriding this is a common way to disable a particular check across multiple rules.
|
193
|
-
- `rules` - Used to add rules to the existing set of rules, or to override the properties of existing rules
|
194
|
-
- The rules attribute is an Array of rule objects
|
195
|
-
- each rule object can contain the following attributes
|
196
|
-
- `id` - string(required). This uniquely identifies the rule. If the rule already exists, it will be overridden with any of the attributes supplied. The attributes below that are marked required, are only required for new rules.
|
197
|
-
- `selector` - string(optional, default `*`). A [CSS selector](./developer-guide.md#supported-css-selectors) used to identify the elements that are passed into the rule for evaluation.
|
198
|
-
- `excludeHidden` - boolean(optional, default `true`). This indicates whether elements that are hidden from all users are to be passed into the rule for evaluation.
|
199
|
-
- `enabled` - boolean(optional, default `true`). Whether the rule is turned on. This is a common attribute for overriding.
|
200
|
-
- `pageLevel` - boolean(optional, default `false`). When set to true, this rule is only applied when the entire page is tested. Results from nodes on different frames are combined into a single result. See [page level rules](#page-level-rules).
|
201
|
-
- `any` - array(optional, default `[]`). This is a list of checks that, if none "pass", will generate a violation.
|
202
|
-
- `all` - array(optional, default `[]`). This is a list of checks that, if any "fails", will generate a violation.
|
203
|
-
- `none` - array(optional, default `[]`). This is a list of checks that, if any "pass", will generate a violation.
|
204
|
-
- `tags` - array(optional, default `[]`). A list if the tags that "classify" the rule. In practice, you must supply some valid tags or the default evaluation will not invoke the rule. The convention is to include the standard (WCAG 2 and/or section 508), the WCAG 2 level, Section 508 paragraph, and the WCAG 2 success criteria. Tags are constructed by converting all letters to lower case, removing spaces and periods and concatenating the result. E.g. WCAG 2 A success criteria 1.1.1 would become ["wcag2a", "wcag111"]
|
205
|
-
- `matches` - string(optional, default `*`). A filtering [CSS selector](./developer-guide.md#supported-css-selectors) that will exclude elements that do not match the CSS selector.
|
206
|
-
- `disableOtherRules` - Disables all rules not included in the `rules` property.
|
207
|
-
- `locale` - A locale object to apply (at runtime) to all rules and checks, in the same shape as `/locales/*.json`.
|
208
|
-
- `axeVersion` - Set the compatible version of a custom rule with the current axe version. Compatible versions are all patch and minor updates that are the same as, or newer than those of the `axeVersion` property.
|
209
|
-
|
210
|
-
**Returns:** Nothing
|
211
|
-
|
212
|
-
##### Page level rules
|
213
|
-
|
214
|
-
Page level rules split their evaluation into two phases. A 'data collection' phase which is done inside the 'evaluate' function and an assessment phase which is done inside the 'after' function. The evaluate function executes inside each individual frame and is responsible for collection data that is passed into the after function which inspects that data and makes a decision.
|
215
|
-
|
216
|
-
Page level rules raise violations on the entire document and not on individual nodes or frames from which the data was collected. For an example of how this works, see the heading order check:
|
217
|
-
|
218
|
-
- [lib/checks/navigation/heading-order.json](https://github.com/dequelabs/axe-core/blob/master/lib/checks/navigation/heading-order.json)
|
219
|
-
- [lib/checks/navigation/heading-order.js](https://github.com/dequelabs/axe-core/blob/master/lib/checks/navigation/heading-order.js)
|
220
|
-
- [lib/checks/navigation/heading-order-after.js](https://github.com/dequelabs/axe-core/blob/master/lib/checks/navigation/heading-order-after.js)
|
221
|
-
|
222
|
-
### API Name: axe.reset
|
223
|
-
|
224
|
-
#### Purpose
|
225
|
-
|
226
|
-
Reset the configuration to the default configuration.
|
227
|
-
|
228
|
-
#### Description
|
229
|
-
|
230
|
-
Override any previous calls to `axe.configure` and restore the configuration to the default configuration. Note: this will NOT unregister any new rules or checks that were registered but will reset the configuration back to the default configuration for everything else.
|
231
|
-
|
232
|
-
#### Synopsis
|
233
|
-
|
234
|
-
```js
|
235
|
-
axe.reset();
|
236
|
-
```
|
237
|
-
|
238
|
-
#### Parameters
|
239
|
-
|
240
|
-
None
|
241
|
-
|
242
|
-
### API Name: axe.run
|
243
|
-
|
244
|
-
#### Purpose
|
245
|
-
|
246
|
-
Analyze rendered content on the currently loaded page
|
247
|
-
|
248
|
-
#### Description
|
249
|
-
|
250
|
-
Runs a number of rules against the provided HTML page and returns the resulting issue list
|
251
|
-
|
252
|
-
#### Synopsis
|
253
|
-
|
254
|
-
```js
|
255
|
-
axe.run(context, options, (err, results) => {
|
256
|
-
// ...
|
257
|
-
});
|
258
|
-
```
|
259
|
-
|
260
|
-
#### Parameters axe.run
|
261
|
-
|
262
|
-
- [`context`](#context-parameter): (optional) Defines the scope of the analysis - the part of the DOM that you would like to analyze. This will typically be the `document` or a specific selector such as class name, ID, selector, etc.
|
263
|
-
- [`options`](#options-parameter): (optional) Set of options passed into rules or checks, temporarily modifying them. This contrasts with `axe.configure`, which is more permanent.
|
264
|
-
- [`callback`](#callback-parameter): (optional) The callback function which receives either null or an [error result](#error-result) as the first parameter, and the [results object](#results-object) when analysis is completed successfully, or undefined if it did not.
|
265
|
-
|
266
|
-
##### Context Parameter
|
267
|
-
|
268
|
-
By default, `axe.run` will test the entire document. The context object is an optional parameter that can be used to specify which element should and which should not be tested. It can be passed one of the following:
|
269
|
-
|
270
|
-
1. An element reference that represents the portion of the document that must be analyzed
|
271
|
-
- Example: To limit analysis to the `<div id="content">` element: `document.getElementById("content")`
|
272
|
-
1. A NodeList such as returned by `document.querySelectorAll`.
|
273
|
-
1. A [CSS selector](./developer-guide.md#supported-css-selectors) that selects the portion(s) of the document that must be analyzed.
|
274
|
-
1. An include-exclude object (see below)
|
275
|
-
|
276
|
-
###### Include-Exclude Object
|
277
|
-
|
278
|
-
The include exclude object is a JSON object with two attributes: include and exclude. Either include or exclude is required. If only `exclude` is specified; include will default to the entire `document`.
|
279
|
-
|
280
|
-
- A node, or
|
281
|
-
- An array of arrays of [CSS selectors](./developer-guide.md#supported-css-selectors)
|
282
|
-
- If the nested array contains a single string, that string is the CSS selector
|
283
|
-
- If the nested array contains multiple strings
|
284
|
-
- The last string is the final CSS selector
|
285
|
-
- All other's are the nested structure of iframes inside the document
|
286
|
-
|
287
|
-
In most cases, the component arrays will contain only one CSS selector. Multiple CSS selectors are only required if you want to include or exclude regions of a page that are inside iframes (or iframes within iframes within iframes). In this case, the first n-1 selectors are selectors that select the iframe(s) and the nth selector, selects the region(s) within the iframe.
|
288
|
-
|
289
|
-
###### Context Parameter Examples
|
290
|
-
|
291
|
-
1. Include the first item in the `$fixture` NodeList but exclude its first child
|
292
|
-
|
293
|
-
```js
|
294
|
-
axe.run(
|
295
|
-
{
|
296
|
-
include: $fixture[0],
|
297
|
-
exclude: $fixture[0].firstChild
|
298
|
-
},
|
299
|
-
(err, results) => {
|
300
|
-
// ...
|
301
|
-
}
|
302
|
-
);
|
303
|
-
```
|
304
|
-
|
305
|
-
2. Include the element with the ID of `fix` but exclude any `div`s within it
|
306
|
-
|
307
|
-
```js
|
308
|
-
axe.run(
|
309
|
-
{
|
310
|
-
include: [['#fix']],
|
311
|
-
exclude: [['#fix div']]
|
312
|
-
},
|
313
|
-
(err, results) => {
|
314
|
-
// ...
|
315
|
-
}
|
316
|
-
);
|
317
|
-
```
|
318
|
-
|
319
|
-
3. Include the whole document except any structures whose parent contains the class `exclude1` or `exclude2`
|
320
|
-
|
321
|
-
```js
|
322
|
-
axe.run(
|
323
|
-
{
|
324
|
-
exclude: [['.exclude1'], ['.exclude2']]
|
325
|
-
},
|
326
|
-
(err, results) => {
|
327
|
-
// ...
|
328
|
-
}
|
329
|
-
);
|
330
|
-
```
|
331
|
-
|
332
|
-
4. Include the element with the ID of `fix`, within the iframe with id `frame`
|
333
|
-
|
334
|
-
```js
|
335
|
-
axe.run(
|
336
|
-
{
|
337
|
-
include: [['#frame', '#fix']]
|
338
|
-
},
|
339
|
-
(err, results) => {
|
340
|
-
// ...
|
341
|
-
}
|
342
|
-
);
|
343
|
-
```
|
344
|
-
|
345
|
-
5. Include the element with the ID of `fix`, within the iframe with id `frame2`, within the iframe with id `frame1`
|
346
|
-
|
347
|
-
```js
|
348
|
-
axe.run(
|
349
|
-
{
|
350
|
-
include: [['#frame1', '#frame2', '#fix']]
|
351
|
-
},
|
352
|
-
(err, results) => {
|
353
|
-
// ...
|
354
|
-
}
|
355
|
-
);
|
356
|
-
```
|
357
|
-
|
358
|
-
6. Include the following:
|
359
|
-
|
360
|
-
- The element with the ID of `fix`, within the iframe with id `frame2`, within the iframe with id `frame1`
|
361
|
-
- The element with id `header`
|
362
|
-
- All links
|
363
|
-
|
364
|
-
```js
|
365
|
-
axe.run(
|
366
|
-
{
|
367
|
-
include: [['#header'], ['a'], ['#frame1', '#frame2', '#fix']]
|
368
|
-
},
|
369
|
-
(err, results) => {
|
370
|
-
// ...
|
371
|
-
}
|
372
|
-
);
|
373
|
-
```
|
374
|
-
|
375
|
-
##### Options Parameter
|
376
|
-
|
377
|
-
The options parameter is flexible way to configure how `axe.run` operates. The different modes of operation are:
|
378
|
-
|
379
|
-
- Run all rules corresponding to one of the accessibility standards
|
380
|
-
- Run all rules defined in the system, except for the list of rules specified
|
381
|
-
- Run a specific set of rules provided as a list of rule ids
|
382
|
-
|
383
|
-
Additionally, there are a number or properties that allow configuration of different options:
|
384
|
-
|
385
|
-
| Property | Default | Description |
|
386
|
-
| ------------------ | :------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
|
387
|
-
| `runOnly` | n/a | Limit which rules are executed, based on names or tags |
|
388
|
-
| `rules` | n/a | Allow customizing a rule's properties (including { enable: false }) |
|
389
|
-
| `reporter` | `v1` | Which reporter to use (see [Configuration](#api-name-axeconfigure)) |
|
390
|
-
| `resultTypes` | n/a | Limit which result types are processed and aggregated |
|
391
|
-
| `xpath` | `false` | Return xpath selectors for elements |
|
392
|
-
| `absolutePaths` | `false` | Use absolute paths when creating element selectors |
|
393
|
-
| `iframes` | `true` | Tell axe to run inside iframes |
|
394
|
-
| `elementRef` | `false` | Return element references in addition to the target |
|
395
|
-
| `restoreScroll` | `false` | Scrolls elements back to before axe started |
|
396
|
-
| `frameWaitTime` | `60000` | How long (in milliseconds) axe waits for a response from embedded frames before timing out |
|
397
|
-
| `preload` | `true` | Any additional assets (eg: cssom) to preload before running rules. [See here for configuration details](#preload-configuration-details) |
|
398
|
-
| `performanceTimer` | `false` | Log rule performance metrics to the console |
|
399
|
-
|
400
|
-
###### Options Parameter Examples
|
401
|
-
|
402
|
-
1. Run only Rules for an accessibility standard
|
403
|
-
|
404
|
-
There are certain standards defined that can be used to select a set of rules. The defined standards and tag string are defined as follows:
|
405
|
-
|
406
|
-
| Tag Name | Accessibility Standard |
|
407
|
-
| --------------- | :------------------------------: |
|
408
|
-
| `wcag2a` | WCAG 2.0 Level A |
|
409
|
-
| `wcag2aa` | WCAG 2.0 Level AA |
|
410
|
-
| `section508` | Section 508 |
|
411
|
-
| `best-practice` | Best practices endorsed by Deque |
|
412
|
-
|
413
|
-
To run only WCAG 2.0 Level A rules, specify `options` as:
|
414
|
-
|
415
|
-
```js
|
416
|
-
axe.run(
|
417
|
-
{
|
418
|
-
runOnly: {
|
419
|
-
type: 'tag',
|
420
|
-
values: ['wcag2a']
|
421
|
-
}
|
422
|
-
},
|
423
|
-
(err, results) => {
|
424
|
-
// ...
|
425
|
-
}
|
426
|
-
);
|
427
|
-
```
|
428
|
-
|
429
|
-
To run both WCAG 2.0 Level A and Level AA rules, you must specify both `wcag2a` and `wcag2aa`:
|
430
|
-
|
431
|
-
```js
|
432
|
-
axe.run(
|
433
|
-
{
|
434
|
-
runOnly: {
|
435
|
-
type: 'tag',
|
436
|
-
values: ['wcag2a', 'wcag2aa']
|
437
|
-
}
|
438
|
-
},
|
439
|
-
(err, results) => {
|
440
|
-
// ...
|
441
|
-
}
|
442
|
-
);
|
443
|
-
```
|
444
|
-
|
445
|
-
Alternatively, runOnly can be passed an array of tags:
|
446
|
-
|
447
|
-
```js
|
448
|
-
axe.run({
|
449
|
-
runOnly: ['wcag2a', 'wcag2aa'];
|
450
|
-
}, (err, results) => {
|
451
|
-
// ...
|
452
|
-
})
|
453
|
-
```
|
454
|
-
|
455
|
-
2. Run only a specified list of Rules
|
456
|
-
|
457
|
-
If you only want to run certain rules, specify options as:
|
458
|
-
|
459
|
-
```js
|
460
|
-
axe.run(
|
461
|
-
{
|
462
|
-
runOnly: {
|
463
|
-
type: 'rule',
|
464
|
-
values: ['ruleId1', 'ruleId2', 'ruleId3']
|
465
|
-
}
|
466
|
-
},
|
467
|
-
(err, results) => {
|
468
|
-
// ...
|
469
|
-
}
|
470
|
-
);
|
471
|
-
```
|
472
|
-
|
473
|
-
This example will only run the rules with the id of `ruleId1`, `ruleId2`, and `ruleId3`. No other rule will run.
|
474
|
-
|
475
|
-
Alternatively, runOnly can be passed an array of rules:
|
476
|
-
|
477
|
-
```js
|
478
|
-
axe.run({
|
479
|
-
runOnly: ['ruleId1', 'ruleId2', 'ruleId3'];
|
480
|
-
}, (err, results) => {
|
481
|
-
// ...
|
482
|
-
})
|
483
|
-
```
|
484
|
-
|
485
|
-
3. Run all enabled Rules except for a list of rules
|
486
|
-
|
487
|
-
The default operation for axe.run is to run all rules except for rules with the "experimental" tag. If certain rules should be disabled from being run, specify `options` as:
|
488
|
-
|
489
|
-
```js
|
490
|
-
axe.run(
|
491
|
-
{
|
492
|
-
rules: {
|
493
|
-
'color-contrast': { enabled: false },
|
494
|
-
'valid-lang': { enabled: false }
|
495
|
-
}
|
496
|
-
},
|
497
|
-
(err, results) => {
|
498
|
-
// ...
|
499
|
-
}
|
500
|
-
);
|
501
|
-
```
|
502
|
-
|
503
|
-
This example will disable the rules with the id of `color-contrast` and `valid-lang`. All other rules will run. The list of valid rule IDs is specified in the section below.
|
504
|
-
|
505
|
-
4. Run a modified set or rules using tags and rule enable
|
506
|
-
|
507
|
-
By combining runOnly with type: tags and the rules option, a modified set can be defined. This lets you include rules with unspecified tags, and exclude rules that do have the specified tag(s).
|
508
|
-
|
509
|
-
```js
|
510
|
-
axe.run(
|
511
|
-
{
|
512
|
-
runOnly: {
|
513
|
-
type: 'tag',
|
514
|
-
values: ['wcag2a']
|
515
|
-
},
|
516
|
-
rules: {
|
517
|
-
'color-contrast': { enabled: true },
|
518
|
-
'valid-lang': { enabled: false }
|
519
|
-
}
|
520
|
-
},
|
521
|
-
(err, results) => {
|
522
|
-
// ...
|
523
|
-
}
|
524
|
-
);
|
525
|
-
```
|
526
|
-
|
527
|
-
This example includes all level A rules except for valid-lang, and in addition will include the level AA color-contrast rule.
|
528
|
-
|
529
|
-
6. Only process certain types of results
|
530
|
-
|
531
|
-
The `resultTypes` option can be used to limit the number of nodes for a rule to a maximum of one. This can be useful for improving performance on very large or complicated pages when you are only interested in certain types of results.
|
532
|
-
|
533
|
-
After axe has processed all rules normally, it generates a unique selector for all nodes in all rules. This process can be time consuming, especially for pages with lots of nodes. By limiting the nodes to a maximum of one for result types you are not interested in, you can greatly speed up the tail end performance of axe.
|
534
|
-
|
535
|
-
Types listed in this option will cause rules that fall under those types to show all nodes. Types _not_ listed will causes rules that fall under one of the missing types to show a maximum of one node. This allows you to still see those results and inform the user of them if appropriate.
|
536
|
-
|
537
|
-
```js
|
538
|
-
axe.run(
|
539
|
-
{
|
540
|
-
resultTypes: ['violations', 'incomplete', 'inapplicable']
|
541
|
-
},
|
542
|
-
(err, results) => {
|
543
|
-
// ...
|
544
|
-
}
|
545
|
-
);
|
546
|
-
```
|
547
|
-
|
548
|
-
This example will return all the nodes for all rules that fall under the "violations", "incomplete", and "inapplicable" result types. Since the "passes" type was not specified, it will return at most one node for each rule that passes.
|
549
|
-
|
550
|
-
###### <a id='preload-configuration-details'></a> Preload Configuration in Options Parameter
|
551
|
-
|
552
|
-
The `preload` attribute (defaults to `true`) in options parameter, accepts a `boolean` or an `object` where an array of assets can be specified.
|
553
|
-
|
554
|
-
1. Specifying a `boolean`
|
555
|
-
|
556
|
-
```js
|
557
|
-
axe.run(
|
558
|
-
{
|
559
|
-
preload: true
|
560
|
-
},
|
561
|
-
(err, results) => {
|
562
|
-
// ...
|
563
|
-
}
|
564
|
-
);
|
565
|
-
```
|
566
|
-
|
567
|
-
2. Specifying an `object`
|
568
|
-
|
569
|
-
```js
|
570
|
-
axe.run(
|
571
|
-
{
|
572
|
-
preload: { assets: ['cssom'], timeout: 50000 }
|
573
|
-
},
|
574
|
-
(err, results) => {
|
575
|
-
// ...
|
576
|
-
}
|
577
|
-
);
|
578
|
-
```
|
579
|
-
|
580
|
-
The `assets` attribute expects an array of preload(able) constraints to be fetched. The current set of values supported for `assets` is listed in the following table:
|
581
|
-
|
582
|
-
| Asset Type | Description |
|
583
|
-
| :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
584
|
-
| `cssom` | This asset type preloads all CSS Stylesheets rulesets specified in the page. The stylesheets can be an external cross-domain resource, a relative stylesheet or an inline style with in the head tag of the document. If the stylesheet is an external cross-domain a network request is made. An object representing the CSS Rules from each stylesheet is made available to the checks evaluate function as `preloadedAssets` at run-time |
|
585
|
-
| `media` | This asset type preloads metadata information of any HTMLMediaElement in the specified document |
|
586
|
-
|
587
|
-
The `timeout` attribute in the object configuration is `optional` and has a fallback default value (10000ms). The `timeout` is essential for any network dependent assets that are preloaded, where-in if a given request takes longer than the specified/ default value, the operation is aborted.
|
588
|
-
|
589
|
-
##### Callback Parameter
|
590
|
-
|
591
|
-
The callback parameter is a function that will be called when the asynchronous `axe.run` function completes. The callback function is passed two parameters. The first parameter will be an error thrown inside of axe if axe.run could not complete. If axe completed correctly the first parameter will be null, and the second parameter will be the results object.
|
592
|
-
|
593
|
-
#### Return Promise
|
594
|
-
|
595
|
-
If the callback was not defined, axe will return a Promise instead. Axe does not polyfill a Promise library however. So on systems without support for Promises this feature is not available. If you are unsure if the systems you will need axe on has Promise support we suggest you use the callback provided by axe.run instead.
|
596
|
-
|
597
|
-
#### Error Result
|
598
|
-
|
599
|
-
This will either be null or an object which is an instance of Error. If you are consistently receiving errors, please report this issue on the [Github issues list of Axe](https://github.com/dequelabs/axe-core/issues).
|
600
|
-
|
601
|
-
#### Results Object
|
602
|
-
|
603
|
-
The callback function passed in as the third parameter of `axe.run` runs on the results object. This object has four components – a `passes` array, a `violations` array, an `incomplete` array and an `inapplicable` array.
|
604
|
-
|
605
|
-
The `passes` array keeps track of all the passed tests, along with detailed information on each one. This leads to more efficient testing, especially when used in conjunction with manual testing, as the user can easily find out what tests have already been passed.
|
606
|
-
|
607
|
-
Similarly, the `violations` array keeps track of all the failed tests, along with detailed information on each one.
|
608
|
-
|
609
|
-
The `incomplete` array (also referred to as the "review items") indicates which nodes could neither be determined to definitively pass or definitively fail. They are separated out in order that a user interface can display these to the user for manual review (hence the term "review items").
|
610
|
-
|
611
|
-
The `inapplicable` array lists all the rules for which no matching elements were found on the page.
|
612
|
-
|
613
|
-
###### `url`
|
614
|
-
|
615
|
-
The URL of the page that was tested.
|
616
|
-
|
617
|
-
###### `timestamp`
|
618
|
-
|
619
|
-
The date and time that analysis was completed.
|
620
|
-
|
621
|
-
###### result arrays
|
622
|
-
|
623
|
-
The results of axe are grouped according to their outcome into the following arrays:
|
624
|
-
|
625
|
-
- `passes`: These results indicate what elements passed the rules
|
626
|
-
- `violations`: These results indicate what elements failed the rules
|
627
|
-
- `inapplicable`: These results indicate which rules did not run because no matching content was found on the page. For example, with no video, those rules won't run.
|
628
|
-
- `incomplete`: These results were aborted and require further testing. This can happen either because of technical restrictions to what the rule can test, or because a javascript error occurred.
|
629
|
-
|
630
|
-
Each object returned in these arrays have the following properties:
|
631
|
-
|
632
|
-
- `description` - Text string that describes what the rule does
|
633
|
-
- `help` - Help text that describes the test that was performed
|
634
|
-
- `helpUrl` - URL that provides more information about the specifics of the violation. Links to a page on the Deque University site.
|
635
|
-
- `id` - Unique identifier for the rule; [see the list of rules](rule-descriptions.md)
|
636
|
-
- `impact` - How serious the violation is. Can be one of "minor", "moderate", "serious", or "critical" if the Rule failed or `null` if the check passed
|
637
|
-
- `tags` - Array of tags that this rule is assigned. These tags can be used in the option structure to select which rules are run ([see `axe.run` parameters for more information](#parameters-axerun)).
|
638
|
-
- `nodes` - Array of all elements the Rule tested
|
639
|
-
- `html` - Snippet of HTML of the Element
|
640
|
-
- `impact` - How serious the violation is. Can be one of "minor", "moderate", "serious", or "critical" if the test failed or `null` if the check passed
|
641
|
-
- `target` - Array of either strings or Arrays of strings. If the item in the array is a string, then it is a CSS selector. If there are multiple items in the array each item corresponds to one level of iframe or frame. If there is one iframe or frame, there should be two entries in `target`. If there are three iframe levels, there should be four entries in `target`. If the item in the Array is an Array of strings, then it points to an element in a shadow DOM and each item (except the n-1th) in this array is a selector to a DOM element with a shadow DOM. The last element in the array points to the final shadow DOM node.
|
642
|
-
- `any` - Array of checks that were made where at least one must have passed. Each entry in the array contains:
|
643
|
-
- `id` - Unique identifier for this check. Check ids may be the same as Rule ids
|
644
|
-
- `impact` - How serious this particular check is. Can be one of "minor", "moderate", "serious", or "critical". Each check that is part of a rule can have different impacts. The highest impact of all the checks that fail is reported for the rule
|
645
|
-
- `message` - Description of why this check passed or failed
|
646
|
-
- `data` - Additional information that is specific to the type of Check which is optional. For example, a color contrast check would include the foreground color, background color, contrast ratio, etc.
|
647
|
-
- `relatedNodes` - Optional array of information about other nodes that are related to this check. For example, a duplicate id check violation would list the other selectors that had this same duplicate id. Each entry in the array contains the following information:
|
648
|
-
- `target` - Array of selectors for the related node
|
649
|
-
- `html` - HTML source of the related node
|
650
|
-
- `all` - Array of checks that were made where all must have passed. Each entry in the array contains the same information as the 'any' array
|
651
|
-
- `none` - Array of checks that were made where all must have not passed. Each entry in the array contains the same information as the 'any' array
|
652
|
-
|
653
|
-
#### Example 2
|
654
|
-
|
655
|
-
In this example, we will pass the selector for the entire document, pass no options, which means all enabled rules will be run, and have a simple callback function that logs the entire results object to the console log:
|
656
|
-
|
657
|
-
```js
|
658
|
-
axe.run(document, function(err, results) {
|
659
|
-
if (err) throw err;
|
660
|
-
console.log(results);
|
661
|
-
});
|
662
|
-
```
|
663
|
-
|
664
|
-
###### `passes`
|
665
|
-
|
666
|
-
- `passes[0]`
|
667
|
-
...
|
668
|
-
|
669
|
-
- `help` - `"Elements must have sufficient color contrast"`
|
670
|
-
- `helpUrl` - `"https://dequeuniversity.com/courses/html-css/visual-layout/color-contrast"`
|
671
|
-
- `id` - `"color-contrast"`
|
672
|
-
- `nodes`
|
673
|
-
- `target[0]` - `"#js_off-canvas-wrap > .inner-wrap >.kinja-title.proxima.js_kinja-title-desktop"`
|
674
|
-
|
675
|
-
- `passes[1]`
|
676
|
-
...
|
677
|
-
|
678
|
-
###### `violations`
|
679
|
-
|
680
|
-
- `violations[0]`
|
681
|
-
|
682
|
-
- `help` - `"<button> elements must have alternate text"`
|
683
|
-
- `helpUrl` - `"https://dequeuniversity.com/courses/html-css/forms/form-labels#id84_example_button"`
|
684
|
-
- `id` - `"button-name"`
|
685
|
-
- `nodes`
|
686
|
-
- `target[0]` - `"post_5919997 > .row.content-wrapper > .column > span > iframe"`
|
687
|
-
- `target[1]` - `"#u_0_1 > .pluginConnectButton > .pluginButtonImage > button"`
|
688
|
-
|
689
|
-
- `violations[1]` ...
|
690
|
-
|
691
|
-
##### `passes` Results Array
|
692
|
-
|
693
|
-
In the example above, the `passes` array contains two entries that correspond to the two rules tested. The first element in the array describes a color contrast check. It relays the information that a list of nodes was checked and subsequently passed. The `help`, `helpUrl`, and `id` fields are returned as expected for each of the entries in the `passes` array. The `target` array has one element in it with a value of
|
694
|
-
|
695
|
-
`#js_off-canvas-wrap > .inner-wrap >.kinja-title.proxima.js_kinja-title-desktop`
|
696
|
-
|
697
|
-
This indicates that the element selected by the entry in `target[0]` was checked for the color contrast rule and that it passed the test.
|
698
|
-
|
699
|
-
Each subsequent entry in the passes array has the same format, but will detail the different rules that were run as part of this call to `axe.run()`.
|
700
|
-
|
701
|
-
##### `violations` Results Array
|
702
|
-
|
703
|
-
The array of `violations` contains one entry; this entry describes a test that check if buttons have valid alternate text (button-name). This first entry in the array has the `help`, `helpUrl` and `id` fields returned as expected.
|
704
|
-
|
705
|
-
The `target` array demonstrates how we specify the selectors when the node specified is inside of an `iframe` or `frame`. The first element in the `target` array - `target[0]` - specifies the selector to the `iframe` that contains the button. The second element in the `target` array - `target[1]` - specifies the selector to the actual button, but starting from inside the iframe selected in `target[0]`.
|
706
|
-
|
707
|
-
Each subsequent entry in the violations array has the same format, but will detail the different rules that were run that generated accessibility violations as part of this call to `axe.run()`.
|
708
|
-
|
709
|
-
#### Example 3
|
710
|
-
|
711
|
-
In this example, we pass the selector for the entire document, enable two additional experimental rules, and have a simple callback function that logs the entire results object to the console log:
|
712
|
-
|
713
|
-
```js
|
714
|
-
axe.run(
|
715
|
-
document,
|
716
|
-
{
|
717
|
-
rules: {
|
718
|
-
'link-in-text-block': { enabled: true },
|
719
|
-
'p-as-heading': { enabled: true }
|
720
|
-
}
|
721
|
-
},
|
722
|
-
function(err, results) {
|
723
|
-
if (err) throw err;
|
724
|
-
console.log(results);
|
725
|
-
}
|
726
|
-
);
|
727
|
-
```
|
728
|
-
|
729
|
-
#### Example 4
|
730
|
-
|
731
|
-
This example shows a result object that points to an open shadow DOM element.
|
732
|
-
|
733
|
-
##### `violations[0]`
|
734
|
-
|
735
|
-
```json
|
736
|
-
{
|
737
|
-
"help": "Elements must have sufficient color contrast",
|
738
|
-
"helpUrl": "https://dequeuniversity.com/rules/axe/2.1/color-contrast?application=axeAPI",
|
739
|
-
"id": "color-contrast",
|
740
|
-
"nodes": [
|
741
|
-
{
|
742
|
-
"target": [["header > aria-menu", "li.expanded"]]
|
743
|
-
}
|
744
|
-
]
|
745
|
-
}
|
746
|
-
```
|
747
|
-
|
748
|
-
As you can see the `target` array contains one item that is an array. This array contains two items, the first is a CSS selector string that finds the custom element `<aria-menu>` in the `<header>`. The second item in this array is the selector within that custom element's shadow DOM to find the `<li>` element with a class of `expanded`.
|
749
|
-
|
750
|
-
### API Name: axe.registerPlugin
|
751
|
-
|
752
|
-
Register a plugin with the axe plugin system. See [implementing a plugin](plugins.md) for more information on the plugin system
|
753
|
-
|
754
|
-
### API Name: axe.cleanup
|
755
|
-
|
756
|
-
Call each plugin's cleanup function. See [implementing a plugin](plugins.md).
|
757
|
-
|
758
|
-
The signature is:
|
759
|
-
|
760
|
-
```js
|
761
|
-
axe.cleanup(resolve, reject);
|
762
|
-
```
|
763
|
-
|
764
|
-
`resolve` and `reject` are functions that will be invoked on success or failure respectively.
|
765
|
-
|
766
|
-
`resolve` takes no arguments and `reject` takes a single argument that must be a string or have a toString() method in its prototype.
|
767
|
-
|
768
|
-
### Virtual DOM Utilities
|
769
|
-
|
770
|
-
Note: If you’re writing rules or checks, you’ll have both the `node` and `virtualNode` passed in.
|
771
|
-
But if you need to query the flattened tree, the documented function below should help. See the
|
772
|
-
[developer guide](./developer-guide.md) for more information.
|
773
|
-
|
774
|
-
#### API Name: axe.utils.querySelectorAll
|
775
|
-
|
776
|
-
##### Description
|
777
|
-
|
778
|
-
A querySelectorAll implementation that works on the virtual DOM and open Shadow DOM by manually walking the flattened tree instead of relying on DOM API methods which don’t step into Shadow DOM.
|
779
|
-
|
780
|
-
Note: while there is no `axe.utils.querySelector` method, you can reproduce that behavior by accessing the first item returned in the array.
|
781
|
-
|
782
|
-
##### Synopsis
|
783
|
-
|
784
|
-
```js
|
785
|
-
axe.utils.querySelectorAll(virtualNode, 'a[href]');
|
786
|
-
```
|
787
|
-
|
788
|
-
##### Parameters
|
789
|
-
|
790
|
-
- `virtualNode` – object, the flattened DOM tree to query against. `axe._tree` is available for this purpose during an audit; see below.
|
791
|
-
- `selector` – string, the [CSS selector](./developer-guide.md#supported-css-selectors) to use as a filter. For the most part, this should work seamlessly with `document.querySelectorAll`.
|
792
|
-
|
793
|
-
##### Returns
|
794
|
-
|
795
|
-
An Array of filtered HTML nodes.
|
796
|
-
|
797
|
-
### Common Functions
|
798
|
-
|
799
|
-
#### axe.commons.dom.getComposedParent
|
800
|
-
|
801
|
-
Get an element's parent in the flattened tree
|
802
|
-
|
803
|
-
##### Synopsis
|
804
|
-
|
805
|
-
```js
|
806
|
-
axe.commons.dom.getComposedParent(node);
|
807
|
-
```
|
808
|
-
|
809
|
-
##### Parameters
|
810
|
-
|
811
|
-
- `element` – HTMLElement. The element for which you want to find a parent
|
812
|
-
|
813
|
-
##### Returns
|
814
|
-
|
815
|
-
A DOMNode for the parent
|
816
|
-
|
817
|
-
#### axe.commons.dom.getRootNode
|
818
|
-
|
819
|
-
Return the document or document fragment (open shadow DOM)
|
820
|
-
|
821
|
-
##### Synopsis
|
822
|
-
|
823
|
-
```js
|
824
|
-
axe.commons.dom.getRootNode(node);
|
825
|
-
```
|
826
|
-
|
827
|
-
##### Parameters
|
828
|
-
|
829
|
-
- `element` – HTMLElement. The element for which you want to find the root node
|
830
|
-
|
831
|
-
##### Returns
|
832
|
-
|
833
|
-
The top-level document or shadow DOM document fragment
|
834
|
-
|
835
|
-
#### axe.commons.dom.findUp
|
836
|
-
|
837
|
-
Recursively walk up the DOM, checking for a node which matches a selector. Warning: this should be used sparingly for performance reasons.
|
838
|
-
|
839
|
-
##### Synopsis
|
840
|
-
|
841
|
-
```js
|
842
|
-
axe.commons.dom.findUp(node, '.selector');
|
843
|
-
```
|
844
|
-
|
845
|
-
##### Parameters
|
846
|
-
|
847
|
-
- `element` – HTMLElement. The starting element
|
848
|
-
- `selector` – String. The target selector for the HTMLElement
|
849
|
-
|
850
|
-
##### Returns
|
851
|
-
|
852
|
-
Either the matching HTMLElement or `null` if there was no match.
|
853
|
-
|
854
|
-
## Section 3: Example Reference
|
855
|
-
|
856
|
-
This package contains examples for [jasmine](examples/jasmine), [mocha](examples/mocha), [phantomjs](examples/phantomjs), [qunit](examples/qunit), and [generating HTML from the violations array](examples/html-handlebars.md). Each of these examples is in the [doc/examples](examples) folder. In each folder, there is a README.md file which contains specific information about each example.
|
857
|
-
|
858
|
-
See [axe-webdriverjs](https://github.com/dequelabs/axe-webdriverjs#axe-webdriverjs) for selenium webdriver javascript examples.
|
859
|
-
|
860
|
-
## Section 4: Performance
|
861
|
-
|
862
|
-
Axe-core performs very well in general and if you are analyzing average complexity pages with the default settings, you should not need to worry about performance at all. There are some scenarios that can cause performance issues. This is the list of known issues and what you can do to mitigate and/or avoid them.
|
863
|
-
|
864
|
-
### Very large pages
|
865
|
-
|
866
|
-
Certain rules (like the color-contrast rule) look at almost every element on a page and some of these rules also perform somewhat expensive operations on these elements including looking up the hierarchy, looking at overlapping elements, calculating the computed styles etc. It also calculates a unique selector for each element in the results and also de-duplicates elements so that you do not get duplicate items in your results.
|
867
|
-
|
868
|
-
If your page is very large (in terms of the number of Elements on the page) i.e. >50K elements on the page, then you will see analysis times that run over 10s on a relatively decent CPU.
|
869
|
-
|
870
|
-
#### Use resultTypes
|
871
|
-
|
872
|
-
An approach you can take to reducing the time is use the `resultTypes` option. By calling `axe.run` with the following options, axe-core will only return the full details of the `violations` array and will only return one instance of each of the `inapplicable`, `incomplete` and `pass` arrays for each rule that has at least one of those entries. This will reduce the amount of computation that axe-core does for the unique selectors.
|
873
|
-
|
874
|
-
```js
|
875
|
-
axe.run(
|
876
|
-
{
|
877
|
-
resultTypes: ['violations']
|
878
|
-
},
|
879
|
-
(err, results) => {
|
880
|
-
// ...
|
881
|
-
}
|
882
|
-
);
|
883
|
-
```
|
884
|
-
|
885
|
-
### Other strategies
|
886
|
-
|
887
|
-
#### Targeted color-contrast analysis
|
888
|
-
|
889
|
-
If you are analyzing multiple pages on a single Web site or application, chances are these pages all contain the same styles. It is therefore not adding any additional information to your analysis to analyze every page for color-contrast. Choose a small number of pages that represent the totality of you styles and analyze these with color-contrast and analyze all others without it.
|