lighthouse 9.5.0-dev.20221214 → 9.5.0-dev.20221216
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/config/exclusions.js +1 -1
- package/core/audits/accessibility/manual/use-landmarks.js +1 -1
- package/core/audits/dobetterweb/doctype.js +26 -10
- package/core/gather/gatherers/js-usage.js +5 -0
- package/flow-report/test/common-test.tsx +3 -2
- package/package.json +1 -1
- package/shared/localization/locales/en-US.json +3 -0
- package/shared/localization/locales/en-XL.json +3 -0
|
@@ -14,7 +14,7 @@ const exclusions = {
|
|
|
14
14
|
'devtools': [
|
|
15
15
|
// Disabled because normal Chrome usage makes DevTools not function on
|
|
16
16
|
// these poorly constructed pages
|
|
17
|
-
'errors-expired-ssl', 'errors-infinite-loop',
|
|
17
|
+
'errors-expired-ssl', 'errors-infinite-loop',
|
|
18
18
|
// Disabled because Chrome will follow the redirect first, and Lighthouse will
|
|
19
19
|
// only ever see/run the final URL.
|
|
20
20
|
'redirects-client-paint-server', 'redirects-multiple-server',
|
|
@@ -18,7 +18,7 @@ class UseLandmarks extends ManualAudit {
|
|
|
18
18
|
static get meta() {
|
|
19
19
|
return Object.assign({
|
|
20
20
|
id: 'use-landmarks',
|
|
21
|
-
description: 'Landmark elements (
|
|
21
|
+
description: 'Landmark elements (`<main>`, `<nav>`, etc.) are used to improve the keyboard navigation of the page for assistive technology. [Learn more about landmark elements](https://developer.chrome.com/docs/lighthouse/accessibility/use-landmarks/).',
|
|
22
22
|
title: 'HTML5 landmark elements are used to improve navigation',
|
|
23
23
|
}, super.partialMeta);
|
|
24
24
|
}
|
|
@@ -20,6 +20,8 @@ const UIStrings = {
|
|
|
20
20
|
explanationNoDoctype: 'Document must contain a doctype',
|
|
21
21
|
/** Explanatory message stating that the document has wrong doctype */
|
|
22
22
|
explanationWrongDoctype: 'Document contains a doctype that triggers quirks-mode',
|
|
23
|
+
/** Explanatory message stating that the document has wrong doctype */
|
|
24
|
+
explanationLimitedQuirks: 'Document contains a doctype that triggers limited-quirks-mode',
|
|
23
25
|
/** Explanatory message stating that the publicId field is not empty. */
|
|
24
26
|
explanationPublicId: 'Expected publicId to be an empty string',
|
|
25
27
|
/** Explanatory message stating that the systemId field is not empty. */
|
|
@@ -41,6 +43,7 @@ class Doctype extends Audit {
|
|
|
41
43
|
failureTitle: str_(UIStrings.failureTitle),
|
|
42
44
|
description: str_(UIStrings.description),
|
|
43
45
|
requiredArtifacts: ['Doctype'],
|
|
46
|
+
__internalOptionalArtifacts: ['InspectorIssues'],
|
|
44
47
|
};
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -61,6 +64,25 @@ class Doctype extends Audit {
|
|
|
61
64
|
const doctypePublicId = artifacts.Doctype.publicId;
|
|
62
65
|
const doctypeSystemId = artifacts.Doctype.systemId;
|
|
63
66
|
const compatMode = artifacts.Doctype.documentCompatMode;
|
|
67
|
+
const quirksModeIssues = artifacts.InspectorIssues?.quirksModeIssue || [];
|
|
68
|
+
|
|
69
|
+
// Can only determine limited quirks mode with some helps from the protocol via
|
|
70
|
+
// inspector issues. But cannot get inspector issues in snapshot mode, so in that
|
|
71
|
+
// case we cannot distinguish no-quirks-mode from limited-quirks-mode.
|
|
72
|
+
const isLimitedQuirksMode = quirksModeIssues.some(issue => issue.isLimitedQuirksMode);
|
|
73
|
+
|
|
74
|
+
if (compatMode === 'CSS1Compat' && !isLimitedQuirksMode) {
|
|
75
|
+
return {
|
|
76
|
+
score: 1,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (isLimitedQuirksMode) {
|
|
81
|
+
return {
|
|
82
|
+
score: 0,
|
|
83
|
+
explanation: str_(UIStrings.explanationLimitedQuirks),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
64
86
|
|
|
65
87
|
if (doctypePublicId !== '') {
|
|
66
88
|
return {
|
|
@@ -87,16 +109,10 @@ class Doctype extends Audit {
|
|
|
87
109
|
|
|
88
110
|
// Catch-all for any quirks-mode situations the above checks didn't get.
|
|
89
111
|
// https://github.com/GoogleChrome/lighthouse/issues/10030
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
} else {
|
|
96
|
-
return {
|
|
97
|
-
score: 1,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
112
|
+
return {
|
|
113
|
+
score: 0,
|
|
114
|
+
explanation: str_(UIStrings.explanationWrongDoctype),
|
|
115
|
+
};
|
|
100
116
|
}
|
|
101
117
|
}
|
|
102
118
|
|
|
@@ -59,6 +59,11 @@ class JsUsage extends FRGatherer {
|
|
|
59
59
|
continue;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// Scripts run via puppeteer's evaluate interface will have this url.
|
|
63
|
+
if (scriptUsage.url === '__puppeteer_evaluation_script__') {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
usageByScriptId[scriptUsage.scriptId] = scriptUsage;
|
|
63
68
|
}
|
|
64
69
|
|
|
@@ -12,9 +12,10 @@ import {FlowStepThumbnail} from '../src/common';
|
|
|
12
12
|
|
|
13
13
|
let lhr: LH.Result;
|
|
14
14
|
|
|
15
|
-
timers.useFakeTimers();
|
|
16
|
-
|
|
17
15
|
describe('FlowStepThumbnail', () => {
|
|
16
|
+
before(() => timers.useFakeTimers());
|
|
17
|
+
after(() => timers.dispose());
|
|
18
|
+
|
|
18
19
|
beforeEach(() => {
|
|
19
20
|
global.console.warn = jestMock.fn();
|
|
20
21
|
|
package/package.json
CHANGED
|
@@ -635,6 +635,9 @@
|
|
|
635
635
|
"core/audits/dobetterweb/doctype.js | explanationBadDoctype": {
|
|
636
636
|
"message": "Doctype name must be the string `html`"
|
|
637
637
|
},
|
|
638
|
+
"core/audits/dobetterweb/doctype.js | explanationLimitedQuirks": {
|
|
639
|
+
"message": "Document contains a doctype that triggers limited-quirks-mode"
|
|
640
|
+
},
|
|
638
641
|
"core/audits/dobetterweb/doctype.js | explanationNoDoctype": {
|
|
639
642
|
"message": "Document must contain a doctype"
|
|
640
643
|
},
|
|
@@ -635,6 +635,9 @@
|
|
|
635
635
|
"core/audits/dobetterweb/doctype.js | explanationBadDoctype": {
|
|
636
636
|
"message": "D̂óĉt́ŷṕê ńâḿê ḿûśt̂ b́ê t́ĥé ŝt́r̂ín̂ǵ `html`"
|
|
637
637
|
},
|
|
638
|
+
"core/audits/dobetterweb/doctype.js | explanationLimitedQuirks": {
|
|
639
|
+
"message": "D̂óĉúm̂én̂t́ ĉón̂t́âín̂ś â d́ôćt̂ýp̂é t̂h́ât́ t̂ŕîǵĝér̂ś l̂ím̂ít̂éd̂-q́ûír̂ḱŝ-ḿôd́ê"
|
|
640
|
+
},
|
|
638
641
|
"core/audits/dobetterweb/doctype.js | explanationNoDoctype": {
|
|
639
642
|
"message": "D̂óĉúm̂én̂t́ m̂úŝt́ ĉón̂t́âín̂ á d̂óĉt́ŷṕê"
|
|
640
643
|
},
|