lighthouse 11.7.0-dev.20240325 → 11.7.0-dev.20240327
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/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-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-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-active.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 -1
- 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/work-during-interaction.d.ts +2 -2
- package/core/audits/work-during-interaction.js +2 -2
- package/core/computed/metrics/lantern-metric.js +1 -3
- package/core/computed/metrics/metric.js +1 -3
- package/core/config/default-config.js +5 -9
- package/core/lib/lighthouse-compatibility.js +33 -0
- package/dist/report/bundle.esm.js +1 -1
- package/dist/report/flow.js +1 -1
- package/dist/report/standalone.js +1 -1
- package/package.json +2 -2
- package/report/renderer/report-utils.js +13 -10
- package/shared/localization/locales/ar-XB.json +1 -10
- package/shared/localization/locales/ar.json +1 -10
- package/shared/localization/locales/bg.json +1 -10
- package/shared/localization/locales/ca.json +1 -10
- package/shared/localization/locales/cs.json +1 -10
- package/shared/localization/locales/da.json +1 -10
- package/shared/localization/locales/de.json +1 -10
- package/shared/localization/locales/el.json +1 -10
- package/shared/localization/locales/en-GB.json +1 -10
- package/shared/localization/locales/en-US.json +63 -72
- package/shared/localization/locales/en-XA.json +1 -10
- package/shared/localization/locales/en-XL.json +63 -72
- package/shared/localization/locales/es-419.json +1 -10
- package/shared/localization/locales/es.json +1 -10
- package/shared/localization/locales/fi.json +1 -10
- package/shared/localization/locales/fil.json +1 -10
- package/shared/localization/locales/fr.json +1 -10
- package/shared/localization/locales/he.json +1 -10
- package/shared/localization/locales/hi.json +1 -10
- package/shared/localization/locales/hr.json +1 -10
- package/shared/localization/locales/hu.json +1 -10
- package/shared/localization/locales/id.json +1 -10
- package/shared/localization/locales/it.json +1 -10
- package/shared/localization/locales/ja.json +1 -10
- package/shared/localization/locales/ko.json +1 -10
- package/shared/localization/locales/lt.json +1 -10
- package/shared/localization/locales/lv.json +1 -10
- package/shared/localization/locales/nl.json +1 -10
- package/shared/localization/locales/no.json +1 -10
- package/shared/localization/locales/pl.json +1 -10
- package/shared/localization/locales/pt-PT.json +1 -10
- package/shared/localization/locales/pt.json +1 -10
- package/shared/localization/locales/ro.json +1 -10
- package/shared/localization/locales/ru.json +1 -10
- package/shared/localization/locales/sk.json +1 -10
- package/shared/localization/locales/sl.json +1 -10
- package/shared/localization/locales/sr-Latn.json +1 -10
- package/shared/localization/locales/sr.json +1 -10
- package/shared/localization/locales/sv.json +1 -10
- package/shared/localization/locales/ta.json +1 -10
- package/shared/localization/locales/te.json +1 -10
- package/shared/localization/locales/th.json +1 -10
- package/shared/localization/locales/tr.json +1 -10
- package/shared/localization/locales/uk.json +1 -10
- package/shared/localization/locales/vi.json +1 -10
- package/shared/localization/locales/zh-HK.json +1 -10
- package/shared/localization/locales/zh-TW.json +1 -10
- package/shared/localization/locales/zh.json +1 -10
- package/types/config.d.ts +0 -1
- package/types/lhr/lhr.d.ts +0 -2
- package/core/audits/no-unload-listeners.d.ts +0 -16
- package/core/audits/no-unload-listeners.js +0 -86
- package/core/config/metrics-to-audits.d.ts +0 -19
- package/core/config/metrics-to-audits.js +0 -60
- package/core/gather/gatherers/global-listeners.d.ts +0 -27
- package/core/gather/gatherers/global-listeners.js +0 -108
|
@@ -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: 'The summary attribute should describe the table structure, while `<caption>` ' +
|
|
22
22
|
'should have the onscreen title. Accurate table mark-up helps users of screen readers. ' +
|
|
23
|
-
'[Learn more about summary and caption](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about summary and caption](https://dequeuniversity.com/rules/axe/4.9/table-duplicate-name).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
24
24
|
'that tables use the actual caption element instead of cells with the `[colspan]` ' +
|
|
25
25
|
'attribute may improve the experience for screen reader users. ' +
|
|
26
|
-
'[Learn more about captions](https://dequeuniversity.com/rules/axe/4.
|
|
26
|
+
'[Learn more about captions](https://dequeuniversity.com/rules/axe/4.9/table-fake-caption).',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
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: 'Touch targets with sufficient size and spacing help users who may have ' +
|
|
22
22
|
'difficulty targeting small controls to activate the targets. ' +
|
|
23
|
-
'[Learn more about touch targets](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn more about touch targets](https://dequeuniversity.com/rules/axe/4.9/target-size).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -21,7 +21,7 @@ const UIStrings = {
|
|
|
21
21
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
22
22
|
'that `<td>` elements in a large table (3 or more cells in width and height) have an ' +
|
|
23
23
|
'associated table header may improve the experience for screen reader users. ' +
|
|
24
|
-
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.9/td-has-header).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -24,7 +24,7 @@ const UIStrings = {
|
|
|
24
24
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
25
25
|
'`<td>` cells using the `[headers]` attribute only refer to other cells in the same ' +
|
|
26
26
|
'table may improve the experience for screen reader users. ' +
|
|
27
|
-
'[Learn more about the `headers` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
27
|
+
'[Learn more about the `headers` attribute](https://dequeuniversity.com/rules/axe/4.9/td-headers-attr).',
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
description: 'Screen readers have features to make navigating tables easier. Ensuring ' +
|
|
24
24
|
'table headers always refer to some set of cells may improve the experience for screen ' +
|
|
25
25
|
'reader users. ' +
|
|
26
|
-
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.
|
|
26
|
+
'[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.9/th-has-data-cells).',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
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: 'Specifying a valid [BCP 47 language](https://www.w3.org/International/questions/qa-choosing-language-tags#question) ' +
|
|
22
22
|
'on elements helps ensure that text is pronounced correctly by a screen reader. ' +
|
|
23
|
-
'[Learn how to use the `lang` attribute](https://dequeuniversity.com/rules/axe/4.
|
|
23
|
+
'[Learn how to use the `lang` attribute](https://dequeuniversity.com/rules/axe/4.9/valid-lang).',
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
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: 'When a video provides a caption it is easier for deaf and hearing impaired ' +
|
|
23
23
|
'users to access its information. ' +
|
|
24
|
-
'[Learn more about video captions](https://dequeuniversity.com/rules/axe/4.
|
|
24
|
+
'[Learn more about video captions](https://dequeuniversity.com/rules/axe/4.9/video-caption).',
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -32,7 +32,7 @@ declare class WorkDuringInteraction extends Audit {
|
|
|
32
32
|
startTs: number;
|
|
33
33
|
endTs: number;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
processingDuration: {
|
|
36
36
|
startTs: number;
|
|
37
37
|
endTs: number;
|
|
38
38
|
};
|
|
@@ -72,7 +72,7 @@ export namespace UIStrings {
|
|
|
72
72
|
const failureTitle: string;
|
|
73
73
|
const description: string;
|
|
74
74
|
const inputDelay: string;
|
|
75
|
-
const
|
|
75
|
+
const processingDuration: string;
|
|
76
76
|
const presentationDelay: string;
|
|
77
77
|
const displayValue: string;
|
|
78
78
|
const eventTarget: string;
|
|
@@ -30,7 +30,7 @@ const UIStrings = {
|
|
|
30
30
|
/** Label for a column in a data table; entries will be information on the time that the browser is delayed before responding to user input. Ideally fits within a ~40 character limit. */
|
|
31
31
|
inputDelay: 'Input delay',
|
|
32
32
|
/** Label for a column in a data table; entries will be information on the time taken by code processing user input that delays a response to the user. Ideally fits within a ~40 character limit. */
|
|
33
|
-
|
|
33
|
+
processingDuration: 'Processing duration',
|
|
34
34
|
/** Label for a column in a data table; entries will be information on the time that the browser is delayed before presenting a response to user input on screen. Ideally fits within a ~40 character limit. */
|
|
35
35
|
presentationDelay: 'Presentation delay',
|
|
36
36
|
/**
|
|
@@ -115,7 +115,7 @@ class WorkDuringInteraction extends Audit {
|
|
|
115
115
|
const endTs = startTs + interactionData.duration * 1000;
|
|
116
116
|
return {
|
|
117
117
|
inputDelay: {startTs, endTs: processingStartTs},
|
|
118
|
-
|
|
118
|
+
processingDuration: {startTs: processingStartTs, endTs: processingEndTs},
|
|
119
119
|
presentationDelay: {startTs: processingEndTs, endTs},
|
|
120
120
|
};
|
|
121
121
|
}
|
|
@@ -19,9 +19,7 @@ class LanternMetric extends Metric {
|
|
|
19
19
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
20
20
|
*/
|
|
21
21
|
static async computeMetricWithGraphs(data, context, extras) {
|
|
22
|
-
|
|
23
|
-
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
|
|
24
|
-
if (gatherContext.gatherMode !== 'navigation') {
|
|
22
|
+
if (data.gatherContext.gatherMode !== 'navigation') {
|
|
25
23
|
throw new Error(`Lantern metrics can only be computed on navigations`);
|
|
26
24
|
}
|
|
27
25
|
|
|
@@ -61,9 +61,7 @@ class Metric {
|
|
|
61
61
|
* @return {Promise<LH.Artifacts.LanternMetric|LH.Artifacts.Metric>}
|
|
62
62
|
*/
|
|
63
63
|
static async compute_(data, context) {
|
|
64
|
-
|
|
65
|
-
const gatherContext = data.gatherContext || {gatherMode: 'navigation'};
|
|
66
|
-
const {trace, devtoolsLog, settings} = data;
|
|
64
|
+
const {trace, devtoolsLog, settings, gatherContext} = data;
|
|
67
65
|
if (!trace || !devtoolsLog || !settings) {
|
|
68
66
|
throw new Error('Did not provide necessary metric computation data');
|
|
69
67
|
}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import * as LH from '../../types/lh.js';
|
|
10
10
|
import * as constants from './constants.js';
|
|
11
11
|
import * as i18n from '../lib/i18n/i18n.js';
|
|
12
|
-
import {metricsToAudits} from './metrics-to-audits.js';
|
|
13
12
|
|
|
14
13
|
const UIStrings = {
|
|
15
14
|
/** Title of the Performance category of audits. Equivalent to 'Web performance', this term is inclusive of all web page speed and loading optimization topics. Also used as a label of a score gauge; try to limit to 20 characters. */
|
|
@@ -141,7 +140,6 @@ const defaultConfig = {
|
|
|
141
140
|
{id: 'EmbeddedContent', gatherer: 'seo/embedded-content'},
|
|
142
141
|
{id: 'FontSize', gatherer: 'seo/font-size'},
|
|
143
142
|
{id: 'Inputs', gatherer: 'inputs'},
|
|
144
|
-
{id: 'GlobalListeners', gatherer: 'global-listeners'},
|
|
145
143
|
{id: 'IFrameElements', gatherer: 'iframe-elements'},
|
|
146
144
|
{id: 'ImageElements', gatherer: 'image-elements'},
|
|
147
145
|
{id: 'InstallabilityErrors', gatherer: 'installability-errors'},
|
|
@@ -222,7 +220,6 @@ const defaultConfig = {
|
|
|
222
220
|
'layout-shift-elements',
|
|
223
221
|
'layout-shifts',
|
|
224
222
|
'long-tasks',
|
|
225
|
-
'no-unload-listeners',
|
|
226
223
|
'non-composited-animations',
|
|
227
224
|
'unsized-images',
|
|
228
225
|
'valid-source-maps',
|
|
@@ -431,12 +428,12 @@ const defaultConfig = {
|
|
|
431
428
|
title: str_(UIStrings.performanceCategoryTitle),
|
|
432
429
|
supportedModes: ['navigation', 'timespan', 'snapshot'],
|
|
433
430
|
auditRefs: [
|
|
434
|
-
{id: 'first-contentful-paint', weight: 10, group: 'metrics', acronym: 'FCP'
|
|
435
|
-
{id: 'largest-contentful-paint', weight: 25, group: 'metrics', acronym: 'LCP'
|
|
436
|
-
{id: 'total-blocking-time', weight: 30, group: 'metrics', acronym: 'TBT'
|
|
437
|
-
{id: 'cumulative-layout-shift', weight: 25, group: 'metrics', acronym: 'CLS'
|
|
431
|
+
{id: 'first-contentful-paint', weight: 10, group: 'metrics', acronym: 'FCP'},
|
|
432
|
+
{id: 'largest-contentful-paint', weight: 25, group: 'metrics', acronym: 'LCP'},
|
|
433
|
+
{id: 'total-blocking-time', weight: 30, group: 'metrics', acronym: 'TBT'},
|
|
434
|
+
{id: 'cumulative-layout-shift', weight: 25, group: 'metrics', acronym: 'CLS'},
|
|
438
435
|
{id: 'speed-index', weight: 10, group: 'metrics', acronym: 'SI'},
|
|
439
|
-
{id: 'interaction-to-next-paint', weight: 0, group: 'metrics', acronym: 'INP'
|
|
436
|
+
{id: 'interaction-to-next-paint', weight: 0, group: 'metrics', acronym: 'INP'},
|
|
440
437
|
|
|
441
438
|
// These are our "invisible" metrics. Not displayed, but still in the LHR.
|
|
442
439
|
{id: 'interactive', weight: 0, group: 'hidden', acronym: 'TTI'},
|
|
@@ -605,7 +602,6 @@ const defaultConfig = {
|
|
|
605
602
|
{id: 'doctype', weight: 1, group: 'best-practices-browser-compat'},
|
|
606
603
|
{id: 'charset', weight: 1, group: 'best-practices-browser-compat'},
|
|
607
604
|
// General Group
|
|
608
|
-
{id: 'no-unload-listeners', weight: 1, group: 'best-practices-general'},
|
|
609
605
|
{id: 'js-libraries', weight: 0, group: 'best-practices-general'},
|
|
610
606
|
{id: 'deprecations', weight: 5, group: 'best-practices-general'},
|
|
611
607
|
{id: 'third-party-cookies', weight: 5, group: 'best-practices-general'},
|
|
@@ -125,6 +125,39 @@ function upgradeLhrForCompatibility(lhr) {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
if (majorVersion < 12 && perfCategory) {
|
|
129
|
+
/** @type {Map<string, string[]>} */
|
|
130
|
+
const metricRelevanceMap = new Map();
|
|
131
|
+
|
|
132
|
+
for (const auditRef of perfCategory.auditRefs) {
|
|
133
|
+
/** @type {string[]|undefined} */
|
|
134
|
+
// @ts-expect-error Removed in v12
|
|
135
|
+
const relevantAudits = auditRef.relevantAudits;
|
|
136
|
+
if (!relevantAudits || !auditRef.acronym) continue;
|
|
137
|
+
|
|
138
|
+
for (const auditId of relevantAudits) {
|
|
139
|
+
const acronyms = metricRelevanceMap.get(auditId) || [];
|
|
140
|
+
acronyms.push(auditRef.acronym);
|
|
141
|
+
metricRelevanceMap.set(auditId, acronyms);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
for (const [auditId, acronyms] of metricRelevanceMap) {
|
|
146
|
+
if (!acronyms.length) continue;
|
|
147
|
+
|
|
148
|
+
const audit = lhr.audits[auditId];
|
|
149
|
+
if (!audit) continue;
|
|
150
|
+
|
|
151
|
+
// Old versions can still define metric savings, let's not mess with it.
|
|
152
|
+
if (audit.metricSavings) continue;
|
|
153
|
+
|
|
154
|
+
audit.metricSavings = {};
|
|
155
|
+
for (const acronym of acronyms) {
|
|
156
|
+
audit.metricSavings[acronym] = 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
128
161
|
// Add some minimal stuff so older reports still work.
|
|
129
162
|
if (!lhr.environment) {
|
|
130
163
|
lhr.environment = {
|