lighthouse 12.0.0-dev.20240604 → 12.0.0-dev.20240605
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/aria-allowed-role.js +7 -9
- package/core/lib/lantern/types/lantern.d.ts +5 -1
- package/core/lib/network-request.d.ts +6 -1
- package/core/lib/network-request.js +12 -8
- package/package.json +1 -1
- package/shared/localization/locales/en-US.json +3 -3
- package/shared/localization/locales/en-XL.json +3 -3
|
@@ -13,16 +13,14 @@ import AxeAudit from './axe-audit.js';
|
|
|
13
13
|
import * as i18n from '../../lib/i18n/i18n.js';
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
|
-
/** Title of an
|
|
17
|
-
title: '
|
|
18
|
-
/** Title of an
|
|
19
|
-
failureTitle: '
|
|
16
|
+
/** Title of an accessibility audit that evaluates if the ARIA role attributes are valid for the HTML element. This title is descriptive of the successful state and is shown to users when no user action is required. */
|
|
17
|
+
title: 'Uses ARIA roles only on compatible elements',
|
|
18
|
+
/** Title of an accessibility audit that evaluates if the ARIA role attributes are valid for the HTML element. 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: 'Uses ARIA roles on incompatible elements',
|
|
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: '
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'assistive technologies. ' +
|
|
25
|
-
'[Learn more about ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role).',
|
|
21
|
+
description: 'Many HTML elements can only be assigned certain ARIA roles. Using ARIA ' +
|
|
22
|
+
'roles where they are not allowed can interfere with the accessibility of the web page. ' +
|
|
23
|
+
'[Learn more about ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role).',
|
|
26
24
|
};
|
|
27
25
|
|
|
28
26
|
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
|
|
@@ -60,7 +60,11 @@ export class NetworkRequest<T = any> {
|
|
|
60
60
|
* HTTP cache or going to the network for DNS/connection setup, in milliseconds.
|
|
61
61
|
*/
|
|
62
62
|
networkRequestTime: number;
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* When the last byte of the response headers is received, in milliseconds.
|
|
65
|
+
* Equal to networkRequestTime if no data is recieved over the
|
|
66
|
+
* network (ex: cached requests or data urls).
|
|
67
|
+
*/
|
|
64
68
|
responseHeadersEndTime: number;
|
|
65
69
|
/** When the last byte of the response body is received, in milliseconds. */
|
|
66
70
|
networkEndTime: number;
|
|
@@ -104,7 +104,11 @@ export class NetworkRequest {
|
|
|
104
104
|
* HTTP cache or going to the network for DNS/connection setup, in milliseconds.
|
|
105
105
|
*/
|
|
106
106
|
networkRequestTime: number;
|
|
107
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* When the last byte of the response headers is received, in milliseconds.
|
|
109
|
+
* Equal to networkRequestTime if no data is recieved over the
|
|
110
|
+
* network (ex: cached requests or data urls).
|
|
111
|
+
*/
|
|
108
112
|
responseHeadersEndTime: number;
|
|
109
113
|
/** When the last byte of the response body is received, in milliseconds. */
|
|
110
114
|
networkEndTime: number;
|
|
@@ -203,6 +207,7 @@ export class NetworkRequest {
|
|
|
203
207
|
* @param {LH.Crdp.Network.ResponseReceivedEvent['type']=} resourceType
|
|
204
208
|
*/
|
|
205
209
|
_onResponse(response: LH.Crdp.Network.Response, timestamp: number, resourceType?: LH.Crdp.Network.ResponseReceivedEvent['type'] | undefined): void;
|
|
210
|
+
responseTimestamp: number | undefined;
|
|
206
211
|
/**
|
|
207
212
|
* Resolve differences between conflicting timing signals. Based on the property setters in DevTools.
|
|
208
213
|
* @see https://github.com/ChromeDevTools/devtools-frontend/blob/56a99365197b85c24b732ac92b0ac70feed80179/front_end/sdk/NetworkRequest.js#L485-L502
|
|
@@ -129,7 +129,11 @@ class NetworkRequest {
|
|
|
129
129
|
* HTTP cache or going to the network for DNS/connection setup, in milliseconds.
|
|
130
130
|
*/
|
|
131
131
|
this.networkRequestTime = -1;
|
|
132
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* When the last byte of the response headers is received, in milliseconds.
|
|
134
|
+
* Equal to networkRequestTime if no data is recieved over the
|
|
135
|
+
* network (ex: cached requests or data urls).
|
|
136
|
+
*/
|
|
133
137
|
this.responseHeadersEndTime = -1;
|
|
134
138
|
/** When the last byte of the response body is received, in milliseconds. */
|
|
135
139
|
this.networkEndTime = -1;
|
|
@@ -222,8 +226,9 @@ class NetworkRequest {
|
|
|
222
226
|
this.isSecure = UrlUtils.isSecureScheme(this.parsedURL.scheme);
|
|
223
227
|
|
|
224
228
|
this.rendererStartTime = data.timestamp * 1000;
|
|
225
|
-
//
|
|
229
|
+
// These are expected to be overridden with better value in `_recomputeTimesWithResourceTiming`.
|
|
226
230
|
this.networkRequestTime = this.rendererStartTime;
|
|
231
|
+
this.responseHeadersEndTime = this.rendererStartTime;
|
|
227
232
|
|
|
228
233
|
this.requestMethod = data.request.method;
|
|
229
234
|
|
|
@@ -350,8 +355,7 @@ class NetworkRequest {
|
|
|
350
355
|
|
|
351
356
|
if (response.protocol) this.protocol = response.protocol;
|
|
352
357
|
|
|
353
|
-
|
|
354
|
-
this.responseHeadersEndTime = timestamp * 1000;
|
|
358
|
+
this.responseTimestamp = timestamp * 1000;
|
|
355
359
|
|
|
356
360
|
this.transferSize = response.encodedDataLength;
|
|
357
361
|
this.responseHeadersTransferSize = response.encodedDataLength;
|
|
@@ -381,7 +385,7 @@ class NetworkRequest {
|
|
|
381
385
|
_recomputeTimesWithResourceTiming(timing) {
|
|
382
386
|
// Don't recompute times if the data is invalid. RequestTime should always be a thread timestamp.
|
|
383
387
|
// If we don't have receiveHeadersEnd, we really don't have more accurate data.
|
|
384
|
-
if (timing.requestTime ===
|
|
388
|
+
if (timing.requestTime === -1 || timing.receiveHeadersEnd === -1) return;
|
|
385
389
|
|
|
386
390
|
// Take networkRequestTime and responseHeadersEndTime from timing data for better accuracy.
|
|
387
391
|
// Before this, networkRequestTime and responseHeadersEndTime were set to bogus values based on
|
|
@@ -392,15 +396,15 @@ class NetworkRequest {
|
|
|
392
396
|
// See https://raw.githubusercontent.com/GoogleChrome/lighthouse/main/docs/Network-Timings.svg
|
|
393
397
|
this.networkRequestTime = timing.requestTime * 1000;
|
|
394
398
|
const headersReceivedTime = this.networkRequestTime + timing.receiveHeadersEnd;
|
|
395
|
-
// This was set in `_onResponse` as that event's timestamp.
|
|
396
|
-
const responseTimestamp = this.responseHeadersEndTime;
|
|
397
399
|
|
|
398
400
|
// Update this.responseHeadersEndTime. All timing values from the netstack (timing) are well-ordered, and
|
|
399
401
|
// so are the timestamps from CDP (which this.responseHeadersEndTime belongs to). It shouldn't be possible
|
|
400
402
|
// that this timing from the netstack is greater than the onResponse timestamp, but just to ensure proper order
|
|
401
403
|
// is maintained we bound the new timing by the network request time and the response timestamp.
|
|
402
404
|
this.responseHeadersEndTime = headersReceivedTime;
|
|
403
|
-
|
|
405
|
+
if (this.responseTimestamp !== undefined) {
|
|
406
|
+
this.responseHeadersEndTime = Math.min(this.responseHeadersEndTime, this.responseTimestamp);
|
|
407
|
+
}
|
|
404
408
|
this.responseHeadersEndTime = Math.max(this.responseHeadersEndTime, this.networkRequestTime);
|
|
405
409
|
|
|
406
410
|
// We're only at responseReceived (_onResponse) at this point.
|
package/package.json
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"message": "`[aria-*]` attributes match their roles"
|
|
19
19
|
},
|
|
20
20
|
"core/audits/accessibility/aria-allowed-role.js | description": {
|
|
21
|
-
"message": "
|
|
21
|
+
"message": "Many HTML elements can only be assigned certain ARIA roles. Using ARIA roles where they are not allowed can interfere with the accessibility of the web page. [Learn more about ARIA roles](https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role)."
|
|
22
22
|
},
|
|
23
23
|
"core/audits/accessibility/aria-allowed-role.js | failureTitle": {
|
|
24
|
-
"message": "
|
|
24
|
+
"message": "Uses ARIA roles on incompatible elements"
|
|
25
25
|
},
|
|
26
26
|
"core/audits/accessibility/aria-allowed-role.js | title": {
|
|
27
|
-
"message": "
|
|
27
|
+
"message": "Uses ARIA roles only on compatible elements"
|
|
28
28
|
},
|
|
29
29
|
"core/audits/accessibility/aria-command-name.js | description": {
|
|
30
30
|
"message": "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)."
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"message": "`[aria-*]` ât́t̂ŕîb́ût́êś m̂át̂ćĥ t́ĥéîŕ r̂ól̂éŝ"
|
|
19
19
|
},
|
|
20
20
|
"core/audits/accessibility/aria-allowed-role.js | description": {
|
|
21
|
-
"message": "
|
|
21
|
+
"message": "M̂án̂ý ĤT́M̂Ĺ êĺêḿêńt̂ś ĉán̂ ón̂ĺŷ b́ê áŝśîǵn̂éd̂ ćêŕt̂áîń ÂŔÎÁ r̂ól̂éŝ. Úŝín̂ǵ ÂŔÎÁ r̂ól̂éŝ ẃĥér̂é t̂h́êý âŕê ńôt́ âĺl̂óŵéd̂ ćâń îńt̂ér̂f́êŕê ẃît́ĥ t́ĥé âćĉéŝśîb́îĺît́ŷ óf̂ t́ĥé ŵéb̂ ṕâǵê. [Ĺêár̂ń m̂ór̂é âb́ôút̂ ÁR̂ÍÂ ŕôĺêś](https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role)."
|
|
22
22
|
},
|
|
23
23
|
"core/audits/accessibility/aria-allowed-role.js | failureTitle": {
|
|
24
|
-
"message": "
|
|
24
|
+
"message": "Ûśêś ÂŔÎÁ r̂ól̂éŝ ón̂ ín̂ćôḿp̂át̂íb̂ĺê él̂ém̂én̂t́ŝ"
|
|
25
25
|
},
|
|
26
26
|
"core/audits/accessibility/aria-allowed-role.js | title": {
|
|
27
|
-
"message": "
|
|
27
|
+
"message": "Ûśêś ÂŔÎÁ r̂ól̂éŝ ón̂ĺŷ ón̂ ćôḿp̂át̂íb̂ĺê él̂ém̂én̂t́ŝ"
|
|
28
28
|
},
|
|
29
29
|
"core/audits/accessibility/aria-command-name.js | description": {
|
|
30
30
|
"message": "Ŵh́êń âń êĺêḿêńt̂ d́ôéŝń't̂ h́âv́ê án̂ áĉćêśŝíb̂ĺê ńâḿê, śĉŕêén̂ ŕêád̂ér̂ś âńn̂óûńĉé ît́ ŵít̂h́ â ǵêńêŕîć n̂ám̂é, m̂ák̂ín̂ǵ ît́ ûńûśâb́l̂é f̂ór̂ úŝér̂ś ŵh́ô ŕêĺŷ ón̂ śĉŕêén̂ ŕêád̂ér̂ś. [L̂éâŕn̂ h́ôẃ t̂ó m̂ák̂é ĉóm̂ḿâńd̂ él̂ém̂én̂t́ŝ ḿôŕê áĉćêśŝíb̂ĺê](https://dequeuniversity.com/rules/axe/4.9/aria-command-name)."
|