lighthouse 11.7.0 → 12.0.0-dev.20240422
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +2 -2
- package/cli/bin.js +0 -7
- package/cli/cli-flags.d.ts +1 -5
- package/cli/cli-flags.js +4 -8
- package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +14 -14
- package/cli/test/smokehouse/config/exclusions.js +3 -0
- package/cli/test/smokehouse/core-tests.js +6 -20
- package/cli/test/smokehouse/frontends/smokehouse-bin.js +2 -2
- package/core/audits/accessibility/accesskeys.js +1 -1
- package/core/audits/accessibility/aria-allowed-attr.js +1 -1
- package/core/audits/accessibility/aria-allowed-role.js +1 -1
- package/core/audits/accessibility/aria-command-name.js +1 -1
- package/core/audits/accessibility/aria-conditional-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-conditional-attr.js +43 -0
- package/core/audits/accessibility/{duplicate-id-active.d.ts → aria-deprecated-role.d.ts} +3 -3
- package/core/audits/accessibility/aria-deprecated-role.js +43 -0
- package/core/audits/accessibility/aria-dialog-name.js +1 -1
- package/core/audits/accessibility/aria-hidden-body.js +1 -1
- package/core/audits/accessibility/aria-hidden-focus.js +1 -1
- package/core/audits/accessibility/aria-input-field-name.js +1 -1
- package/core/audits/accessibility/aria-meter-name.js +1 -1
- package/core/audits/accessibility/aria-progressbar-name.js +1 -1
- package/core/audits/accessibility/aria-prohibited-attr.d.ts +10 -0
- package/core/audits/accessibility/aria-prohibited-attr.js +44 -0
- package/core/audits/accessibility/aria-required-attr.js +1 -1
- package/core/audits/accessibility/aria-required-children.js +1 -1
- package/core/audits/accessibility/aria-required-parent.js +1 -1
- package/core/audits/accessibility/aria-roles.js +1 -1
- package/core/audits/accessibility/aria-text.js +1 -1
- package/core/audits/accessibility/aria-toggle-field-name.js +1 -1
- package/core/audits/accessibility/aria-tooltip-name.js +1 -1
- package/core/audits/accessibility/aria-treeitem-name.js +1 -1
- package/core/audits/accessibility/aria-valid-attr-value.js +1 -1
- package/core/audits/accessibility/aria-valid-attr.js +1 -1
- package/core/audits/accessibility/button-name.js +1 -1
- package/core/audits/accessibility/bypass.js +1 -1
- package/core/audits/accessibility/color-contrast.js +1 -1
- package/core/audits/accessibility/definition-list.js +1 -1
- package/core/audits/accessibility/dlitem.js +1 -1
- package/core/audits/accessibility/document-title.js +1 -1
- package/core/audits/accessibility/duplicate-id-aria.js +1 -1
- package/core/audits/accessibility/empty-heading.js +1 -1
- package/core/audits/accessibility/form-field-multiple-labels.js +1 -1
- package/core/audits/accessibility/frame-title.js +1 -1
- package/core/audits/accessibility/heading-order.js +1 -1
- package/core/audits/accessibility/html-has-lang.js +1 -1
- package/core/audits/accessibility/html-lang-valid.js +1 -1
- package/core/audits/accessibility/html-xml-lang-mismatch.js +1 -1
- package/core/audits/accessibility/identical-links-same-purpose.js +1 -1
- package/core/audits/accessibility/image-alt.js +1 -1
- package/core/audits/accessibility/image-redundant-alt.js +1 -1
- package/core/audits/accessibility/input-button-name.js +1 -1
- package/core/audits/accessibility/input-image-alt.js +1 -1
- package/core/audits/accessibility/label-content-name-mismatch.js +1 -1
- package/core/audits/accessibility/label.js +1 -1
- package/core/audits/accessibility/landmark-one-main.js +1 -1
- package/core/audits/accessibility/link-in-text-block.js +1 -1
- package/core/audits/accessibility/link-name.js +1 -1
- package/core/audits/accessibility/list.js +1 -1
- package/core/audits/accessibility/listitem.js +1 -1
- package/core/audits/accessibility/meta-refresh.js +1 -1
- package/core/audits/accessibility/meta-viewport.js +1 -1
- package/core/audits/accessibility/object-alt.js +1 -1
- package/core/audits/accessibility/select-name.js +1 -1
- package/core/audits/accessibility/skip-link.js +1 -1
- package/core/audits/accessibility/tabindex.js +1 -1
- package/core/audits/accessibility/table-duplicate-name.js +1 -1
- package/core/audits/accessibility/table-fake-caption.js +1 -1
- package/core/audits/accessibility/target-size.js +1 -2
- package/core/audits/accessibility/td-has-header.js +1 -1
- package/core/audits/accessibility/td-headers-attr.js +1 -1
- package/core/audits/accessibility/th-has-data-cells.js +1 -1
- package/core/audits/accessibility/valid-lang.js +1 -1
- package/core/audits/accessibility/video-caption.js +1 -1
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +0 -16
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +1 -38
- package/core/audits/byte-efficiency/offscreen-images.d.ts +0 -11
- package/core/audits/byte-efficiency/offscreen-images.js +0 -15
- package/core/audits/byte-efficiency/render-blocking-resources.js +27 -26
- package/core/audits/byte-efficiency/unminified-css.js +2 -2
- package/core/audits/byte-efficiency/unused-css-rules.js +3 -1
- package/core/audits/dobetterweb/uses-http2.d.ts +0 -13
- package/core/audits/dobetterweb/uses-http2.js +4 -38
- package/core/audits/font-display.js +2 -2
- package/core/audits/layout-shifts.js +2 -2
- package/core/audits/preload-fonts.d.ts +1 -5
- package/core/audits/preload-fonts.js +1 -10
- package/core/audits/prioritize-lcp-image.js +2 -2
- package/core/audits/redirects-http.d.ts +19 -0
- package/core/audits/redirects-http.js +75 -0
- package/core/audits/resource-summary.d.ts +2 -0
- package/core/audits/resource-summary.js +5 -4
- package/core/audits/seo/is-crawlable.d.ts +2 -1
- package/core/audits/seo/link-text.js +12 -0
- package/core/audits/uses-rel-preload.d.ts +1 -5
- package/core/audits/uses-rel-preload.js +5 -15
- package/core/audits/work-during-interaction.d.ts +2 -2
- package/core/audits/work-during-interaction.js +2 -2
- package/core/computed/js-bundles.d.ts +1 -1
- package/core/computed/metrics/cumulative-layout-shift.js +2 -2
- package/core/computed/metrics/lantern-first-contentful-paint.d.ts +13 -82
- package/core/computed/metrics/lantern-first-contentful-paint.js +16 -178
- package/core/computed/metrics/lantern-first-meaningful-paint.d.ts +13 -12
- package/core/computed/metrics/lantern-first-meaningful-paint.js +11 -49
- package/core/computed/metrics/lantern-interactive.d.ts +13 -21
- package/core/computed/metrics/lantern-interactive.js +12 -84
- package/core/computed/metrics/lantern-largest-contentful-paint.d.ts +13 -25
- package/core/computed/metrics/lantern-largest-contentful-paint.js +13 -80
- package/core/computed/metrics/lantern-max-potential-fid.d.ts +13 -24
- package/core/computed/metrics/lantern-max-potential-fid.js +12 -64
- package/core/computed/metrics/lantern-metric.d.ts +14 -18
- package/core/computed/metrics/lantern-metric.js +34 -30
- package/core/computed/metrics/lantern-speed-index.d.ts +13 -32
- package/core/computed/metrics/lantern-speed-index.js +13 -116
- package/core/computed/metrics/lantern-total-blocking-time.d.ts +13 -25
- package/core/computed/metrics/lantern-total-blocking-time.js +10 -94
- package/core/computed/metrics/metric.js +1 -3
- package/core/computed/module-duplication.d.ts +1 -1
- package/core/computed/navigation-insights.d.ts +36 -0
- package/core/computed/navigation-insights.js +35 -0
- package/core/computed/page-dependency-graph.js +3 -7
- package/core/computed/resource-summary.d.ts +10 -12
- package/core/computed/resource-summary.js +12 -19
- package/core/computed/trace-engine-result.d.ts +16 -3
- package/core/computed/trace-engine-result.js +19 -14
- package/core/computed/unused-css.d.ts +3 -1
- package/core/computed/unused-css.js +6 -5
- package/core/config/config-helpers.js +0 -4
- package/core/config/constants.js +0 -1
- package/core/config/default-config.js +63 -142
- package/core/config/experimental-config.js +11 -0
- package/core/config/filters.js +0 -1
- package/core/gather/driver/navigation.js +4 -1
- package/core/gather/driver/prepare.js +1 -1
- package/core/gather/driver/target-manager.js +4 -3
- package/core/gather/driver/wait-for-condition.js +2 -3
- package/core/gather/driver.d.ts +12 -0
- package/core/gather/driver.js +27 -0
- package/core/gather/gatherers/accessibility.js +4 -6
- package/core/gather/gatherers/css-usage.d.ts +0 -21
- package/core/gather/gatherers/css-usage.js +9 -119
- package/core/gather/gatherers/root-causes.d.ts +2 -2
- package/core/gather/gatherers/root-causes.js +6 -5
- package/core/gather/gatherers/stylesheets.d.ts +26 -0
- package/core/gather/gatherers/stylesheets.js +138 -0
- package/core/gather/gatherers/trace-elements.d.ts +4 -13
- package/core/gather/gatherers/trace-elements.js +42 -31
- package/core/gather/navigation-runner.js +3 -1
- package/core/gather/session.d.ts +8 -0
- package/core/gather/session.js +14 -1
- package/core/lib/emulation.js +2 -2
- package/core/lib/i18n/i18n.d.ts +0 -1
- package/core/lib/i18n/i18n.js +0 -2
- package/core/lib/lantern/cpu-node.d.ts +7 -1
- package/core/lib/lantern/cpu-node.js +12 -2
- package/core/lib/lantern/lantern-error.d.ts +8 -0
- package/core/lib/lantern/lantern-error.js +9 -0
- package/core/lib/lantern/metric.js +2 -6
- package/core/lib/lantern/metrics/first-contentful-paint.d.ts +79 -0
- package/core/lib/lantern/metrics/first-contentful-paint.js +200 -0
- package/core/lib/lantern/metrics/first-meaningful-paint.d.ts +6 -0
- package/core/lib/lantern/metrics/first-meaningful-paint.js +64 -0
- package/core/lib/lantern/metrics/interactive.d.ts +26 -0
- package/core/lib/lantern/metrics/interactive.js +112 -0
- package/core/lib/lantern/metrics/largest-contentful-paint.d.ts +19 -0
- package/core/lib/lantern/metrics/largest-contentful-paint.js +108 -0
- package/core/lib/lantern/metrics/max-potential-fid.d.ts +30 -0
- package/core/lib/lantern/metrics/max-potential-fid.js +92 -0
- package/core/lib/lantern/metrics/speed-index.d.ts +38 -0
- package/core/lib/lantern/metrics/speed-index.js +144 -0
- package/core/lib/lantern/metrics/total-blocking-time.d.ts +31 -0
- package/core/lib/lantern/metrics/total-blocking-time.js +128 -0
- package/core/lib/lantern/network-node.js +28 -4
- package/core/lib/lantern/page-dependency-graph.d.ts +4 -4
- package/core/lib/lantern/page-dependency-graph.js +19 -7
- package/core/lib/lantern/simulator/connection-pool.d.ts +2 -12
- package/core/lib/lantern/simulator/connection-pool.js +3 -22
- package/core/lib/lantern/simulator/network-analyzer.js +1 -12
- package/core/lib/lantern/simulator/simulator.d.ts +2 -4
- package/core/lib/lantern/simulator/simulator.js +7 -14
- package/core/lib/lantern/types/lantern.d.ts +5 -3
- package/core/lib/lantern-trace-saver.js +0 -1
- package/core/lib/lh-error.d.ts +9 -0
- package/core/lib/lh-error.js +13 -3
- package/core/lib/lighthouse-compatibility.js +53 -10
- package/core/lib/navigation-error.js +3 -0
- package/core/lib/network-request.d.ts +1 -0
- package/core/lib/network-request.js +29 -1
- package/core/lib/proto-preprocessor.js +24 -8
- package/core/lib/tracehouse/trace-processor.js +15 -2
- package/core/runner.js +18 -25
- package/dist/report/bundle.esm.js +11 -112
- package/dist/report/flow.js +16 -117
- package/dist/report/standalone.js +12 -113
- package/flow-report/src/help-dialog.tsx +0 -1
- package/flow-report/src/i18n/i18n.d.ts +0 -4
- package/flow-report/src/i18n/ui-strings.d.ts +0 -1
- package/flow-report/src/i18n/ui-strings.js +0 -2
- package/flow-report/src/summary/category.tsx +10 -12
- package/package.json +7 -7
- package/readme.md +4 -4
- package/report/assets/styles.css +1 -60
- package/report/assets/templates.html +0 -95
- package/report/renderer/category-renderer.js +1 -1
- package/report/renderer/components.d.ts +2 -2
- package/report/renderer/components.js +2 -103
- package/report/renderer/dom.d.ts +1 -1
- package/report/renderer/dom.js +1 -1
- package/report/renderer/performance-category-renderer.d.ts +0 -7
- package/report/renderer/performance-category-renderer.js +1 -32
- package/report/renderer/report-renderer.js +3 -13
- package/report/renderer/report-ui-features.js +1 -1
- package/report/renderer/report-utils.d.ts +0 -1
- package/report/renderer/report-utils.js +13 -13
- package/shared/localization/locales/ar-XB.json +62 -329
- package/shared/localization/locales/ar.json +62 -329
- package/shared/localization/locales/bg.json +62 -329
- package/shared/localization/locales/ca.json +62 -329
- package/shared/localization/locales/cs.json +62 -329
- package/shared/localization/locales/da.json +62 -329
- package/shared/localization/locales/de.json +62 -329
- package/shared/localization/locales/el.json +62 -329
- package/shared/localization/locales/en-GB.json +62 -329
- package/shared/localization/locales/en-US.json +101 -332
- package/shared/localization/locales/en-XA.json +62 -329
- package/shared/localization/locales/en-XL.json +101 -332
- package/shared/localization/locales/es-419.json +62 -329
- package/shared/localization/locales/es.json +62 -329
- package/shared/localization/locales/fi.json +62 -329
- package/shared/localization/locales/fil.json +61 -328
- package/shared/localization/locales/fr.json +62 -329
- package/shared/localization/locales/he.json +62 -329
- package/shared/localization/locales/hi.json +62 -329
- package/shared/localization/locales/hr.json +63 -330
- package/shared/localization/locales/hu.json +62 -329
- package/shared/localization/locales/id.json +62 -329
- package/shared/localization/locales/it.json +62 -329
- package/shared/localization/locales/ja.json +62 -329
- package/shared/localization/locales/ko.json +62 -329
- package/shared/localization/locales/lt.json +62 -329
- package/shared/localization/locales/lv.json +62 -329
- package/shared/localization/locales/nl.json +62 -329
- package/shared/localization/locales/no.json +62 -329
- package/shared/localization/locales/pl.json +61 -328
- package/shared/localization/locales/pt-PT.json +62 -329
- package/shared/localization/locales/pt.json +64 -331
- package/shared/localization/locales/ro.json +62 -329
- package/shared/localization/locales/ru.json +62 -329
- package/shared/localization/locales/sk.json +62 -329
- package/shared/localization/locales/sl.json +62 -329
- package/shared/localization/locales/sr-Latn.json +62 -329
- package/shared/localization/locales/sr.json +62 -329
- package/shared/localization/locales/sv.json +62 -329
- package/shared/localization/locales/ta.json +61 -328
- package/shared/localization/locales/te.json +62 -329
- package/shared/localization/locales/th.json +62 -329
- package/shared/localization/locales/tr.json +62 -329
- package/shared/localization/locales/uk.json +62 -329
- package/shared/localization/locales/vi.json +61 -328
- package/shared/localization/locales/zh-HK.json +62 -329
- package/shared/localization/locales/zh-TW.json +61 -328
- package/shared/localization/locales/zh.json +62 -329
- package/tsconfig.json +1 -3
- package/types/artifacts.d.ts +21 -110
- package/types/audit.d.ts +0 -10
- package/types/config.d.ts +0 -1
- package/types/externs.d.ts +0 -2
- package/types/gatherer.d.ts +3 -0
- package/types/internal/smokehouse.d.ts +1 -1
- package/types/lh.d.ts +0 -2
- package/types/lhr/audit-details.d.ts +9 -4
- package/types/lhr/lhr.d.ts +0 -4
- package/types/lhr/settings.d.ts +0 -4
- package/core/audits/accessibility/duplicate-id-active.js +0 -42
- package/core/audits/content-width.d.ts +0 -17
- package/core/audits/content-width.js +0 -76
- package/core/audits/installable-manifest.d.ts +0 -111
- package/core/audits/installable-manifest.js +0 -248
- package/core/audits/layout-shift-elements.d.ts +0 -16
- package/core/audits/layout-shift-elements.js +0 -101
- package/core/audits/manual/pwa-cross-browser.d.ts +0 -12
- package/core/audits/manual/pwa-cross-browser.js +0 -40
- package/core/audits/manual/pwa-each-page-has-url.d.ts +0 -12
- package/core/audits/manual/pwa-each-page-has-url.js +0 -38
- package/core/audits/manual/pwa-page-transitions.d.ts +0 -12
- package/core/audits/manual/pwa-page-transitions.js +0 -38
- package/core/audits/maskable-icon.d.ts +0 -25
- package/core/audits/maskable-icon.js +0 -70
- package/core/audits/multi-check-audit.d.ts +0 -28
- package/core/audits/multi-check-audit.js +0 -82
- package/core/audits/no-unload-listeners.d.ts +0 -16
- package/core/audits/no-unload-listeners.js +0 -86
- package/core/audits/performance-budget.d.ts +0 -39
- package/core/audits/performance-budget.js +0 -154
- package/core/audits/script-elements-test-audit.d.ts +0 -14
- package/core/audits/script-elements-test-audit.js +0 -29
- package/core/audits/seo/plugins.d.ts +0 -15
- package/core/audits/seo/plugins.js +0 -150
- package/core/audits/seo/tap-targets.d.ts +0 -50
- package/core/audits/seo/tap-targets.js +0 -352
- package/core/audits/splash-screen.d.ts +0 -37
- package/core/audits/splash-screen.js +0 -98
- package/core/audits/themed-omnibox.d.ts +0 -42
- package/core/audits/themed-omnibox.js +0 -102
- package/core/audits/timing-budget.d.ts +0 -43
- package/core/audits/timing-budget.js +0 -175
- package/core/computed/manifest-values.d.ts +0 -24
- package/core/computed/manifest-values.js +0 -136
- package/core/config/budget.d.ts +0 -74
- package/core/config/budget.js +0 -340
- package/core/config/metrics-to-audits.d.ts +0 -19
- package/core/config/metrics-to-audits.js +0 -62
- package/core/gather/driver/service-workers.d.ts +0 -16
- package/core/gather/driver/service-workers.js +0 -52
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +0 -47
- package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +0 -233
- package/core/gather/gatherers/global-listeners.d.ts +0 -27
- package/core/gather/gatherers/global-listeners.js +0 -108
- package/core/gather/gatherers/installability-errors.d.ts +0 -17
- package/core/gather/gatherers/installability-errors.js +0 -56
- package/core/gather/gatherers/script-elements.d.ts +0 -21
- package/core/gather/gatherers/script-elements.js +0 -100
- package/core/gather/gatherers/seo/embedded-content.d.ts +0 -10
- package/core/gather/gatherers/seo/embedded-content.js +0 -63
- package/core/gather/gatherers/seo/tap-targets.d.ts +0 -21
- package/core/gather/gatherers/seo/tap-targets.js +0 -389
- package/core/gather/gatherers/service-worker.d.ts +0 -10
- package/core/gather/gatherers/service-worker.js +0 -32
- package/core/gather/gatherers/web-app-manifest.d.ts +0 -32
- package/core/gather/gatherers/web-app-manifest.js +0 -106
- package/report/renderer/pwa-category-renderer.d.ts +0 -55
- package/report/renderer/pwa-category-renderer.js +0 -184
- package/third-party/chromium-synchronization/installability-errors-test.js +0 -79
- package/types/lhr/budget.d.ts +0 -60
package/CONTRIBUTING.md
CHANGED
|
@@ -79,8 +79,8 @@ A PR adding or changing a gatherer almost always needs to include the following:
|
|
|
79
79
|
1. **Golden artifacts**: `sample_v2.json` is generated from a set of artifacts that come from running LH against `dbw_tester.html`. Those artifacts likely need to be updated after gatherer changes with `yarn update:sample-artifacts`, but limit to just the artifact being altered if possible. For example:
|
|
80
80
|
|
|
81
81
|
```sh
|
|
82
|
-
# update just the
|
|
83
|
-
yarn update:sample-artifacts
|
|
82
|
+
# update just the Scripts artifact
|
|
83
|
+
yarn update:sample-artifacts Scripts
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
This command works for updating `yarn update:sample-artifacts DevtoolsLog` or `Trace` as well, but the resulting `sample_v2.json` churn may be extensive and you might be better off editing manually.
|
package/cli/bin.js
CHANGED
|
@@ -79,13 +79,6 @@ async function begin() {
|
|
|
79
79
|
config = (await import(`../core/config/${cliFlags.preset}-config.js`)).default;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
if (cliFlags.budgetPath) {
|
|
83
|
-
cliFlags.budgetPath = path.resolve(process.cwd(), cliFlags.budgetPath);
|
|
84
|
-
/** @type {Array<LH.Budget>} */
|
|
85
|
-
const parsedBudget = JSON.parse(fs.readFileSync(cliFlags.budgetPath, 'utf8'));
|
|
86
|
-
cliFlags.budgets = parsedBudget;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
82
|
// set logging preferences
|
|
90
83
|
cliFlags.logLevel = 'info';
|
|
91
84
|
if (cliFlags.verbose) {
|
package/cli/cli-flags.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export function getYargsParser(manualArgv?: string | undefined): yargs.Argv<yarg
|
|
|
24
24
|
default: boolean;
|
|
25
25
|
describe: string;
|
|
26
26
|
};
|
|
27
|
-
}>, "port" | "screenEmulation" | "emulatedUserAgent" | "hostname" | "preset" | "save-assets" | "list-all-audits" | "list-locales" | "list-trace-categories" | "debug-navigation" | "additional-trace-categories" | "config-path" | "chrome-flags" | "form-factor" | "max-wait-for-load" | "enable-error-reporting" | "gather-mode" | "audit-mode" | "only-audits" | "only-categories" | "skip-audits" | "
|
|
27
|
+
}>, "port" | "screenEmulation" | "emulatedUserAgent" | "hostname" | "preset" | "save-assets" | "list-all-audits" | "list-locales" | "list-trace-categories" | "debug-navigation" | "additional-trace-categories" | "config-path" | "chrome-flags" | "form-factor" | "max-wait-for-load" | "enable-error-reporting" | "gather-mode" | "audit-mode" | "only-audits" | "only-categories" | "skip-audits" | "disable-full-page-screenshot" | "ignore-status-code"> & yargs.InferredOptionTypes<{
|
|
28
28
|
'save-assets': {
|
|
29
29
|
type: "boolean";
|
|
30
30
|
default: boolean;
|
|
@@ -125,10 +125,6 @@ export function getYargsParser(manualArgv?: string | undefined): yargs.Argv<yarg
|
|
|
125
125
|
coerce: typeof splitCommaSeparatedValues;
|
|
126
126
|
describe: string;
|
|
127
127
|
};
|
|
128
|
-
'budget-path': {
|
|
129
|
-
type: "string";
|
|
130
|
-
describe: string;
|
|
131
|
-
};
|
|
132
128
|
'disable-full-page-screenshot': {
|
|
133
129
|
type: "boolean";
|
|
134
130
|
describe: string;
|
package/cli/cli-flags.js
CHANGED
|
@@ -53,8 +53,8 @@ function getYargsParser(manualArgv) {
|
|
|
53
53
|
'lighthouse <url> --extra-headers=./path/to/file.json',
|
|
54
54
|
'Path to JSON file of HTTP Header key/value pairs to send in requests')
|
|
55
55
|
.example(
|
|
56
|
-
'lighthouse <url> --only-categories=performance,
|
|
57
|
-
'Only run the specified categories. Available categories: accessibility, best-practices, performance,
|
|
56
|
+
'lighthouse <url> --only-categories=performance,seo',
|
|
57
|
+
'Only run the specified categories. Available categories: accessibility, best-practices, performance, seo')
|
|
58
58
|
|
|
59
59
|
// We only have the single string positional argument, the url.
|
|
60
60
|
.option('_', {
|
|
@@ -188,7 +188,7 @@ function getYargsParser(manualArgv) {
|
|
|
188
188
|
array: true,
|
|
189
189
|
type: 'string',
|
|
190
190
|
coerce: splitCommaSeparatedValues,
|
|
191
|
-
describe: 'Only run the specified categories. Available categories: accessibility, best-practices, performance,
|
|
191
|
+
describe: 'Only run the specified categories. Available categories: accessibility, best-practices, performance, seo',
|
|
192
192
|
},
|
|
193
193
|
'skip-audits': {
|
|
194
194
|
array: true,
|
|
@@ -196,10 +196,6 @@ function getYargsParser(manualArgv) {
|
|
|
196
196
|
coerce: splitCommaSeparatedValues,
|
|
197
197
|
describe: 'Run everything except these audits',
|
|
198
198
|
},
|
|
199
|
-
'budget-path': {
|
|
200
|
-
type: 'string',
|
|
201
|
-
describe: 'The path to the budget.json file for LightWallet.',
|
|
202
|
-
},
|
|
203
199
|
'disable-full-page-screenshot': {
|
|
204
200
|
type: 'boolean',
|
|
205
201
|
describe: 'Disables collection of the full page screenshot, which can be quite large',
|
|
@@ -213,7 +209,7 @@ function getYargsParser(manualArgv) {
|
|
|
213
209
|
'save-assets', 'list-all-audits', 'list-locales', 'list-trace-categories', 'additional-trace-categories',
|
|
214
210
|
'config-path', 'preset', 'chrome-flags', 'port', 'hostname', 'form-factor', 'screenEmulation', 'emulatedUserAgent',
|
|
215
211
|
'max-wait-for-load', 'enable-error-reporting', 'gather-mode', 'audit-mode',
|
|
216
|
-
'only-audits', 'only-categories', 'skip-audits', '
|
|
212
|
+
'only-audits', 'only-categories', 'skip-audits', 'disable-full-page-screenshot', 'ignore-status-code',
|
|
217
213
|
], 'Configuration:')
|
|
218
214
|
|
|
219
215
|
// Output
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`getAssertionReport works (multiple failing) 1`] = `
|
|
4
4
|
"X difference at cumulative-layout-shift audit.details.items.length
|
|
5
5
|
expected: []
|
|
6
|
-
found: [{\\"cumulativeLayoutShiftMainFrame\\":0.
|
|
6
|
+
found: [{\\"cumulativeLayoutShiftMainFrame\\":0.09957584751767748,\\"newEngineResult\\":{\\"cumulativeLayoutShift\\":0.09957584751767748,\\"cumulativeLayoutShiftMainFrame\\":0.09957584751767748},\\"newEngineResultDiffered\\":false}]
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
X difference at cumulative-layout-shift audit.details.blah
|
|
@@ -15,11 +15,11 @@ exports[`getAssertionReport works (multiple failing) 1`] = `
|
|
|
15
15
|
\\"id\\": \\"cumulative-layout-shift\\",
|
|
16
16
|
\\"title\\": \\"Cumulative Layout Shift\\",
|
|
17
17
|
\\"description\\": \\"Cumulative Layout Shift measures the movement of visible elements within the viewport. [Learn more about the Cumulative Layout Shift metric](https://web.dev/articles/cls).\\",
|
|
18
|
-
\\"score\\": 0.
|
|
18
|
+
\\"score\\": 0.9,
|
|
19
19
|
\\"scoreDisplayMode\\": \\"numeric\\",
|
|
20
|
-
\\"numericValue\\": 0.
|
|
20
|
+
\\"numericValue\\": 0.09957584751767748,
|
|
21
21
|
\\"numericUnit\\": \\"unitless\\",
|
|
22
|
-
\\"displayValue\\": \\"0.
|
|
22
|
+
\\"displayValue\\": \\"0.1\\",
|
|
23
23
|
\\"scoringOptions\\": {
|
|
24
24
|
\\"p10\\": 0.1,
|
|
25
25
|
\\"median\\": 0.25
|
|
@@ -28,10 +28,10 @@ exports[`getAssertionReport works (multiple failing) 1`] = `
|
|
|
28
28
|
\\"type\\": \\"debugdata\\",
|
|
29
29
|
\\"items\\": [
|
|
30
30
|
{
|
|
31
|
-
\\"cumulativeLayoutShiftMainFrame\\": 0.
|
|
31
|
+
\\"cumulativeLayoutShiftMainFrame\\": 0.09957584751767748,
|
|
32
32
|
\\"newEngineResult\\": {
|
|
33
|
-
\\"cumulativeLayoutShift\\": 0.
|
|
34
|
-
\\"cumulativeLayoutShiftMainFrame\\": 0.
|
|
33
|
+
\\"cumulativeLayoutShift\\": 0.09957584751767748,
|
|
34
|
+
\\"cumulativeLayoutShiftMainFrame\\": 0.09957584751767748
|
|
35
35
|
},
|
|
36
36
|
\\"newEngineResultDiffered\\": false
|
|
37
37
|
}
|
|
@@ -43,18 +43,18 @@ exports[`getAssertionReport works (multiple failing) 1`] = `
|
|
|
43
43
|
exports[`getAssertionReport works (trivial failing) 1`] = `
|
|
44
44
|
"X difference at cumulative-layout-shift audit.details.items.length
|
|
45
45
|
expected: []
|
|
46
|
-
found: [{\\"cumulativeLayoutShiftMainFrame\\":0.
|
|
46
|
+
found: [{\\"cumulativeLayoutShiftMainFrame\\":0.09957584751767748,\\"newEngineResult\\":{\\"cumulativeLayoutShift\\":0.09957584751767748,\\"cumulativeLayoutShiftMainFrame\\":0.09957584751767748},\\"newEngineResultDiffered\\":false}]
|
|
47
47
|
|
|
48
48
|
found result:
|
|
49
49
|
{
|
|
50
50
|
\\"id\\": \\"cumulative-layout-shift\\",
|
|
51
51
|
\\"title\\": \\"Cumulative Layout Shift\\",
|
|
52
52
|
\\"description\\": \\"Cumulative Layout Shift measures the movement of visible elements within the viewport. [Learn more about the Cumulative Layout Shift metric](https://web.dev/articles/cls).\\",
|
|
53
|
-
\\"score\\": 0.
|
|
53
|
+
\\"score\\": 0.9,
|
|
54
54
|
\\"scoreDisplayMode\\": \\"numeric\\",
|
|
55
|
-
\\"numericValue\\": 0.
|
|
55
|
+
\\"numericValue\\": 0.09957584751767748,
|
|
56
56
|
\\"numericUnit\\": \\"unitless\\",
|
|
57
|
-
\\"displayValue\\": \\"0.
|
|
57
|
+
\\"displayValue\\": \\"0.1\\",
|
|
58
58
|
\\"scoringOptions\\": {
|
|
59
59
|
\\"p10\\": 0.1,
|
|
60
60
|
\\"median\\": 0.25
|
|
@@ -63,10 +63,10 @@ exports[`getAssertionReport works (trivial failing) 1`] = `
|
|
|
63
63
|
\\"type\\": \\"debugdata\\",
|
|
64
64
|
\\"items\\": [
|
|
65
65
|
{
|
|
66
|
-
\\"cumulativeLayoutShiftMainFrame\\": 0.
|
|
66
|
+
\\"cumulativeLayoutShiftMainFrame\\": 0.09957584751767748,
|
|
67
67
|
\\"newEngineResult\\": {
|
|
68
|
-
\\"cumulativeLayoutShift\\": 0.
|
|
69
|
-
\\"cumulativeLayoutShiftMainFrame\\": 0.
|
|
68
|
+
\\"cumulativeLayoutShift\\": 0.09957584751767748,
|
|
69
|
+
\\"cumulativeLayoutShiftMainFrame\\": 0.09957584751767748
|
|
70
70
|
},
|
|
71
71
|
\\"newEngineResultDiffered\\": false
|
|
72
72
|
}
|
|
@@ -20,11 +20,14 @@ const exclusions = {
|
|
|
20
20
|
'redirects-client-paint-server', 'redirects-multiple-server',
|
|
21
21
|
'redirects-single-server', 'redirects-single-client',
|
|
22
22
|
'redirects-history-push-state', 'redirects-scripts',
|
|
23
|
+
'redirects-http',
|
|
23
24
|
// Disabled because these tests use settings that cannot be fully configured in
|
|
24
25
|
// DevTools (e.g. throttling method "provided").
|
|
25
26
|
'metrics-tricky-tti', 'metrics-tricky-tti-late-fcp', 'screenshot',
|
|
26
27
|
// Disabled because of differences that need further investigation
|
|
27
28
|
'byte-efficiency', 'byte-gzip', 'perf-preload',
|
|
29
|
+
// Disabled because a renderer crash also breaks devtools frontend
|
|
30
|
+
'crash',
|
|
28
31
|
],
|
|
29
32
|
};
|
|
30
33
|
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
import a11y from './test-definitions/a11y.js';
|
|
8
8
|
import byteEfficiency from './test-definitions/byte-efficiency.js';
|
|
9
9
|
import byteGzip from './test-definitions/byte-gzip.js';
|
|
10
|
+
import crash from './test-definitions/crash.js';
|
|
10
11
|
import cspAllowAll from './test-definitions/csp-allow-all.js';
|
|
11
12
|
import cspBlockAll from './test-definitions/csp-block-all.js';
|
|
12
13
|
import dbw from './test-definitions/dobetterweb.js';
|
|
13
14
|
import errorsExpiredSsl from './test-definitions/errors-expired-ssl.js';
|
|
14
15
|
import errorsIframeExpiredSsl from './test-definitions/errors-iframe-expired-ssl.js';
|
|
15
16
|
import errorsInfiniteLoop from './test-definitions/errors-infinite-loop.js';
|
|
17
|
+
import fontSize from './test-definitions/font-size.js';
|
|
16
18
|
import formsAutoComplete from './test-definitions/forms-autocomplete.js';
|
|
17
19
|
import fpsMax from './test-definitions/fps-max.js';
|
|
18
20
|
import fpsMaxPassive from './test-definitions/fps-max-passive.js';
|
|
@@ -31,12 +33,8 @@ import metricsDelayedFcp from './test-definitions/metrics-delayed-fcp.js';
|
|
|
31
33
|
import metricsDelayedLcp from './test-definitions/metrics-delayed-lcp.js';
|
|
32
34
|
import metricsTrickyTti from './test-definitions/metrics-tricky-tti.js';
|
|
33
35
|
import metricsTrickyTtiLateFcp from './test-definitions/metrics-tricky-tti-late-fcp.js';
|
|
34
|
-
import offlineOnlineOnly from './test-definitions/offline-online-only.js';
|
|
35
|
-
import offlineReady from './test-definitions/offline-ready.js';
|
|
36
|
-
import offlineSwBroken from './test-definitions/offline-sw-broken.js';
|
|
37
36
|
import oopifRequests from './test-definitions/oopif-requests.js';
|
|
38
37
|
import oopifScripts from './test-definitions/oopif-scripts.js';
|
|
39
|
-
import perfBudgets from './test-definitions/perf-budgets.js';
|
|
40
38
|
import perfDebug from './test-definitions/perf-debug.js';
|
|
41
39
|
import perfDiagnosticsAnimations from './test-definitions/perf-diagnostics-animations.js';
|
|
42
40
|
import perfDiagnosticsThirdParty from './test-definitions/perf-diagnostics-third-party.js';
|
|
@@ -45,13 +43,9 @@ import perfFonts from './test-definitions/perf-fonts.js';
|
|
|
45
43
|
import perfFrameMetrics from './test-definitions/perf-frame-metrics.js';
|
|
46
44
|
import perfPreload from './test-definitions/perf-preload.js';
|
|
47
45
|
import perfTraceElements from './test-definitions/perf-trace-elements.js';
|
|
48
|
-
import pwaAirhorner from './test-definitions/pwa-airhorner.js';
|
|
49
|
-
import pwaCaltrain from './test-definitions/pwa-caltrain.js';
|
|
50
|
-
import pwaChromestatus from './test-definitions/pwa-chromestatus.js';
|
|
51
|
-
import pwaRocks from './test-definitions/pwa-rocks.js';
|
|
52
|
-
import pwaSvgomg from './test-definitions/pwa-svgomg.js';
|
|
53
46
|
import redirectsClientPaintServer from './test-definitions/redirects-client-paint-server.js';
|
|
54
47
|
import redirectsHistoryPushState from './test-definitions/redirects-history-push-state.js';
|
|
48
|
+
import redirectsHttp from './test-definitions/redirects-http.js';
|
|
55
49
|
import redirectsMultipleServer from './test-definitions/redirects-multiple-server.js';
|
|
56
50
|
import redirectsScripts from './test-definitions/redirects-scripts.js';
|
|
57
51
|
import redirectsSelf from './test-definitions/redirects-self.js';
|
|
@@ -61,7 +55,6 @@ import screenshot from './test-definitions/screenshot.js';
|
|
|
61
55
|
import seoFailing from './test-definitions/seo-failing.js';
|
|
62
56
|
import seoPassing from './test-definitions/seo-passing.js';
|
|
63
57
|
import seoStatus403 from './test-definitions/seo-status-403.js';
|
|
64
|
-
import seoTapTargets from './test-definitions/seo-tap-targets.js';
|
|
65
58
|
import serviceWorkerReloaded from './test-definitions/service-worker-reloaded.js';
|
|
66
59
|
import shiftAttribution from './test-definitions/shift-attribution.js';
|
|
67
60
|
import sourceMaps from './test-definitions/source-maps.js';
|
|
@@ -72,12 +65,14 @@ const smokeTests = [
|
|
|
72
65
|
a11y,
|
|
73
66
|
byteEfficiency,
|
|
74
67
|
byteGzip,
|
|
68
|
+
crash,
|
|
75
69
|
cspAllowAll,
|
|
76
70
|
cspBlockAll,
|
|
77
71
|
dbw,
|
|
78
72
|
errorsExpiredSsl,
|
|
79
73
|
errorsIframeExpiredSsl,
|
|
80
74
|
errorsInfiniteLoop,
|
|
75
|
+
fontSize,
|
|
81
76
|
formsAutoComplete,
|
|
82
77
|
fpsMax,
|
|
83
78
|
fpsMaxPassive,
|
|
@@ -96,12 +91,8 @@ const smokeTests = [
|
|
|
96
91
|
metricsDelayedLcp,
|
|
97
92
|
metricsTrickyTti,
|
|
98
93
|
metricsTrickyTtiLateFcp,
|
|
99
|
-
offlineOnlineOnly,
|
|
100
|
-
offlineReady,
|
|
101
|
-
offlineSwBroken,
|
|
102
94
|
oopifRequests,
|
|
103
95
|
oopifScripts,
|
|
104
|
-
perfBudgets,
|
|
105
96
|
perfDebug,
|
|
106
97
|
perfDiagnosticsAnimations,
|
|
107
98
|
perfDiagnosticsThirdParty,
|
|
@@ -110,13 +101,9 @@ const smokeTests = [
|
|
|
110
101
|
perfFrameMetrics,
|
|
111
102
|
perfPreload,
|
|
112
103
|
perfTraceElements,
|
|
113
|
-
pwaAirhorner,
|
|
114
|
-
pwaCaltrain,
|
|
115
|
-
pwaChromestatus,
|
|
116
|
-
pwaRocks,
|
|
117
|
-
pwaSvgomg,
|
|
118
104
|
redirectsClientPaintServer,
|
|
119
105
|
redirectsHistoryPushState,
|
|
106
|
+
redirectsHttp,
|
|
120
107
|
redirectsMultipleServer,
|
|
121
108
|
redirectsScripts,
|
|
122
109
|
redirectsSelf,
|
|
@@ -126,7 +113,6 @@ const smokeTests = [
|
|
|
126
113
|
seoFailing,
|
|
127
114
|
seoPassing,
|
|
128
115
|
seoStatus403,
|
|
129
|
-
seoTapTargets,
|
|
130
116
|
serviceWorkerReloaded,
|
|
131
117
|
shiftAttribution,
|
|
132
118
|
sourceMaps,
|
|
@@ -59,7 +59,7 @@ function getDefinitionsToRun(allTestDefns, requestedIds, excludedTests) {
|
|
|
59
59
|
} else {
|
|
60
60
|
smokes = allTestDefns.filter(test => {
|
|
61
61
|
// Include all tests that *include* requested id.
|
|
62
|
-
// e.g. a requested '
|
|
62
|
+
// e.g. a requested 'perf' will match 'perf-preload', 'perf-trace-elements', etc
|
|
63
63
|
return requestedIds.some(requestedId => test.id.includes(requestedId));
|
|
64
64
|
});
|
|
65
65
|
console.log(`Running ONLY smoketests for: ${smokes.map(t => t.id).join(' ')}\n`);
|
|
@@ -125,7 +125,7 @@ async function begin() {
|
|
|
125
125
|
const rawArgv = y
|
|
126
126
|
.help('help')
|
|
127
127
|
.usage('node $0 [<options>] <test-ids>')
|
|
128
|
-
.example('node $0 -j=1
|
|
128
|
+
.example('node $0 -j=1 perf seo', 'run perf and seo tests serially')
|
|
129
129
|
.option('_', {
|
|
130
130
|
array: true,
|
|
131
131
|
type: 'string',
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Access keys let users quickly focus a part of the page. For proper ' +
|
|
22
22
|
'navigation, each access key must be unique. ' +
|
|
23
|
-
'[Learn more about access keys](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about access keys](https://dequeuniversity.com/rules/axe/4.9/accesskeys).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Each ARIA `role` supports a specific subset of `aria-*` attributes. ' +
|
|
22
22
|
'Mismatching these invalidates the `aria-*` attributes. [Learn ' +
|
|
23
|
-
'how to match ARIA attributes to their roles](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'how to match ARIA attributes to their roles](https://dequeuniversity.com/rules/axe/4.9/aria-allowed-attr).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -22,7 +22,7 @@ const UIStrings = {
|
|
|
22
22
|
'the web page. If the `role` values are misspelled, not existing ARIA `role` values, or ' +
|
|
23
23
|
'abstract roles, then the purpose of the element will not be communicated to users of ' +
|
|
24
24
|
'assistive technologies. ' +
|
|
25
|
-
'[Learn more about ARIA roles](https://dequeuniversity.com/rules/axe/4.
|
|
25
|
+
'[Learn more about ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role).',
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accessibility audit that evaluates if important HTML elements do not have accessible names. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: '`button`, `link`, and `menuitem` elements do not have accessible names.',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should have accessible names for HTML elements. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
-
description: 'When an element doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to make command elements more accessible](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'When an element doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to make command elements more accessible](https://dequeuniversity.com/rules/axe/4.9/aria-command-name).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default AriaConditionalAttr;
|
|
2
|
+
declare class AriaConditionalAttr extends AxeAudit {
|
|
3
|
+
}
|
|
4
|
+
export namespace UIStrings {
|
|
5
|
+
const title: string;
|
|
6
|
+
const failureTitle: string;
|
|
7
|
+
const description: string;
|
|
8
|
+
}
|
|
9
|
+
import AxeAudit from './axe-audit.js';
|
|
10
|
+
//# sourceMappingURL=aria-conditional-attr.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that ARIA attributes are used as specified for element roles.
|
|
9
|
+
* See base class in axe-audit.js for audit() implementation.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import AxeAudit from './axe-audit.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
|
+
|
|
15
|
+
const UIStrings = {
|
|
16
|
+
/** Title of an accessibility audit that checks if ARIA attributes are used as specified for element roles. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'ARIA attributes are used as specified for the element\'s role',
|
|
18
|
+
/** Title of an accessibility audit that checks if ARIA attributes are used as specified for element roles. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
|
+
failureTitle: 'ARIA attributes are not used as specified for the element\'s role',
|
|
20
|
+
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
+
description: 'Some ARIA attributes are only allowed on an element under certain conditions. ' +
|
|
22
|
+
'[Learn more about conditional ARIA attributes](https://dequeuniversity.com/rules/axe/4.9/aria-conditional-attr).',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
26
|
+
|
|
27
|
+
class AriaConditionalAttr extends AxeAudit {
|
|
28
|
+
/**
|
|
29
|
+
* @return {LH.Audit.Meta}
|
|
30
|
+
*/
|
|
31
|
+
static get meta() {
|
|
32
|
+
return {
|
|
33
|
+
id: 'aria-conditional-attr',
|
|
34
|
+
title: str_(UIStrings.title),
|
|
35
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
36
|
+
description: str_(UIStrings.description),
|
|
37
|
+
requiredArtifacts: ['Accessibility'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default AriaConditionalAttr;
|
|
43
|
+
export {UIStrings};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default
|
|
2
|
-
declare class
|
|
1
|
+
export default AriaDeprecatedRole;
|
|
2
|
+
declare class AriaDeprecatedRole extends AxeAudit {
|
|
3
3
|
}
|
|
4
4
|
export namespace UIStrings {
|
|
5
5
|
const title: string;
|
|
@@ -7,4 +7,4 @@ export namespace UIStrings {
|
|
|
7
7
|
const description: string;
|
|
8
8
|
}
|
|
9
9
|
import AxeAudit from './axe-audit.js';
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=aria-deprecated-role.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that deprecated ARIA roles are not used.
|
|
9
|
+
* See base class in axe-audit.js for audit() implementation.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import AxeAudit from './axe-audit.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
|
+
|
|
15
|
+
const UIStrings = {
|
|
16
|
+
/** Title of an accessibility audit that checks if deprecated ARIA roles are used. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Deprecated ARIA roles were not used',
|
|
18
|
+
/** Title of an accessibility audit that checks if deprecated ARIA roles are used. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
|
+
failureTitle: 'Deprecated ARIA roles were used',
|
|
20
|
+
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
+
description: 'Deprecated ARIA roles may not be processed correctly by assistive technology. ' +
|
|
22
|
+
'[Learn more about deprecated ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-deprecated-role).',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
26
|
+
|
|
27
|
+
class AriaDeprecatedRole extends AxeAudit {
|
|
28
|
+
/**
|
|
29
|
+
* @return {LH.Audit.Meta}
|
|
30
|
+
*/
|
|
31
|
+
static get meta() {
|
|
32
|
+
return {
|
|
33
|
+
id: 'aria-deprecated-role',
|
|
34
|
+
title: str_(UIStrings.title),
|
|
35
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
36
|
+
description: str_(UIStrings.description),
|
|
37
|
+
requiredArtifacts: ['Accessibility'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default AriaDeprecatedRole;
|
|
43
|
+
export {UIStrings};
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
/** Description of a Lighthouse audit that tells the user *why* they should have accessible names for ARIA dialog elements. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
22
22
|
description: 'ARIA dialog elements without accessible names may prevent screen readers users ' +
|
|
23
23
|
'from discerning the purpose of these elements. ' +
|
|
24
|
-
'[Learn how to make ARIA dialog elements more accessible](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn how to make ARIA dialog elements more accessible](https://dequeuniversity.com/rules/axe/4.9/aria-dialog-name).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accesibility audit that checks if the html <body> element does not have an aria-hidden attribute set on it. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: '`[aria-hidden="true"]` is present on the document `<body>`',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
-
description: 'Assistive technologies, like screen readers, work inconsistently when `aria-hidden="true"` is set on the document `<body>`. [Learn how `aria-hidden` affects the document body](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'Assistive technologies, like screen readers, work inconsistently when `aria-hidden="true"` is set on the document `<body>`. [Learn how `aria-hidden` affects the document body](https://dequeuniversity.com/rules/axe/4.9/aria-hidden-body).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accesibility audit that checks if all elements that have an aria-hidden attribute do not contain focusable descendent elements. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: '`[aria-hidden="true"]` elements contain focusable descendents',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
-
description: 'Focusable descendents within an `[aria-hidden="true"]` element prevent those interactive elements from being available to users of assistive technologies like screen readers. [Learn how `aria-hidden` affects focusable elements](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'Focusable descendents within an `[aria-hidden="true"]` element prevent those interactive elements from being available to users of assistive technologies like screen readers. [Learn how `aria-hidden` affects focusable elements](https://dequeuniversity.com/rules/axe/4.9/aria-hidden-focus).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accesibility audit that checks that all ARIA input fields have an accessible name. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: 'ARIA input fields do not have accessible names',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
-
description: 'When an input field doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more about input field labels](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'When an input field doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn more about input field labels](https://dequeuniversity.com/rules/axe/4.9/aria-input-field-name).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accessibility audit that evaluates if meter HTML elements do not have accessible names. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: 'ARIA `meter` elements do not have accessible names.',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should have accessible names for HTML 'meter' elements. This is displayed after a user expands the section to see more. No character length limits. 'Learn how...' becomes link text to additional documentation. */
|
|
21
|
-
description: 'When a meter element doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to name `meter` elements](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'When a meter element doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to name `meter` elements](https://dequeuniversity.com/rules/axe/4.9/aria-meter-name).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -18,7 +18,7 @@ const UIStrings = {
|
|
|
18
18
|
/** Title of an accessibility audit that evaluates if progressbar HTML elements do not have accessible names. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
19
|
failureTitle: 'ARIA `progressbar` elements do not have accessible names.',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
-
description: 'When a `progressbar` element doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to label `progressbar` elements](https://dequeuniversity.com/rules/axe/4.
|
|
21
|
+
description: 'When a `progressbar` element doesn\'t have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to label `progressbar` elements](https://dequeuniversity.com/rules/axe/4.9/aria-progressbar-name).',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default AriaProhibitedAttr;
|
|
2
|
+
declare class AriaProhibitedAttr extends AxeAudit {
|
|
3
|
+
}
|
|
4
|
+
export namespace UIStrings {
|
|
5
|
+
const title: string;
|
|
6
|
+
const failureTitle: string;
|
|
7
|
+
const description: string;
|
|
8
|
+
}
|
|
9
|
+
import AxeAudit from './axe-audit.js';
|
|
10
|
+
//# sourceMappingURL=aria-prohibited-attr.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that deprecated ARIA roles are not used.
|
|
9
|
+
* See base class in axe-audit.js for audit() implementation.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import AxeAudit from './axe-audit.js';
|
|
13
|
+
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
|
+
|
|
15
|
+
const UIStrings = {
|
|
16
|
+
/** Title of an accessibility audit that checks if elements use prohibited ARIA attributes. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Elements use only permitted ARIA attributes',
|
|
18
|
+
/** Title of an accessibility audit that checks if elements use prohibited ARIA attributes. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
|
|
19
|
+
failureTitle: 'Elements use prohibited ARIA attributes',
|
|
20
|
+
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
|
+
description: 'Using ARIA attributes in roles where they are prohibited can mean that important ' +
|
|
22
|
+
'information is not communicated to users of assistive technologies. ' +
|
|
23
|
+
'[Learn more about prohibited ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-prohibited-attr).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class AriaProhibitedAttr extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'aria-prohibited-attr',
|
|
35
|
+
title: str_(UIStrings.title),
|
|
36
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
37
|
+
description: str_(UIStrings.description),
|
|
38
|
+
requiredArtifacts: ['Accessibility'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default AriaProhibitedAttr;
|
|
44
|
+
export {UIStrings};
|
|
@@ -19,7 +19,7 @@ const UIStrings = {
|
|
|
19
19
|
failureTitle: '`[role]`s do not have all required `[aria-*]` attributes',
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'Some ARIA roles have required attributes that describe the state ' +
|
|
22
|
-
'of the element to screen readers. [Learn more about roles and required attributes](https://dequeuniversity.com/rules/axe/4.
|
|
22
|
+
'of the element to screen readers. [Learn more about roles and required attributes](https://dequeuniversity.com/rules/axe/4.9/aria-required-attr).',
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
24
24
|
description: 'Some ARIA parent roles must contain specific child roles to perform ' +
|
|
25
25
|
'their intended accessibility functions. ' +
|
|
26
|
-
'[Learn more about roles and required children elements](https://dequeuniversity.com/rules/axe/4.
|
|
26
|
+
'[Learn more about roles and required children elements](https://dequeuniversity.com/rules/axe/4.9/aria-required-children).',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
22
22
|
description: 'Some ARIA child roles must be contained by specific parent roles to ' +
|
|
23
23
|
'properly perform their intended accessibility functions. ' +
|
|
24
|
-
'[Learn more about ARIA roles and required parent element](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about ARIA roles and required parent element](https://dequeuniversity.com/rules/axe/4.9/aria-required-parent).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -20,7 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
|
|
21
21
|
description: 'ARIA roles must have valid values in order to perform their ' +
|
|
22
22
|
'intended accessibility functions. ' +
|
|
23
|
-
'[Learn more about valid ARIA roles](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about valid ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-roles).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|