lighthouse 9.5.0-dev.20221019 → 9.5.0-dev.20221021

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.
Files changed (81) hide show
  1. package/core/audits/accessibility/axe-audit.js +1 -1
  2. package/core/audits/autocomplete.js +3 -3
  3. package/core/audits/bootup-time.js +5 -5
  4. package/core/audits/byte-efficiency/duplicated-javascript.js +1 -1
  5. package/core/audits/byte-efficiency/legacy-javascript.js +1 -1
  6. package/core/audits/byte-efficiency/total-byte-weight.js +2 -2
  7. package/core/audits/byte-efficiency/uses-long-cache-ttl.js +3 -3
  8. package/core/audits/byte-efficiency/uses-responsive-images-snapshot.js +4 -4
  9. package/core/audits/csp-xss.js +3 -3
  10. package/core/audits/deprecations.js +2 -2
  11. package/core/audits/dobetterweb/dom-size.js +3 -3
  12. package/core/audits/dobetterweb/geolocation-on-start.js +1 -1
  13. package/core/audits/dobetterweb/inspector-issues.js +1 -1
  14. package/core/audits/dobetterweb/js-libraries.js +2 -2
  15. package/core/audits/dobetterweb/no-document-write.js +1 -1
  16. package/core/audits/dobetterweb/notification-on-start.js +1 -1
  17. package/core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +1 -1
  18. package/core/audits/dobetterweb/uses-http2.js +2 -2
  19. package/core/audits/dobetterweb/uses-passive-event-listeners.js +1 -1
  20. package/core/audits/errors-in-console.js +4 -2
  21. package/core/audits/font-display.js +2 -2
  22. package/core/audits/image-aspect-ratio.js +4 -4
  23. package/core/audits/image-size-responsive.js +5 -5
  24. package/core/audits/installable-manifest.js +1 -1
  25. package/core/audits/is-on-https.js +2 -2
  26. package/core/audits/largest-contentful-paint-element.js +1 -1
  27. package/core/audits/layout-shift-elements.js +3 -3
  28. package/core/audits/lcp-lazy-loaded.js +1 -1
  29. package/core/audits/long-tasks.js +3 -3
  30. package/core/audits/main-thread-tasks.js +2 -2
  31. package/core/audits/mainthread-work-breakdown.js +4 -2
  32. package/core/audits/network-requests.js +11 -11
  33. package/core/audits/network-rtt.js +2 -2
  34. package/core/audits/network-server-latency.js +3 -3
  35. package/core/audits/no-unload-listeners.js +1 -1
  36. package/core/audits/non-composited-animations.js +2 -2
  37. package/core/audits/performance-budget.js +5 -5
  38. package/core/audits/preload-fonts.js +1 -1
  39. package/core/audits/resource-summary.js +3 -3
  40. package/core/audits/seo/crawlable-anchors.js +2 -2
  41. package/core/audits/seo/font-size.js +4 -4
  42. package/core/audits/seo/hreflang.js +3 -3
  43. package/core/audits/seo/is-crawlable.js +1 -1
  44. package/core/audits/seo/link-text.js +2 -2
  45. package/core/audits/seo/plugins.js +1 -1
  46. package/core/audits/seo/robots-txt.js +3 -3
  47. package/core/audits/seo/tap-targets.js +3 -3
  48. package/core/audits/themed-omnibox.js +6 -14
  49. package/core/audits/third-party-facades.js +3 -3
  50. package/core/audits/third-party-summary.js +3 -3
  51. package/core/audits/timing-budget.js +3 -3
  52. package/core/audits/unsized-images.js +2 -2
  53. package/core/audits/user-timings.js +6 -6
  54. package/core/audits/valid-source-maps.js +3 -3
  55. package/core/audits/work-during-interaction.js +6 -6
  56. package/core/lib/bfcache-strings.js +655 -0
  57. package/core/lib/deprecations-strings.js +3 -2
  58. package/core/lib/manifest-parser.js +0 -16
  59. package/core/user-flow.js +93 -23
  60. package/core/util.cjs +27 -0
  61. package/dist/report/bundle.esm.js +38 -73
  62. package/dist/report/flow.js +2 -2
  63. package/dist/report/standalone.js +2 -2
  64. package/flow-report/src/app.tsx +1 -1
  65. package/flow-report/src/header.tsx +1 -1
  66. package/flow-report/src/util.ts +1 -1
  67. package/flow-report/src/wrappers/report.tsx +1 -1
  68. package/flow-report/types/flow-report.d.ts +8 -1
  69. package/package.json +2 -3
  70. package/report/generator/report-generator.js +1 -1
  71. package/report/renderer/details-renderer.js +12 -73
  72. package/report/renderer/util.js +27 -0
  73. package/report/test/renderer/details-renderer-test.js +38 -38
  74. package/report/test/renderer/util-test.js +25 -0
  75. package/shared/localization/locales/en-US.json +352 -1
  76. package/shared/localization/locales/en-XL.json +352 -1
  77. package/shared/types/shared.d.ts +2 -2
  78. package/types/global-lh.d.ts +1 -1
  79. package/types/lhr/audit-details.d.ts +4 -34
  80. package/types/lhr/{flow.d.ts → flow-result.d.ts} +3 -7
  81. package/types/user-flow.d.ts +7 -2
