lighthouse 9.5.0-dev.20221019 → 9.5.0-dev.20221020

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 (71) 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 +64 -8
  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/package.json +2 -3
  65. package/report/renderer/details-renderer.js +12 -73
  66. package/report/renderer/util.js +27 -0
  67. package/report/test/renderer/details-renderer-test.js +38 -38
  68. package/report/test/renderer/util-test.js +25 -0
  69. package/shared/localization/locales/en-US.json +352 -1
  70. package/shared/localization/locales/en-XL.json +352 -1
  71. package/types/lhr/audit-details.d.ts +4 -34
@@ -134,7 +134,7 @@ class Plugins extends Audit {
134
134
 
135
135
  /** @type {LH.Audit.Details.Table['headings']} */
136
136
  const headings = [
137
- {key: 'source', itemType: 'code', text: 'Element source'},
137
+ {key: 'source', valueType: 'code', label: 'Element source'},
138
138
  ];
139
139
 
140
140
  const details = Audit.makeTableDetails(headings, plugins);
@@ -230,9 +230,9 @@ class RobotsTxt extends Audit {
230
230
 
231
231
  /** @type {LH.Audit.Details.Table['headings']} */
232
232
  const headings = [
233
- {key: 'index', itemType: 'text', text: 'Line #'},
234
- {key: 'line', itemType: 'code', text: 'Content'},
235
- {key: 'message', itemType: 'code', text: 'Error'},
233
+ {key: 'index', valueType: 'text', label: 'Line #'},
234
+ {key: 'line', valueType: 'code', label: 'Content'},
235
+ {key: 'message', valueType: 'code', label: 'Error'},
236
236
  ];
237
237
 
238
238
  const details = Audit.makeTableDetails(headings, validationErrors, {});
@@ -286,9 +286,9 @@ class TapTargets extends Audit {
286
286
 
287
287
  /** @type {LH.Audit.Details.Table['headings']} */
288
288
  const headings = [
289
- {key: 'tapTarget', itemType: 'node', text: str_(UIStrings.tapTargetHeader)},
290
- {key: 'size', itemType: 'text', text: str_(i18n.UIStrings.columnSize)},
291
- {key: 'overlappingTarget', itemType: 'node', text: str_(UIStrings.overlappingTargetHeader)},
289
+ {key: 'tapTarget', valueType: 'node', label: str_(UIStrings.tapTargetHeader)},
290
+ {key: 'size', valueType: 'text', label: str_(i18n.UIStrings.columnSize)},
291
+ {key: 'overlappingTarget', valueType: 'node', label: str_(UIStrings.overlappingTargetHeader)},
292
292
  ];
293
293
 
294
294
  const details = Audit.makeTableDetails(headings, tableItems);
@@ -4,8 +4,6 @@
4
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
5
  */
6
6
 
7
- import cssParsers from 'cssstyle/lib/parsers.js';
8
-
9
7
  import MultiCheckAudit from './multi-check-audit.js';
10
8
  import {ManifestValues} from '../computed/manifest-values.js';
11
9
  import * as i18n from '../lib/i18n/i18n.js';
@@ -28,8 +26,10 @@ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
28
26
  *
29
27
  * Requirements:
30
28
  * * manifest is not empty
31
- * * manifest has a valid theme_color
32
- * * HTML has a valid theme-color meta
29
+ * * manifest has a theme_color
30
+ * * HTML has a theme-color meta
31
+ *
32
+ * Color validity is explicitly not checked.
33
33
  */
34
34
 
35
35
  class ThemedOmnibox extends MultiCheckAudit {
@@ -47,14 +47,6 @@ class ThemedOmnibox extends MultiCheckAudit {
47
47
  };
48
48
  }
49
49
 
50
- /**
51
- * @param {string} color
52
- * @return {boolean}
53
- */
54
- static isValidColor(color) {
55
- return cssParsers.valueType(color) === cssParsers.TYPES.COLOR;
56
- }
57
-
58
50
  /**
59
51
  * @param {LH.Artifacts.MetaElement|undefined} themeColorMeta
60
52
  * @param {Array<string>} failures
@@ -63,8 +55,8 @@ class ThemedOmnibox extends MultiCheckAudit {
63
55
  if (!themeColorMeta) {
64
56
  // TODO(#7238): i18n
65
57
  failures.push('No `<meta name="theme-color">` tag found');
66
- } else if (!ThemedOmnibox.isValidColor(themeColorMeta.content || '')) {
67
- failures.push('The theme-color meta tag did not contain a valid CSS color');
58
+ } else if (!themeColorMeta.content) {
59
+ failures.push('The theme-color meta tag did not contain a content value');
68
60
  }
69
61
  }
70
62
 
@@ -201,9 +201,9 @@ class ThirdPartyFacades extends Audit {
201
201
  /** @type {LH.Audit.Details.Table['headings']} */
202
202
  const headings = [
203
203
  /* eslint-disable max-len */
204
- {key: 'product', itemType: 'text', subItemsHeading: {key: 'url', itemType: 'url'}, text: str_(UIStrings.columnProduct)},
205
- {key: 'transferSize', itemType: 'bytes', subItemsHeading: {key: 'transferSize'}, granularity: 1, text: str_(i18n.UIStrings.columnTransferSize)},
206
- {key: 'blockingTime', itemType: 'ms', subItemsHeading: {key: 'blockingTime'}, granularity: 1, text: str_(i18n.UIStrings.columnBlockingTime)},
204
+ {key: 'product', valueType: 'text', subItemsHeading: {key: 'url', valueType: 'url'}, label: str_(UIStrings.columnProduct)},
205
+ {key: 'transferSize', valueType: 'bytes', subItemsHeading: {key: 'transferSize'}, granularity: 1, label: str_(i18n.UIStrings.columnTransferSize)},
206
+ {key: 'blockingTime', valueType: 'ms', subItemsHeading: {key: 'blockingTime'}, granularity: 1, label: str_(i18n.UIStrings.columnBlockingTime)},
207
207
  /* eslint-enable max-len */
208
208
  ];
209
209
 
@@ -232,9 +232,9 @@ class ThirdPartySummary extends Audit {
232
232
  /** @type {LH.Audit.Details.Table['headings']} */
233
233
  const headings = [
234
234
  /* eslint-disable max-len */
235
- {key: 'entity', itemType: 'link', text: str_(UIStrings.columnThirdParty), subItemsHeading: {key: 'url', itemType: 'url'}},
236
- {key: 'transferSize', granularity: 1, itemType: 'bytes', text: str_(i18n.UIStrings.columnTransferSize), subItemsHeading: {key: 'transferSize'}},
237
- {key: 'blockingTime', granularity: 1, itemType: 'ms', text: str_(i18n.UIStrings.columnBlockingTime), subItemsHeading: {key: 'blockingTime'}},
235
+ {key: 'entity', valueType: 'link', label: str_(UIStrings.columnThirdParty), subItemsHeading: {key: 'url', valueType: 'url'}},
236
+ {key: 'transferSize', granularity: 1, valueType: 'bytes', label: str_(i18n.UIStrings.columnTransferSize), subItemsHeading: {key: 'transferSize'}},
237
+ {key: 'blockingTime', granularity: 1, valueType: 'ms', label: str_(i18n.UIStrings.columnBlockingTime), subItemsHeading: {key: 'blockingTime'}},
238
238
  /* eslint-enable max-len */
239
239
  ];
240
240
 
@@ -154,13 +154,13 @@ class TimingBudget extends Audit {
154
154
 
155
155
  /** @type {LH.Audit.Details.Table['headings']} */
156
156
  const headers = [
157
- {key: 'label', itemType: 'text', text: str_(UIStrings.columnTimingMetric)},
157
+ {key: 'label', valueType: 'text', label: str_(UIStrings.columnTimingMetric)},
158
158
  /**
159
159
  * Note: SpeedIndex, unlike other timing metrics, is not measured in milliseconds.
160
160
  * The renderer applies the correct units to the 'measurement' and 'overBudget' columns for SpeedIndex.
161
161
  */
162
- {key: 'measurement', itemType: 'ms', text: str_(UIStrings.columnMeasurement)},
163
- {key: 'overBudget', itemType: 'ms', text: str_(i18n.UIStrings.columnOverBudget)},
162
+ {key: 'measurement', valueType: 'ms', label: str_(UIStrings.columnMeasurement)},
163
+ {key: 'overBudget', valueType: 'ms', label: str_(i18n.UIStrings.columnOverBudget)},
164
164
  ];
165
165
 
166
166
  return {
@@ -146,8 +146,8 @@ class UnsizedImages extends Audit {
146
146
 
147
147
  /** @type {LH.Audit.Details.Table['headings']} */
148
148
  const headings = [
149
- {key: 'node', itemType: 'node', text: ''},
150
- {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
149
+ {key: 'node', valueType: 'node', label: ''},
150
+ {key: 'url', valueType: 'url', label: str_(i18n.UIStrings.columnURL)},
151
151
  ];
152
152
 
153
153
  return {
@@ -89,12 +89,12 @@ class UserTimings extends Audit {
89
89
 
90
90
  /** @type {LH.Audit.Details.Table['headings']} */
91
91
  const headings = [
92
- {key: 'name', itemType: 'text', text: str_(i18n.UIStrings.columnName)},
93
- {key: 'timingType', itemType: 'text', text: str_(UIStrings.columnType)},
94
- {key: 'startTime', itemType: 'ms', granularity: 0.01,
95
- text: str_(i18n.UIStrings.columnStartTime)},
96
- {key: 'duration', itemType: 'ms', granularity: 0.01,
97
- text: str_(i18n.UIStrings.columnDuration)},
92
+ {key: 'name', valueType: 'text', label: str_(i18n.UIStrings.columnName)},
93
+ {key: 'timingType', valueType: 'text', label: str_(UIStrings.columnType)},
94
+ {key: 'startTime', valueType: 'ms', granularity: 0.01,
95
+ label: str_(i18n.UIStrings.columnStartTime)},
96
+ {key: 'duration', valueType: 'ms', granularity: 0.01,
97
+ label: str_(i18n.UIStrings.columnDuration)},
98
98
  ];
99
99
 
100
100
  const details = Audit.makeTableDetails(headings, tableRows);
@@ -119,11 +119,11 @@ class ValidSourceMaps extends Audit {
119
119
  /* eslint-disable max-len */
120
120
  {
121
121
  key: 'scriptUrl',
122
- itemType: 'url',
122
+ valueType: 'url',
123
123
  subItemsHeading: {key: 'error'},
124
- text: str_(i18n.UIStrings.columnURL),
124
+ label: str_(i18n.UIStrings.columnURL),
125
125
  },
126
- {key: 'sourceMapUrl', itemType: 'url', text: str_(UIStrings.columnMapURL)},
126
+ {key: 'sourceMapUrl', valueType: 'url', label: str_(UIStrings.columnMapURL)},
127
127
  /* eslint-enable max-len */
128
128
  ];
129
129
 
@@ -184,11 +184,11 @@ class WorkDuringInteraction extends Audit {
184
184
  /** @type {LH.Audit.Details.Table['headings']} */
185
185
  const headings = [
186
186
  /* eslint-disable max-len */
187
- {key: 'phase', itemType: 'text', subItemsHeading: {key: 'url', itemType: 'url'}, text: 'Phase'},
188
- {key: 'total', itemType: 'ms', subItemsHeading: {key: 'total', granularity: 1, itemType: 'ms'}, granularity: 1, text: 'Total time'},
189
- {key: null, itemType: 'ms', subItemsHeading: {key: 'scripting', granularity: 1, itemType: 'ms'}, text: 'Script evaluation'},
190
- {key: null, itemType: 'ms', subItemsHeading: {key: 'layout', granularity: 1, itemType: 'ms'}, text: taskGroups.styleLayout.label},
191
- {key: null, itemType: 'ms', subItemsHeading: {key: 'render', granularity: 1, itemType: 'ms'}, text: taskGroups.paintCompositeRender.label},
187
+ {key: 'phase', valueType: 'text', subItemsHeading: {key: 'url', valueType: 'url'}, label: 'Phase'},
188
+ {key: 'total', valueType: 'ms', subItemsHeading: {key: 'total', granularity: 1, valueType: 'ms'}, granularity: 1, label: 'Total time'},
189
+ {key: null, valueType: 'ms', subItemsHeading: {key: 'scripting', granularity: 1, valueType: 'ms'}, label: 'Script evaluation'},
190
+ {key: null, valueType: 'ms', subItemsHeading: {key: 'layout', granularity: 1, valueType: 'ms'}, label: taskGroups.styleLayout.label},
191
+ {key: null, valueType: 'ms', subItemsHeading: {key: 'render', granularity: 1, valueType: 'ms'}, label: taskGroups.paintCompositeRender.label},
192
192
  /* eslint-enable max-len */
193
193
  ];
194
194
 
@@ -208,7 +208,7 @@ class WorkDuringInteraction extends Audit {
208
208
 
209
209
  /** @type {LH.Audit.Details.Table['headings']} */
210
210
  const headings = [
211
- {key: 'node', itemType: 'node', text: str_(UIStrings.eventTarget)},
211
+ {key: 'node', valueType: 'node', label: str_(UIStrings.eventTarget)},
212
212
  ];
213
213
  const elementItems = [{node: Audit.makeNodeItem(responsivenessElement.node)}];
214
214