lighthouse 10.3.0 → 10.4.0
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/cli/test/smokehouse/frontends/smokehouse-bin.js +19 -13
- package/cli/test/smokehouse/lighthouse-runners/bundle.js +3 -5
- package/core/audits/accessibility/aria-dialog-name.d.ts +10 -0
- package/core/audits/accessibility/aria-dialog-name.js +45 -0
- package/core/audits/accessibility/aria-text.d.ts +10 -0
- package/core/audits/accessibility/aria-text.js +44 -0
- package/core/audits/accessibility/empty-heading.d.ts +10 -0
- package/core/audits/accessibility/empty-heading.js +45 -0
- package/core/audits/accessibility/identical-links-same-purpose.d.ts +10 -0
- package/core/audits/accessibility/identical-links-same-purpose.js +45 -0
- package/core/audits/accessibility/landmark-one-main.d.ts +10 -0
- package/core/audits/accessibility/landmark-one-main.js +44 -0
- package/core/audits/accessibility/link-in-text-block.d.ts +10 -0
- package/core/audits/accessibility/link-in-text-block.js +44 -0
- package/core/audits/accessibility/select-name.d.ts +10 -0
- package/core/audits/accessibility/select-name.js +44 -0
- package/core/audits/accessibility/target-size.d.ts +10 -0
- package/core/audits/accessibility/target-size.js +45 -0
- package/core/audits/audit.d.ts +6 -0
- package/core/audits/audit.js +12 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.d.ts +22 -6
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +97 -25
- package/core/audits/long-tasks.d.ts +48 -0
- package/core/audits/long-tasks.js +146 -19
- package/core/audits/non-composited-animations.js +7 -0
- package/core/audits/prioritize-lcp-image.js +2 -1
- package/core/audits/redirects.js +4 -0
- package/core/audits/seo/link-text.js +10 -0
- package/core/audits/unsized-images.js +3 -0
- package/core/audits/viewport.js +11 -0
- package/core/audits/work-during-interaction.js +13 -2
- package/core/computed/js-bundles.js +1 -1
- package/core/computed/metrics/tbt-utils.d.ts +26 -0
- package/core/computed/metrics/tbt-utils.js +48 -28
- package/core/computed/metrics/total-blocking-time.js +1 -1
- package/core/computed/tbt-impact-tasks.d.ts +54 -0
- package/core/computed/tbt-impact-tasks.js +221 -0
- package/core/config/default-config.js +17 -0
- package/core/config/filters.d.ts +9 -9
- package/core/config/filters.js +7 -7
- package/core/config/validation.js +12 -0
- package/core/gather/base-gatherer.d.ts +1 -3
- package/core/gather/base-gatherer.js +1 -3
- package/core/gather/gatherers/accessibility.js +8 -3
- package/core/gather/gatherers/seo/font-size.d.ts +0 -1
- package/core/gather/gatherers/seo/font-size.js +0 -1
- package/core/gather/gatherers/source-maps.js +3 -2
- package/core/lib/cdt/SDK.d.ts +1 -1
- package/core/lib/cdt/SDK.js +2 -2
- package/core/lib/dependency-graph/simulator/simulator.js +3 -1
- package/core/lib/lh-error.d.ts +14 -2
- package/core/lib/lh-error.js +7 -1
- package/core/lib/navigation-error.d.ts +2 -2
- package/core/lib/navigation-error.js +1 -1
- package/core/lib/network-recorder.js +1 -0
- package/core/lib/stack-packs.js +4 -0
- package/dist/report/bundle.esm.js +2 -1
- package/dist/report/flow.js +9 -9
- package/dist/report/standalone.js +2 -2
- package/package.json +5 -5
- package/report/assets/styles.css +5 -1
- package/report/renderer/category-renderer.js +1 -0
- package/report/renderer/components.js +1 -1
- package/shared/localization/locales/ar-XB.json +233 -2
- package/shared/localization/locales/ar.json +233 -2
- package/shared/localization/locales/bg.json +233 -2
- package/shared/localization/locales/ca.json +233 -2
- package/shared/localization/locales/cs.json +246 -15
- package/shared/localization/locales/da.json +239 -8
- package/shared/localization/locales/de.json +238 -7
- package/shared/localization/locales/el.json +234 -3
- package/shared/localization/locales/en-GB.json +233 -2
- package/shared/localization/locales/en-US.json +87 -0
- package/shared/localization/locales/en-XA.json +233 -2
- package/shared/localization/locales/en-XL.json +87 -0
- package/shared/localization/locales/es-419.json +233 -2
- package/shared/localization/locales/es.json +233 -2
- package/shared/localization/locales/fi.json +233 -2
- package/shared/localization/locales/fil.json +236 -5
- package/shared/localization/locales/fr.json +235 -4
- package/shared/localization/locales/he.json +233 -2
- package/shared/localization/locales/hi.json +236 -5
- package/shared/localization/locales/hr.json +234 -3
- package/shared/localization/locales/hu.json +233 -2
- package/shared/localization/locales/id.json +233 -2
- package/shared/localization/locales/it.json +234 -3
- package/shared/localization/locales/ja.json +233 -2
- package/shared/localization/locales/ko.json +233 -2
- package/shared/localization/locales/lt.json +233 -2
- package/shared/localization/locales/lv.json +250 -19
- package/shared/localization/locales/nl.json +233 -2
- package/shared/localization/locales/no.json +235 -4
- package/shared/localization/locales/pl.json +233 -2
- package/shared/localization/locales/pt-PT.json +233 -2
- package/shared/localization/locales/pt.json +234 -3
- package/shared/localization/locales/ro.json +233 -2
- package/shared/localization/locales/ru.json +233 -2
- package/shared/localization/locales/sk.json +233 -2
- package/shared/localization/locales/sl.json +233 -2
- package/shared/localization/locales/sr-Latn.json +233 -2
- package/shared/localization/locales/sr.json +233 -2
- package/shared/localization/locales/sv.json +233 -2
- package/shared/localization/locales/ta.json +233 -2
- package/shared/localization/locales/te.json +233 -2
- package/shared/localization/locales/th.json +233 -2
- package/shared/localization/locales/tr.json +233 -2
- package/shared/localization/locales/uk.json +233 -2
- package/shared/localization/locales/vi.json +233 -2
- package/shared/localization/locales/zh-HK.json +233 -2
- package/shared/localization/locales/zh-TW.json +235 -4
- package/shared/localization/locales/zh.json +239 -8
- package/tsconfig.json +1 -1
- package/types/artifacts.d.ts +9 -2
|
@@ -25,6 +25,8 @@ import {runSmokehouse, getShardedDefinitions} from '../smokehouse.js';
|
|
|
25
25
|
import {updateTestDefnFormat} from './back-compat-util.js';
|
|
26
26
|
import {LH_ROOT} from '../../../../root.js';
|
|
27
27
|
import exclusions from '../config/exclusions.js';
|
|
28
|
+
import {saveArtifacts} from '../../../../core/lib/asset-saver.js';
|
|
29
|
+
import {saveLhr} from '../../../../core/lib/asset-saver.js';
|
|
28
30
|
|
|
29
31
|
const coreTestDefnsPath =
|
|
30
32
|
path.join(LH_ROOT, 'cli/test/smokehouse/core-tests.js');
|
|
@@ -230,19 +232,23 @@ async function begin() {
|
|
|
230
232
|
if (!smokehouseResult.success) {
|
|
231
233
|
const failedTestResults = smokehouseResult.testResults.filter(r => r.failed);
|
|
232
234
|
|
|
233
|
-
//
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
235
|
+
// Save failed runs to directory. In CI, this is uploaded as an artifact.
|
|
236
|
+
const failuresDir = `${LH_ROOT}/.tmp/smokehouse-failures`;
|
|
237
|
+
fs.rmSync(failuresDir, {recursive: true, force: true});
|
|
238
|
+
fs.mkdirSync(failuresDir);
|
|
239
|
+
|
|
240
|
+
for (const testResult of failedTestResults) {
|
|
241
|
+
for (let i = 0; i < testResult.runs.length; i++) {
|
|
242
|
+
const runDir = `${failuresDir}/${i}/${testResult.id}`;
|
|
243
|
+
fs.mkdirSync(runDir, {recursive: true});
|
|
244
|
+
|
|
245
|
+
const run = testResult.runs[i];
|
|
246
|
+
await saveArtifacts(run.artifacts, runDir);
|
|
247
|
+
await saveLhr(run.lhr, runDir);
|
|
248
|
+
fs.writeFileSync(`${runDir}/assertionLog.txt`, run.assertionLog);
|
|
249
|
+
fs.writeFileSync(`${runDir}/lighthouseLog.txt`, run.lighthouseLog);
|
|
250
|
+
if (run.networkRequests) {
|
|
251
|
+
fs.writeFileSync(`${runDir}/networkRequests.txt`, run.networkRequests.join('\n'));
|
|
246
252
|
}
|
|
247
253
|
}
|
|
248
254
|
}
|
|
@@ -82,7 +82,7 @@ async function runBundledLighthouse(url, config, testRunnerOptions) {
|
|
|
82
82
|
|
|
83
83
|
// Run Lighthouse.
|
|
84
84
|
try {
|
|
85
|
-
const logLevel = testRunnerOptions.isDebug ? '
|
|
85
|
+
const logLevel = testRunnerOptions.isDebug ? 'verbose' : 'info';
|
|
86
86
|
let runnerResult;
|
|
87
87
|
if (testRunnerOptions.useLegacyNavigation) {
|
|
88
88
|
const connection = new CriConnection(port);
|
|
@@ -124,12 +124,10 @@ async function runLighthouse(url, config, testRunnerOptions = {}) {
|
|
|
124
124
|
worker.stdout.setEncoding('utf8');
|
|
125
125
|
worker.stderr.setEncoding('utf8');
|
|
126
126
|
worker.stdout.addListener('data', (data) => {
|
|
127
|
-
|
|
128
|
-
logs.push(`STDOUT: ${data}`);
|
|
127
|
+
logs.push(`[STDOUT] ${data}`);
|
|
129
128
|
});
|
|
130
129
|
worker.stderr.addListener('data', (data) => {
|
|
131
|
-
|
|
132
|
-
logs.push(`STDERR: ${data}`);
|
|
130
|
+
logs.push(`[STDERR] ${data}`);
|
|
133
131
|
});
|
|
134
132
|
const [workerResponse] = await once(worker, 'message');
|
|
135
133
|
const log = logs.join('') + '\n';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default AriaDialogName;
|
|
2
|
+
declare class AriaDialogName 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-dialog-name.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures every ARIA dialog element has a discernable, accessible name.
|
|
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 evaluates if ARIA dialog elements have an accessible name. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Elements with `role="dialog"` or `role="alertdialog"` have accessible names.',
|
|
18
|
+
/** Title of an accessibility audit that evaluates if ARIA dialog 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
|
+
failureTitle: 'Elements with `role="dialog"` or `role="alertdialog"` do not have accessible ' +
|
|
20
|
+
'names.',
|
|
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
|
+
description: 'ARIA dialog elements without accessible names may prevent screen readers users ' +
|
|
23
|
+
'from discerning the purpose of these elements. ' +
|
|
24
|
+
'[Learn how to make ARIA dialog elements more accessible](https://dequeuniversity.com/rules/axe/4.7/aria-dialog-name).',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
28
|
+
|
|
29
|
+
class AriaDialogName extends AxeAudit {
|
|
30
|
+
/**
|
|
31
|
+
* @return {LH.Audit.Meta}
|
|
32
|
+
*/
|
|
33
|
+
static get meta() {
|
|
34
|
+
return {
|
|
35
|
+
id: 'aria-dialog-name',
|
|
36
|
+
title: str_(UIStrings.title),
|
|
37
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
38
|
+
description: str_(UIStrings.description),
|
|
39
|
+
requiredArtifacts: ['Accessibility'],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default AriaDialogName;
|
|
45
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default AriaText;
|
|
2
|
+
declare class AriaText 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-text.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures all elements with `role=text` have no focusable descendents.
|
|
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 accesibility audit that evaluates if elements with `role=text` have no focusable descendents. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Elements with the `role=text` attribute do not have focusable descendents.',
|
|
18
|
+
/** Title of an accesibility audit that evaluates if elements with `role=text` have focusable descendents. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
19
|
+
failureTitle: 'Elements with the `role=text` attribute do have focusable descendents.',
|
|
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: 'Adding `role=text` around a text node split by markup enables VoiceOver to treat ' +
|
|
22
|
+
'it as one phrase, but the element\'s focusable descendents will not be announced. ' +
|
|
23
|
+
'[Learn more about the `role=text` attribute](https://dequeuniversity.com/rules/axe/4.7/aria-text).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class AriaText extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'aria-text',
|
|
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 AriaText;
|
|
44
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default EmptyHeading;
|
|
2
|
+
declare class EmptyHeading 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=empty-heading.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that headings are not empty.
|
|
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 accesibility audit that checks if all heading elements have content. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'All heading elements contain content.',
|
|
18
|
+
/** Title of an accesibility audit that checks if all heading elements have content. 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: 'Heading elements do not contain content.',
|
|
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: 'A heading with no content or inaccessible text prevent screen reader users from ' +
|
|
22
|
+
'accessing information on the page\'s structure. ' +
|
|
23
|
+
'[Learn more about headings](https://dequeuniversity.com/rules/axe/4.7/empty-heading).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class EmptyHeading extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'empty-heading',
|
|
35
|
+
title: str_(UIStrings.title),
|
|
36
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
37
|
+
description: str_(UIStrings.description),
|
|
38
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
39
|
+
requiredArtifacts: ['Accessibility'],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default EmptyHeading;
|
|
45
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default IdenticalLinksSamePurpose;
|
|
2
|
+
declare class IdenticalLinksSamePurpose 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=identical-links-same-purpose.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that identical links have the same purpose.
|
|
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 accesibility audit that checks if identical links have the same purpose. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Identical links have the same purpose.',
|
|
18
|
+
/** Title of an accesibility audit that checks if identical links have the same purpose. 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: 'Identical links do not have the same purpose.',
|
|
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: 'Links with the same destination should have the same description, to help users ' +
|
|
22
|
+
'understand the link\'s purpose and decide whether to follow it. ' +
|
|
23
|
+
'[Learn more about identical links](https://dequeuniversity.com/rules/axe/4.7/identical-links-same-purpose).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class IdenticalLinksSamePurpose extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'identical-links-same-purpose',
|
|
35
|
+
title: str_(UIStrings.title),
|
|
36
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
37
|
+
description: str_(UIStrings.description),
|
|
38
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
39
|
+
requiredArtifacts: ['Accessibility'],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default IdenticalLinksSamePurpose;
|
|
45
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default LandmarkOneMain;
|
|
2
|
+
declare class LandmarkOneMain 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=landmark-one-main.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that the document has a main landmark.
|
|
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 accesibility audit that checks if the document has a main landmark. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Document has a main landmark.',
|
|
18
|
+
/** Title of an accesibility audit that checks if the document has a main landmark. 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: 'Document does not have a main landmark.',
|
|
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: 'One main landmark helps screen reader users navigate a web page. ' +
|
|
22
|
+
'[Learn more about landmarks](https://dequeuniversity.com/rules/axe/4.7/landmark-one-main).',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
26
|
+
|
|
27
|
+
class LandmarkOneMain extends AxeAudit {
|
|
28
|
+
/**
|
|
29
|
+
* @return {LH.Audit.Meta}
|
|
30
|
+
*/
|
|
31
|
+
static get meta() {
|
|
32
|
+
return {
|
|
33
|
+
id: 'landmark-one-main',
|
|
34
|
+
title: str_(UIStrings.title),
|
|
35
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
36
|
+
description: str_(UIStrings.description),
|
|
37
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
38
|
+
requiredArtifacts: ['Accessibility'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default LandmarkOneMain;
|
|
44
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default LinkInTextBlock;
|
|
2
|
+
declare class LinkInTextBlock 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=link-in-text-block.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that links can be distinguished without relying on color.
|
|
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 accesibility audit that evaluates if all link elements can be distinguished without relying on color. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Links are distinguishable without relying on color.',
|
|
18
|
+
/** Title of an accesibility audit that evaluates if all link elements can be distinguished without relying on color. 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: 'Links rely on color to be distinguishable.',
|
|
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: 'Low-contrast text is difficult or impossible for many users to read. Link text ' +
|
|
22
|
+
'that is discernible improves the experience for users with low vision. ' +
|
|
23
|
+
'[Learn how to make links distinguishable](https://dequeuniversity.com/rules/axe/4.7/link-in-text-block).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class LinkInTextBlock extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'link-in-text-block',
|
|
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 LinkInTextBlock;
|
|
44
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default SelectName;
|
|
2
|
+
declare class SelectName 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=select-name.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures select elements have programmatically associated label elements.
|
|
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 accesibility audit that evaluates if all select elements have programmatically associated label elements. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Select elements have associated label elements.',
|
|
18
|
+
/** Title of an accesibility audit that evaluates if all select elements have programmatically associated label 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
|
+
failureTitle: 'Select elements do not have associated label elements.',
|
|
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: 'Form elements without effective labels can create frustrating experiences ' +
|
|
22
|
+
'for screen reader users. ' +
|
|
23
|
+
'[Learn more about the `select` element](https://dequeuniversity.com/rules/axe/4.7/select-name).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class SelectName extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'select-name',
|
|
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 SelectName;
|
|
44
|
+
export {UIStrings};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default TargetSize;
|
|
2
|
+
declare class TargetSize 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=target-size.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
|
|
3
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Ensures that touch targets have sufficient size and spacing.
|
|
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 accesibility audit that checks if all touch targets have sufficient size and spacing. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Touch targets have sufficient size and spacing.',
|
|
18
|
+
/** Title of an accesibility audit that checks if all touch targets have sufficient size and spacing. 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: 'Touch targets do not have sufficient size or spacing.',
|
|
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: 'Touch targets with sufficient size and spacing help users who may have ' +
|
|
22
|
+
'difficulty targeting small controls activate the targets. ' +
|
|
23
|
+
'[Learn more about touch targets](https://dequeuniversity.com/rules/axe/4.7/target-size).',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
27
|
+
|
|
28
|
+
class TargetSize extends AxeAudit {
|
|
29
|
+
/**
|
|
30
|
+
* @return {LH.Audit.Meta}
|
|
31
|
+
*/
|
|
32
|
+
static get meta() {
|
|
33
|
+
return {
|
|
34
|
+
id: 'target-size',
|
|
35
|
+
title: str_(UIStrings.title),
|
|
36
|
+
failureTitle: str_(UIStrings.failureTitle),
|
|
37
|
+
description: str_(UIStrings.description),
|
|
38
|
+
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE,
|
|
39
|
+
requiredArtifacts: ['Accessibility'],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default TargetSize;
|
|
45
|
+
export {UIStrings};
|
package/core/audits/audit.d.ts
CHANGED
|
@@ -159,6 +159,12 @@ export class Audit {
|
|
|
159
159
|
* @return {LH.RawIcu<LH.Audit.Result>}
|
|
160
160
|
*/
|
|
161
161
|
static generateAuditResult(audit: typeof Audit, product: LH.Audit.Product): LH.RawIcu<LH.Audit.Result>;
|
|
162
|
+
/**
|
|
163
|
+
* @param {LH.Artifacts} artifacts
|
|
164
|
+
* @param {LH.Audit.Context} context
|
|
165
|
+
* @returns {LH.Artifacts.MetricComputationDataInput}
|
|
166
|
+
*/
|
|
167
|
+
static makeMetricComputationDataInput(artifacts: LH.Artifacts, context: LH.Audit.Context): LH.Artifacts.MetricComputationDataInput;
|
|
162
168
|
}
|
|
163
169
|
import * as LH from '../../types/lh.js';
|
|
164
170
|
//# sourceMappingURL=audit.d.ts.map
|
package/core/audits/audit.js
CHANGED
|
@@ -415,6 +415,18 @@ class Audit {
|
|
|
415
415
|
details: product.details,
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @param {LH.Artifacts} artifacts
|
|
421
|
+
* @param {LH.Audit.Context} context
|
|
422
|
+
* @returns {LH.Artifacts.MetricComputationDataInput}
|
|
423
|
+
*/
|
|
424
|
+
static makeMetricComputationDataInput(artifacts, context) {
|
|
425
|
+
const trace = artifacts.traces[Audit.DEFAULT_PASS];
|
|
426
|
+
const devtoolsLog = artifacts.devtoolsLogs[Audit.DEFAULT_PASS];
|
|
427
|
+
const gatherContext = artifacts.GatherContext;
|
|
428
|
+
return {trace, devtoolsLog, gatherContext, settings: context.settings, URL: artifacts.URL};
|
|
429
|
+
}
|
|
418
430
|
}
|
|
419
431
|
|
|
420
432
|
export {Audit};
|
|
@@ -49,6 +49,23 @@ export class ByteEfficiencyAudit extends Audit {
|
|
|
49
49
|
* @return {Promise<LH.Audit.Product>}
|
|
50
50
|
*/
|
|
51
51
|
static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): Promise<LH.Audit.Product>;
|
|
52
|
+
/**
|
|
53
|
+
* Computes the estimated effect of all the byte savings on the provided graph.
|
|
54
|
+
*
|
|
55
|
+
* @param {Array<LH.Audit.ByteEfficiencyItem>} results The array of byte savings results per resource
|
|
56
|
+
* @param {Node} graph
|
|
57
|
+
* @param {Simulator} simulator
|
|
58
|
+
* @param {{label?: string, providedWastedBytesByUrl?: Map<string, number>}=} options
|
|
59
|
+
* @return {{savings: number, simulationBeforeChanges: LH.Gatherer.Simulation.Result, simulationAfterChanges: LH.Gatherer.Simulation.Result}}
|
|
60
|
+
*/
|
|
61
|
+
static computeWasteWithGraph(results: Array<LH.Audit.ByteEfficiencyItem>, graph: Node, simulator: Simulator, options?: {
|
|
62
|
+
label?: string;
|
|
63
|
+
providedWastedBytesByUrl?: Map<string, number>;
|
|
64
|
+
} | undefined): {
|
|
65
|
+
savings: number;
|
|
66
|
+
simulationBeforeChanges: LH.Gatherer.Simulation.Result;
|
|
67
|
+
simulationAfterChanges: LH.Gatherer.Simulation.Result;
|
|
68
|
+
};
|
|
52
69
|
/**
|
|
53
70
|
* Computes the estimated effect of all the byte savings on the maximum of the following:
|
|
54
71
|
*
|
|
@@ -58,22 +75,21 @@ export class ByteEfficiencyAudit extends Audit {
|
|
|
58
75
|
* @param {Array<LH.Audit.ByteEfficiencyItem>} results The array of byte savings results per resource
|
|
59
76
|
* @param {Node} graph
|
|
60
77
|
* @param {Simulator} simulator
|
|
61
|
-
* @param {{includeLoad?: boolean,
|
|
78
|
+
* @param {{includeLoad?: boolean, providedWastedBytesByUrl?: Map<string, number>}=} options
|
|
62
79
|
* @return {number}
|
|
63
80
|
*/
|
|
64
81
|
static computeWasteWithTTIGraph(results: Array<LH.Audit.ByteEfficiencyItem>, graph: Node, simulator: Simulator, options?: {
|
|
65
82
|
includeLoad?: boolean;
|
|
66
|
-
label?: string;
|
|
67
83
|
providedWastedBytesByUrl?: Map<string, number>;
|
|
68
84
|
} | undefined): number;
|
|
69
85
|
/**
|
|
70
86
|
* @param {ByteEfficiencyProduct} result
|
|
71
|
-
* @param {Node|null} graph
|
|
72
87
|
* @param {Simulator} simulator
|
|
73
|
-
* @param {LH.Artifacts
|
|
74
|
-
* @
|
|
88
|
+
* @param {LH.Artifacts.MetricComputationDataInput} metricComputationInput
|
|
89
|
+
* @param {LH.Audit.Context} context
|
|
90
|
+
* @return {Promise<LH.Audit.Product>}
|
|
75
91
|
*/
|
|
76
|
-
static createAuditProduct(result: ByteEfficiencyProduct,
|
|
92
|
+
static createAuditProduct(result: ByteEfficiencyProduct, simulator: Simulator, metricComputationInput: LH.Artifacts.MetricComputationDataInput, context: LH.Audit.Context): Promise<LH.Audit.Product>;
|
|
77
93
|
/**
|
|
78
94
|
* @param {LH.Artifacts} artifacts
|
|
79
95
|
* @param {Array<LH.Artifacts.NetworkRequest>} networkRecords
|