@@ -88,7 +88,7 @@ class AxeAudit extends Audit {
88
88
  /** @type {LH.Audit.Details.Table['headings']} */
89
89
  const headings = [
90
90
  /* eslint-disable max-len */
91
- {key: 'node', itemType: 'node', subItemsHeading: {key: 'relatedNode', itemType: 'node'}, text: str_(UIStrings.failingElementsHeader)},
91
+ {key: 'node', valueType: 'node', subItemsHeading: {key: 'relatedNode', valueType: 'node'}, label: str_(UIStrings.failingElementsHeader)},
92
92
  /* eslint-enable max-len */
93
93
  ];
94
94
 
@@ -266,9 +266,9 @@ class AutocompleteAudit extends Audit {
266
266
 
267
267
  /** @type {LH.Audit.Details.Table['headings']} */
268
268
  const headings = [
269
- {key: 'node', itemType: 'node', text: str_(i18n.UIStrings.columnFailingElem)},
270
- {key: 'current', itemType: 'text', text: str_(UIStrings.columnCurrent)},
271
- {key: 'suggestion', itemType: 'text', text: str_(UIStrings.columnSuggestions)},
269
+ {key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnFailingElem)},
270
+ {key: 'current', valueType: 'text', label: str_(UIStrings.columnCurrent)},
271
+ {key: 'suggestion', valueType: 'text', label: str_(UIStrings.columnSuggestions)},
272
272
  ];
273
273
  const details = Audit.makeTableDetails(headings, failingFormsData);
274
274
  let displayValue;
@@ -121,11 +121,11 @@ class BootupTime extends Audit {
121
121
 
122
122
  /** @type {LH.Audit.Details.Table['headings']} */
123
123
  const headings = [
124
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
125
- {key: 'total', granularity: 1, itemType: 'ms', text: str_(UIStrings.columnTotal)},
126
- {key: 'scripting', granularity: 1, itemType: 'ms', text: str_(UIStrings.columnScriptEval)},
127
- {key: 'scriptParseCompile', granularity: 1, itemType: 'ms',
128
- text: str_(UIStrings.columnScriptParse)},
124
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
125
+ {key: 'total', granularity: 1, valueType: 'ms', label: str_(UIStrings.columnTotal)},
126
+ {key: 'scripting', granularity: 1, valueType: 'ms', label: str_(UIStrings.columnScriptEval)},
127
+ {key: 'scriptParseCompile', granularity: 1, valueType: 'ms',
128
+ label: str_(UIStrings.columnScriptParse)},
129
129
  ];
130
130
 
131
131
  const details = BootupTime.makeTableDetails(headings, results, summary);
@@ -225,7 +225,7 @@ class DuplicatedJavascript extends ByteEfficiencyAudit {
225
225
  });
226
226
  }
227
227
 
228
- /** @type {LH.Audit.Details.OpportunityColumnHeading[]} */
228
+ /** @type {LH.Audit.Details.TableColumnHeading[]} */
229
229
  const headings = [
230
230
  /* eslint-disable max-len */
231
231
  {key: 'source', valueType: 'code', subItemsHeading: {key: 'url', valueType: 'url'}, label: str_(i18n.UIStrings.columnSource)},
@@ -455,7 +455,7 @@ class LegacyJavascript extends ByteEfficiencyAudit {
455
455
  }
456
456
  }
457
457
 
458
- /** @type {LH.Audit.Details.OpportunityColumnHeading[]} */
458
+ /** @type {LH.Audit.Details.TableColumnHeading[]} */
459
459
  const headings = [
460
460
  /* eslint-disable max-len */
461
461
  {key: 'url', valueType: 'url', subItemsHeading: {key: 'location', valueType: 'source-location'}, label: str_(i18n.UIStrings.columnURL)},
@@ -89,8 +89,8 @@ class TotalByteWeight extends Audit {
89
89
 
90
90
  /** @type {LH.Audit.Details.Table['headings']} */
91
91
  const headings = [
92
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
93
- {key: 'totalBytes', itemType: 'bytes', text: str_(i18n.UIStrings.columnTransferSize)},
92
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
93
+ {key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
94
94
  ];
95
95
 
96
96
  const tableDetails = Audit.makeTableDetails(headings, results);
@@ -272,11 +272,11 @@ class CacheHeaders extends Audit {
272
272
 
273
273
  /** @type {LH.Audit.Details.Table['headings']} */
274
274
  const headings = [
275
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
275
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
276
276
  // TODO(i18n): pre-compute localized duration
277
- {key: 'cacheLifetimeMs', itemType: 'ms', text: str_(i18n.UIStrings.columnCacheTTL),
277
+ {key: 'cacheLifetimeMs', valueType: 'ms', label: str_(i18n.UIStrings.columnCacheTTL),
278
278
  displayUnit: 'duration'},
279
- {key: 'totalBytes', itemType: 'bytes', text: str_(i18n.UIStrings.columnTransferSize),
279
+ {key: 'totalBytes', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize),
280
280
  displayUnit: 'kb', granularity: 1},
281
281
  ];
282
282
 
@@ -80,10 +80,10 @@ class UsesResponsiveImagesSnapshot extends Audit {
80
80
  /** @type {LH.Audit.Details.Table['headings']} */
81
81
  const headings = [
82
82
  /* eslint-disable max-len */
83
- {key: 'node', itemType: 'node', text: ''},
84
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
85
- {key: 'displayedDimensions', itemType: 'text', text: str_(UIStrings.columnDisplayedDimensions)},
86
- {key: 'actualDimensions', itemType: 'text', text: str_(UIStrings.columnActualDimensions)},
83
+ {key: 'node', valueType: 'node', label: ''},
84
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
85
+ {key: 'displayedDimensions', valueType: 'text', label: str_(UIStrings.columnDisplayedDimensions)},
86
+ {key: 'actualDimensions', valueType: 'text', label: str_(UIStrings.columnActualDimensions)},
87
87
  /* eslint-enable max-len */
88
88
  ];
89
89
 
@@ -163,9 +163,9 @@ class CspXss extends Audit {
163
163
  /** @type {LH.Audit.Details.Table['headings']} */
164
164
  const headings = [
165
165
  /* eslint-disable max-len */
166
- {key: 'description', itemType: 'text', subItemsHeading: {key: 'description'}, text: str_(i18n.UIStrings.columnDescription)},
167
- {key: 'directive', itemType: 'code', subItemsHeading: {key: 'directive'}, text: str_(UIStrings.columnDirective)},
168
- {key: 'severity', itemType: 'text', subItemsHeading: {key: 'severity'}, text: str_(UIStrings.columnSeverity)},
166
+ {key: 'description', valueType: 'text', subItemsHeading: {key: 'description'}, label: str_(i18n.UIStrings.columnDescription)},
167
+ {key: 'directive', valueType: 'code', subItemsHeading: {key: 'directive'}, label: str_(UIStrings.columnDirective)},
168
+ {key: 'severity', valueType: 'text', subItemsHeading: {key: 'severity'}, label: str_(UIStrings.columnSeverity)},
169
169
  /* eslint-enable max-len */
170
170
  ];
171
171
  const details = Audit.makeTableDetails(headings, results);
@@ -92,8 +92,8 @@ class Deprecations extends Audit {
92
92
 
93
93
  /** @type {LH.Audit.Details.Table['headings']} */
94
94
  const headings = [
95
- {key: 'value', itemType: 'text', text: str_(UIStrings.columnDeprecate)},
96
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
95
+ {key: 'value', valueType: 'text', label: str_(UIStrings.columnDeprecate)},
96
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
97
97
  ];
98
98
  const details = Audit.makeTableDetails(headings, deprecations);
99
99
 
@@ -85,9 +85,9 @@ class DOMSize extends Audit {
85
85
 
86
86
  /** @type {LH.Audit.Details.Table['headings']} */
87
87
  const headings = [
88
- {key: 'statistic', itemType: 'text', text: str_(UIStrings.columnStatistic)},
89
- {key: 'node', itemType: 'node', text: str_(i18n.UIStrings.columnElement)},
90
- {key: 'value', itemType: 'numeric', text: str_(UIStrings.columnValue)},
88
+ {key: 'statistic', valueType: 'text', label: str_(UIStrings.columnStatistic)},
89
+ {key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
90
+ {key: 'value', valueType: 'numeric', label: str_(UIStrings.columnValue)},
91
91
  ];
92
92
 
93
93
  /** @type {LH.Audit.Details.Table['items']} */
@@ -52,7 +52,7 @@ class GeolocationOnStart extends ViolationAudit {
52
52
 
53
53
  /** @type {LH.Audit.Details.Table['headings']} */
54
54
  const headings = [
55
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
55
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
56
56
  ];
57
57
  // TODO(bckenny): there should actually be a ts error here. results[0].stackTrace
58
58
  // should violate the results type. Shouldn't be removed from details items regardless.
@@ -152,7 +152,7 @@ class IssuesPanelEntries extends Audit {
152
152
  /** @type {LH.Audit.Details.Table['headings']} */
153
153
  const headings = [
154
154
  /* eslint-disable max-len */
155
- {key: 'issueType', itemType: 'text', subItemsHeading: {key: 'url', itemType: 'url'}, text: str_(UIStrings.columnIssueType)},
155
+ {key: 'issueType', valueType: 'text', subItemsHeading: {key: 'url', valueType: 'url'}, label: str_(UIStrings.columnIssueType)},
156
156
  /* eslint-enable max-len */
157
157
  ];
158
158
 
@@ -54,8 +54,8 @@ class JsLibrariesAudit extends Audit {
54
54
 
55
55
  /** @type {LH.Audit.Details.Table['headings']} */
56
56
  const headings = [
57
- {key: 'name', itemType: 'text', text: str_(i18n.UIStrings.columnName)},
58
- {key: 'version', itemType: 'text', text: str_(UIStrings.columnVersion)},
57
+ {key: 'name', valueType: 'text', label: str_(i18n.UIStrings.columnName)},
58
+ {key: 'version', valueType: 'text', label: str_(UIStrings.columnVersion)},
59
59
  ];
60
60
  const details = Audit.makeTableDetails(headings, libDetails, {});
61
61
 
@@ -68,7 +68,7 @@ class NoDocWriteAudit extends ViolationAudit {
68
68
 
69
69
  /** @type {LH.Audit.Details.Table['headings']} */
70
70
  const headings = [
71
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
71
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
72
72
  ];
73
73
  // TODO(bckenny): see TODO in geolocation-on-start
74
74
  const details = ViolationAudit.makeTableDetails(headings, results);
@@ -52,7 +52,7 @@ class NotificationOnStart extends ViolationAudit {
52
52
 
53
53
  /** @type {LH.Audit.Details.Table['headings']} */
54
54
  const headings = [
55
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
55
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
56
56
  ];
57
57
  // TODO(bckenny): see TODO in geolocation-on-start
58
58
  const details = ViolationAudit.makeTableDetails(headings, results);
@@ -51,7 +51,7 @@ class PasswordInputsCanBePastedIntoAudit extends Audit {
51
51
 
52
52
  /** @type {LH.Audit.Details.Table['headings']} */
53
53
  const headings = [
54
- {key: 'node', itemType: 'node', text: str_(i18n.UIStrings.columnFailingElem)},
54
+ {key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnFailingElem)},
55
55
  ];
56
56
 
57
57
  return {
@@ -214,8 +214,8 @@ class UsesHTTP2Audit extends Audit {
214
214
  if (artifacts.GatherContext.gatherMode === 'timespan') {
215
215
  /** @type {LH.Audit.Details.Table['headings']} */
216
216
  const headings = [
217
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
218
- {key: 'protocol', itemType: 'text', text: str_(UIStrings.columnProtocol)},
217
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
218
+ {key: 'protocol', valueType: 'text', label: str_(UIStrings.columnProtocol)},
219
219
  ];
220
220
 
221
221
  const details = Audit.makeTableDetails(headings, resources);
@@ -51,7 +51,7 @@ class PassiveEventsAudit extends ViolationAudit {
51
51
 
52
52
  /** @type {LH.Audit.Details.Table['headings']} */
53
53
  const headings = [
54
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
54
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
55
55
  ];
56
56
  // TODO(bckenny): see TODO in geolocation-on-start
57
57
  const details = ViolationAudit.makeTableDetails(headings, results);
@@ -100,8 +100,10 @@ class ErrorLogs extends Audit {
100
100
 
101
101
  /** @type {LH.Audit.Details.Table['headings']} */
102
102
  const headings = [
103
- {key: 'sourceLocation', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
104
- {key: 'description', itemType: 'code', text: str_(i18n.UIStrings.columnDescription)},
103
+ /* eslint-disable max-len */
104
+ {key: 'sourceLocation', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
105
+ {key: 'description', valueType: 'code', label: str_(i18n.UIStrings.columnDescription)},
106
+ /* eslint-enable max-len */
105
107
  ];
106
108
 
107
109
  const details = Audit.makeTableDetails(headings, tableRows);
@@ -175,8 +175,8 @@ class FontDisplay extends Audit {
175
175
 
176
176
  /** @type {LH.Audit.Details.Table['headings']} */
177
177
  const headings = [
178
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
179
- {key: 'wastedMs', itemType: 'ms', text: str_(i18n.UIStrings.columnWastedMs)},
178
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
179
+ {key: 'wastedMs', valueType: 'ms', label: str_(i18n.UIStrings.columnWastedMs)},
180
180
  ];
181
181
 
182
182
  const details = Audit.makeTableDetails(headings, results);
@@ -105,10 +105,10 @@ class ImageAspectRatio extends Audit {
105
105
 
106
106
  /** @type {LH.Audit.Details.Table['headings']} */
107
107
  const headings = [
108
- {key: 'node', itemType: 'node', text: ''},
109
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
110
- {key: 'displayedAspectRatio', itemType: 'text', text: str_(UIStrings.columnDisplayed)},
111
- {key: 'actualAspectRatio', itemType: 'text', text: str_(UIStrings.columnActual)},
108
+ {key: 'node', valueType: 'node', label: ''},
109
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
110
+ {key: 'displayedAspectRatio', valueType: 'text', label: str_(UIStrings.columnDisplayed)},
111
+ {key: 'actualAspectRatio', valueType: 'text', label: str_(UIStrings.columnActual)},
112
112
  ];
113
113
 
114
114
  return {
@@ -264,11 +264,11 @@ class ImageSizeResponsive extends Audit {
264
264
 
265
265
  /** @type {LH.Audit.Details.Table['headings']} */
266
266
  const headings = [
267
- {key: 'node', itemType: 'node', text: ''},
268
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
269
- {key: 'displayedSize', itemType: 'text', text: str_(UIStrings.columnDisplayed)},
270
- {key: 'actualSize', itemType: 'text', text: str_(UIStrings.columnActual)},
271
- {key: 'expectedSize', itemType: 'text', text: str_(UIStrings.columnExpected)},
267
+ {key: 'node', valueType: 'node', label: ''},
268
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
269
+ {key: 'displayedSize', valueType: 'text', label: str_(UIStrings.columnDisplayed)},
270
+ {key: 'actualSize', valueType: 'text', label: str_(UIStrings.columnActual)},
271
+ {key: 'expectedSize', valueType: 'text', label: str_(UIStrings.columnExpected)},
272
272
  ];
273
273
 
274
274
  const finalResults = sortResultsBySizeDelta(deduplicateResultsByUrl(results));
@@ -216,7 +216,7 @@ class InstallableManifest extends Audit {
216
216
 
217
217
  /** @type {LH.Audit.Details.Table['headings']} */
218
218
  const headings = [
219
- {key: 'reason', itemType: 'text', text: str_(UIStrings.columnValue)},
219
+ {key: 'reason', valueType: 'text', label: str_(UIStrings.columnValue)},
220
220
  ];
221
221
 
222
222
  // Errors for report table.
@@ -82,8 +82,8 @@ class HTTPS extends Audit {
82
82
 
83
83
  /** @type {LH.Audit.Details.Table['headings']} */
84
84
  const headings = [
85
- {key: 'url', itemType: 'url', text: str_(UIStrings.columnInsecureURL)},
86
- {key: 'resolution', itemType: 'text', text: str_(UIStrings.columnResolution)},
85
+ {key: 'url', valueType: 'url', label: str_(UIStrings.columnInsecureURL)},
86
+ {key: 'resolution', valueType: 'text', label: str_(UIStrings.columnResolution)},
87
87
  ];
88
88
 
89
89
  for (const details of artifacts.InspectorIssues.mixedContentIssue) {
@@ -48,7 +48,7 @@ class LargestContentfulPaintElement extends Audit {
48
48
 
49
49
  /** @type {LH.Audit.Details.Table['headings']} */
50
50
  const headings = [
51
- {key: 'node', itemType: 'node', text: str_(i18n.UIStrings.columnElement)},
51
+ {key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
52
52
  ];
53
53
 
54
54
  const details = Audit.makeTableDetails(headings, lcpElementDetails);
@@ -49,9 +49,9 @@ class LayoutShiftElements extends Audit {
49
49
 
50
50
  /** @type {LH.Audit.Details.Table['headings']} */
51
51
  const headings = [
52
- {key: 'node', itemType: 'node', text: str_(i18n.UIStrings.columnElement)},
53
- {key: 'score', itemType: 'numeric',
54
- granularity: 0.001, text: str_(UIStrings.columnContribution)},
52
+ {key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
53
+ {key: 'score', valueType: 'numeric',
54
+ granularity: 0.001, label: str_(UIStrings.columnContribution)},
55
55
  ];
56
56
 
57
57
  const details = Audit.makeTableDetails(headings, clsElementData);
@@ -64,7 +64,7 @@ class LargestContentfulPaintLazyLoaded extends Audit {
64
64
 
65
65
  /** @type {LH.Audit.Details.Table['headings']} */
66
66
  const headings = [
67
- {key: 'node', itemType: 'node', text: str_(i18n.UIStrings.columnElement)},
67
+ {key: 'node', valueType: 'node', label: str_(i18n.UIStrings.columnElement)},
68
68
  ];
69
69
 
70
70
  const details = Audit.makeTableDetails(headings, [
@@ -98,9 +98,9 @@ class LongTasks extends Audit {
98
98
  /** @type {LH.Audit.Details.Table['headings']} */
99
99
  const headings = [
100
100
  /* eslint-disable max-len */
101
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
102
- {key: 'startTime', itemType: 'ms', granularity: 1, text: str_(i18n.UIStrings.columnStartTime)},
103
- {key: 'duration', itemType: 'ms', granularity: 1, text: str_(i18n.UIStrings.columnDuration)},
101
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
102
+ {key: 'startTime', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnStartTime)},
103
+ {key: 'duration', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnDuration)},
104
104
  /* eslint-enable max-len */
105
105
  ];
106
106
 
@@ -42,8 +42,8 @@ class MainThreadTasks extends Audit {
42
42
 
43
43
  /** @type {LH.Audit.Details.Table['headings']} */
44
44
  const headings = [
45
- {key: 'startTime', itemType: 'ms', granularity: 1, text: 'Start Time'},
46
- {key: 'duration', itemType: 'ms', granularity: 1, text: 'End Time'},
45
+ {key: 'startTime', valueType: 'ms', granularity: 1, label: 'Start Time'},
46
+ {key: 'duration', valueType: 'ms', granularity: 1, label: 'End Time'},
47
47
  ];
48
48
 
49
49
  const tableDetails = Audit.makeTableDetails(headings, results);
@@ -107,8 +107,10 @@ class MainThreadWorkBreakdown extends Audit {
107
107
 
108
108
  /** @type {LH.Audit.Details.Table['headings']} */
109
109
  const headings = [
110
- {key: 'groupLabel', itemType: 'text', text: str_(UIStrings.columnCategory)},
111
- {key: 'duration', itemType: 'ms', granularity: 1, text: str_(i18n.UIStrings.columnTimeSpent)},
110
+ /* eslint-disable max-len */
111
+ {key: 'groupLabel', valueType: 'text', label: str_(UIStrings.columnCategory)},
112
+ {key: 'duration', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnTimeSpent)},
113
+ /* eslint-enable max-len */
112
114
  ];
113
115
 
114
116
  results.sort((a, b) => categoryTotals[b.group] - categoryTotals[a.group]);
@@ -85,27 +85,27 @@ class NetworkRequests extends Audit {
85
85
  // NOTE(i18n): this audit is only for debug info in the LHR and does not appear in the report.
86
86
  /** @type {LH.Audit.Details.Table['headings']} */
87
87
  const headings = [
88
- {key: 'url', itemType: 'url', text: 'URL'},
89
- {key: 'protocol', itemType: 'text', text: 'Protocol'},
90
- {key: 'startTime', itemType: 'ms', granularity: 1, text: 'Start Time'},
91
- {key: 'endTime', itemType: 'ms', granularity: 1, text: 'End Time'},
88
+ {key: 'url', valueType: 'url', label: 'URL'},
89
+ {key: 'protocol', valueType: 'text', label: 'Protocol'},
90
+ {key: 'startTime', valueType: 'ms', granularity: 1, label: 'Start Time'},
91
+ {key: 'endTime', valueType: 'ms', granularity: 1, label: 'End Time'},
92
92
  {
93
93
  key: 'transferSize',
94
- itemType: 'bytes',
94
+ valueType: 'bytes',
95
95
  displayUnit: 'kb',
96
96
  granularity: 1,
97
- text: 'Transfer Size',
97
+ label: 'Transfer Size',
98
98
  },
99
99
  {
100
100
  key: 'resourceSize',
101
- itemType: 'bytes',
101
+ valueType: 'bytes',
102
102
  displayUnit: 'kb',
103
103
  granularity: 1,
104
- text: 'Resource Size',
104
+ label: 'Resource Size',
105
105
  },
106
- {key: 'statusCode', itemType: 'text', text: 'Status Code'},
107
- {key: 'mimeType', itemType: 'text', text: 'MIME Type'},
108
- {key: 'resourceType', itemType: 'text', text: 'Resource Type'},
106
+ {key: 'statusCode', valueType: 'text', label: 'Status Code'},
107
+ {key: 'mimeType', valueType: 'text', label: 'MIME Type'},
108
+ {key: 'resourceType', valueType: 'text', label: 'Resource Type'},
109
109
  ];
110
110
 
111
111
  const tableDetails = Audit.makeTableDetails(headings, results);
@@ -69,8 +69,8 @@ class NetworkRTT extends Audit {
69
69
 
70
70
  /** @type {LH.Audit.Details.Table['headings']} */
71
71
  const headings = [
72
- {key: 'origin', itemType: 'text', text: str_(i18n.UIStrings.columnURL)},
73
- {key: 'rtt', itemType: 'ms', granularity: 1, text: str_(i18n.UIStrings.columnTimeSpent)},
72
+ {key: 'origin', valueType: 'text', label: str_(i18n.UIStrings.columnURL)},
73
+ {key: 'rtt', valueType: 'ms', granularity: 1, label: str_(i18n.UIStrings.columnTimeSpent)},
74
74
  ];
75
75
 
76
76
  const tableDetails = Audit.makeTableDetails(headings, results);
@@ -67,9 +67,9 @@ class NetworkServerLatency extends Audit {
67
67
 
68
68
  /** @type {LH.Audit.Details.Table['headings']} */
69
69
  const headings = [
70
- {key: 'origin', itemType: 'text', text: str_(i18n.UIStrings.columnURL)},
71
- {key: 'serverResponseTime', itemType: 'ms', granularity: 1,
72
- text: str_(i18n.UIStrings.columnTimeSpent)},
70
+ {key: 'origin', valueType: 'text', label: str_(i18n.UIStrings.columnURL)},
71
+ {key: 'serverResponseTime', valueType: 'ms', granularity: 1,
72
+ label: str_(i18n.UIStrings.columnTimeSpent)},
73
73
  ];
74
74
 
75
75
  const tableDetails = Audit.makeTableDetails(headings, results);
@@ -50,7 +50,7 @@ class NoUnloadListeners extends Audit {
50
50
 
51
51
  /** @type {LH.Audit.Details.Table['headings']} */
52
52
  const headings = [
53
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
53
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
54
54
  ];
55
55
 
56
56
  /** @type {Array<{source: LH.Audit.Details.ItemValue}>} */
@@ -173,14 +173,14 @@ class NonCompositedAnimations extends Audit {
173
173
  /** @type {LH.Audit.Details.Table['headings']} */
174
174
  const headings = [
175
175
  /* eslint-disable max-len */
176
- {key: 'node', itemType: 'node', subItemsHeading: {key: 'failureReason', itemType: 'text'}, text: str_(i18n.UIStrings.columnElement)},
176
+ {key: 'node', valueType: 'node', subItemsHeading: {key: 'failureReason', valueType: 'text'}, label: str_(i18n.UIStrings.columnElement)},
177
177
  /* eslint-enable max-len */
178
178
  ];
179
179
 
180
180
  if (shouldAddAnimationNameColumn) {
181
181
  headings.push(
182
182
  /* eslint-disable max-len */
183
- {key: null, itemType: 'text', subItemsHeading: {key: 'animation', itemType: 'text'}, text: str_(i18n.UIStrings.columnName)}
183
+ {key: null, valueType: 'text', subItemsHeading: {key: 'animation', valueType: 'text'}, label: str_(i18n.UIStrings.columnName)}
184
184
  /* eslint-enable max-len */
185
185
  );
186
186
  }
@@ -135,11 +135,11 @@ class ResourceBudget extends Audit {
135
135
 
136
136
  /** @type {LH.Audit.Details.Table['headings']} */
137
137
  const headers = [
138
- {key: 'label', itemType: 'text', text: str_(i18n.UIStrings.columnResourceType)},
139
- {key: 'requestCount', itemType: 'numeric', text: str_(i18n.UIStrings.columnRequests)},
140
- {key: 'transferSize', itemType: 'bytes', text: str_(i18n.UIStrings.columnTransferSize)},
141
- {key: 'countOverBudget', itemType: 'text', text: ''},
142
- {key: 'sizeOverBudget', itemType: 'bytes', text: str_(i18n.UIStrings.columnOverBudget)},
138
+ {key: 'label', valueType: 'text', label: str_(i18n.UIStrings.columnResourceType)},
139
+ {key: 'requestCount', valueType: 'numeric', label: str_(i18n.UIStrings.columnRequests)},
140
+ {key: 'transferSize', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
141
+ {key: 'countOverBudget', valueType: 'text', label: ''},
142
+ {key: 'sizeOverBudget', valueType: 'bytes', label: str_(i18n.UIStrings.columnOverBudget)},
143
143
  ];
144
144
 
145
145
  return {
@@ -82,7 +82,7 @@ class PreloadFontsAudit extends Audit {
82
82
 
83
83
  /** @type {LH.Audit.Details.Table['headings']} */
84
84
  const headings = [
85
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
85
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
86
86
  ];
87
87
 
88
88
  return {
@@ -49,9 +49,9 @@ class ResourceSummary extends Audit {
49
49
 
50
50
  /** @type {LH.Audit.Details.Table['headings']} */
51
51
  const headings = [
52
- {key: 'label', itemType: 'text', text: str_(i18n.UIStrings.columnResourceType)},
53
- {key: 'requestCount', itemType: 'numeric', text: str_(i18n.UIStrings.columnRequests)},
54
- {key: 'transferSize', itemType: 'bytes', text: str_(i18n.UIStrings.columnTransferSize)},
52
+ {key: 'label', valueType: 'text', label: str_(i18n.UIStrings.columnResourceType)},
53
+ {key: 'requestCount', valueType: 'numeric', label: str_(i18n.UIStrings.columnRequests)},
54
+ {key: 'transferSize', valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize)},
55
55
  ];
56
56
 
57
57
 
@@ -71,8 +71,8 @@ class CrawlableAnchors extends Audit {
71
71
  /** @type {LH.Audit.Details.Table['headings']} */
72
72
  const headings = [{
73
73
  key: 'node',
74
- itemType: 'node',
75
- text: str_(UIStrings.columnFailingLink),
74
+ valueType: 'node',
75
+ label: str_(UIStrings.columnFailingLink),
76
76
  }];
77
77
 
78
78
  /** @type {LH.Audit.Details.Table['items']} */
@@ -284,10 +284,10 @@ class FontSize extends Audit {
284
284
 
285
285
  /** @type {LH.Audit.Details.Table['headings']} */
286
286
  const headings = [
287
- {key: 'source', itemType: 'source-location', text: str_(i18n.UIStrings.columnSource)},
288
- {key: 'selector', itemType: 'code', text: str_(UIStrings.columnSelector)},
289
- {key: 'coverage', itemType: 'text', text: str_(UIStrings.columnPercentPageText)},
290
- {key: 'fontSize', itemType: 'text', text: str_(UIStrings.columnFontSize)},
287
+ {key: 'source', valueType: 'source-location', label: str_(i18n.UIStrings.columnSource)},
288
+ {key: 'selector', valueType: 'code', label: str_(UIStrings.columnSelector)},
289
+ {key: 'coverage', valueType: 'text', label: str_(UIStrings.columnPercentPageText)},
290
+ {key: 'fontSize', valueType: 'text', label: str_(UIStrings.columnFontSize)},
291
291
  ];
292
292
 
293
293
  const tableData = failingRules.sort((a, b) => b.textLength - a.textLength)
@@ -127,12 +127,12 @@ class Hreflang extends Audit {
127
127
  /** @type {LH.Audit.Details.Table['headings']} */
128
128
  const headings = [{
129
129
  key: 'source',
130
- itemType: 'code',
130
+ valueType: 'code',
131
131
  subItemsHeading: {
132
132
  key: 'reason',
133
- itemType: 'text',
133
+ valueType: 'text',
134
134
  },
135
- text: '',
135
+ label: '',
136
136
  }];
137
137
 
138
138
  const details = Audit.makeTableDetails(headings, invalidHreflangs);
@@ -138,7 +138,7 @@ class IsCrawlable extends Audit {
138
138
 
139
139
  /** @type {LH.Audit.Details.Table['headings']} */
140
140
  const headings = [
141
- {key: 'source', itemType: 'code', text: 'Blocking Directive Source'},
141
+ {key: 'source', valueType: 'code', label: 'Blocking Directive Source'},
142
142
  ];
143
143
  const details = Audit.makeTableDetails(headings, blockingDirectives);
144
144
 
@@ -137,8 +137,8 @@ class LinkText extends Audit {
137
137
 
138
138
  /** @type {LH.Audit.Details.Table['headings']} */
139
139
  const headings = [
140
- {key: 'href', itemType: 'url', text: 'Link destination'},
141
- {key: 'text', itemType: 'text', text: 'Link Text'},
140
+ {key: 'href', valueType: 'url', label: 'Link destination'},
141
+ {key: 'text', valueType: 'text', label: 'Link Text'},
142
142
  ];
143
143
 
144
144
  const details = Audit.makeTableDetails(headings, failingLinks, {});