devtools-tracing 1.1.0 → 1.2.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.
Files changed (528) hide show
  1. package/.claude/settings.local.json +14 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.js +28854 -0
  4. package/package.json +10 -8
  5. package/generate.ts +0 -649
  6. package/index.ts +0 -17
  7. package/lib/extension-api/ExtensionAPI.d.ts +0 -357
  8. package/lib/front_end/core/common/App.ts +0 -7
  9. package/lib/front_end/core/common/AppProvider.ts +0 -32
  10. package/lib/front_end/core/common/Base64.ts +0 -47
  11. package/lib/front_end/core/common/CharacterIdMap.ts +0 -30
  12. package/lib/front_end/core/common/Color.ts +0 -2506
  13. package/lib/front_end/core/common/ColorConverter.ts +0 -402
  14. package/lib/front_end/core/common/ColorUtils.ts +0 -252
  15. package/lib/front_end/core/common/Console.ts +0 -114
  16. package/lib/front_end/core/common/Debouncer.ts +0 -15
  17. package/lib/front_end/core/common/EventTarget.ts +0 -52
  18. package/lib/front_end/core/common/Gzip.ts +0 -74
  19. package/lib/front_end/core/common/JavaScriptMetaData.ts +0 -29
  20. package/lib/front_end/core/common/Lazy.ts +0 -31
  21. package/lib/front_end/core/common/Linkifier.ts +0 -55
  22. package/lib/front_end/core/common/MapWithDefault.ts +0 -26
  23. package/lib/front_end/core/common/Mutex.ts +0 -55
  24. package/lib/front_end/core/common/Object.ts +0 -145
  25. package/lib/front_end/core/common/ParsedURL.ts +0 -554
  26. package/lib/front_end/core/common/Progress.ts +0 -180
  27. package/lib/front_end/core/common/QueryParamHandler.ts +0 -7
  28. package/lib/front_end/core/common/ResolverBase.ts +0 -85
  29. package/lib/front_end/core/common/ResourceType.ts +0 -588
  30. package/lib/front_end/core/common/ReturnToPanel.ts +0 -17
  31. package/lib/front_end/core/common/Revealer.ts +0 -192
  32. package/lib/front_end/core/common/Runnable.ts +0 -41
  33. package/lib/front_end/core/common/SegmentedRange.ts +0 -87
  34. package/lib/front_end/core/common/SettingRegistration.ts +0 -339
  35. package/lib/front_end/core/common/Settings.ts +0 -1497
  36. package/lib/front_end/core/common/SimpleHistoryManager.ts +0 -124
  37. package/lib/front_end/core/common/StringOutputStream.ts +0 -26
  38. package/lib/front_end/core/common/TextDictionary.ts +0 -48
  39. package/lib/front_end/core/common/Throttler.ts +0 -99
  40. package/lib/front_end/core/common/Trie.ts +0 -152
  41. package/lib/front_end/core/common/Worker.ts +0 -60
  42. package/lib/front_end/core/common/common.ts +0 -81
  43. package/lib/front_end/core/host/AidaClient.ts +0 -733
  44. package/lib/front_end/core/host/GdpClient.ts +0 -316
  45. package/lib/front_end/core/host/InspectorFrontendHost.ts +0 -648
  46. package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +0 -551
  47. package/lib/front_end/core/host/Platform.ts +0 -76
  48. package/lib/front_end/core/host/ResourceLoader.ts +0 -282
  49. package/lib/front_end/core/host/UserMetrics.ts +0 -1230
  50. package/lib/front_end/core/host/host.ts +0 -23
  51. package/lib/front_end/core/i18n/ByteUtilities.ts +0 -82
  52. package/lib/front_end/core/i18n/DevToolsLocale.ts +0 -87
  53. package/lib/front_end/core/i18n/NumberFormatter.ts +0 -82
  54. package/lib/front_end/core/i18n/i18n.ts +0 -17
  55. package/lib/front_end/core/i18n/i18nImpl.ts +0 -204
  56. package/lib/front_end/core/i18n/i18nTypes.ts +0 -10
  57. package/lib/front_end/core/i18n/locales.js +0 -14
  58. package/lib/front_end/core/i18n/time-utilities.ts +0 -174
  59. package/lib/front_end/core/platform/ArrayUtilities.ts +0 -271
  60. package/lib/front_end/core/platform/Brand.ts +0 -23
  61. package/lib/front_end/core/platform/Constructor.ts +0 -10
  62. package/lib/front_end/core/platform/DOMUtilities.ts +0 -138
  63. package/lib/front_end/core/platform/DateUtilities.ts +0 -15
  64. package/lib/front_end/core/platform/DevToolsPath.ts +0 -53
  65. package/lib/front_end/core/platform/KeyboardUtilities.ts +0 -38
  66. package/lib/front_end/core/platform/MapUtilities.ts +0 -95
  67. package/lib/front_end/core/platform/MimeType.ts +0 -175
  68. package/lib/front_end/core/platform/NumberUtilities.ts +0 -80
  69. package/lib/front_end/core/platform/StringUtilities.ts +0 -588
  70. package/lib/front_end/core/platform/Timing.ts +0 -17
  71. package/lib/front_end/core/platform/TypedArrayUtilities.ts +0 -189
  72. package/lib/front_end/core/platform/TypescriptUtilities.ts +0 -86
  73. package/lib/front_end/core/platform/UIString.ts +0 -39
  74. package/lib/front_end/core/platform/UserVisibleError.ts +0 -28
  75. package/lib/front_end/core/platform/platform.ts +0 -45
  76. package/lib/front_end/core/protocol_client/ConnectionTransport.ts +0 -26
  77. package/lib/front_end/core/protocol_client/InspectorBackend.ts +0 -1050
  78. package/lib/front_end/core/protocol_client/NodeURL.ts +0 -42
  79. package/lib/front_end/core/protocol_client/protocol_client.ts +0 -13
  80. package/lib/front_end/core/root/Runtime.ts +0 -609
  81. package/lib/front_end/core/root/root.ts +0 -6
  82. package/lib/front_end/core/sdk/AccessibilityModel.ts +0 -353
  83. package/lib/front_end/core/sdk/AnimationModel.ts +0 -1041
  84. package/lib/front_end/core/sdk/AutofillModel.ts +0 -184
  85. package/lib/front_end/core/sdk/CPUProfilerModel.ts +0 -148
  86. package/lib/front_end/core/sdk/CPUThrottlingManager.ts +0 -282
  87. package/lib/front_end/core/sdk/CSSContainerQuery.ts +0 -139
  88. package/lib/front_end/core/sdk/CSSFontFace.ts +0 -40
  89. package/lib/front_end/core/sdk/CSSLayer.ts +0 -30
  90. package/lib/front_end/core/sdk/CSSMatchedStyles.ts +0 -1646
  91. package/lib/front_end/core/sdk/CSSMedia.ts +0 -121
  92. package/lib/front_end/core/sdk/CSSMetadata.ts +0 -1647
  93. package/lib/front_end/core/sdk/CSSModel.ts +0 -1128
  94. package/lib/front_end/core/sdk/CSSProperty.ts +0 -384
  95. package/lib/front_end/core/sdk/CSSPropertyParser.ts +0 -681
  96. package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +0 -1395
  97. package/lib/front_end/core/sdk/CSSQuery.ts +0 -72
  98. package/lib/front_end/core/sdk/CSSRule.ts +0 -465
  99. package/lib/front_end/core/sdk/CSSScope.ts +0 -30
  100. package/lib/front_end/core/sdk/CSSStartingStyle.ts +0 -29
  101. package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +0 -313
  102. package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +0 -196
  103. package/lib/front_end/core/sdk/CSSSupports.ts +0 -33
  104. package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +0 -64
  105. package/lib/front_end/core/sdk/ChildTargetManager.ts +0 -314
  106. package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +0 -62
  107. package/lib/front_end/core/sdk/Connections.ts +0 -293
  108. package/lib/front_end/core/sdk/ConsoleModel.ts +0 -808
  109. package/lib/front_end/core/sdk/ConsoleModelTypes.ts +0 -15
  110. package/lib/front_end/core/sdk/Cookie.ts +0 -319
  111. package/lib/front_end/core/sdk/CookieModel.ts +0 -239
  112. package/lib/front_end/core/sdk/CookieParser.ts +0 -185
  113. package/lib/front_end/core/sdk/DOMDebuggerModel.ts +0 -787
  114. package/lib/front_end/core/sdk/DOMModel.ts +0 -1961
  115. package/lib/front_end/core/sdk/DebuggerModel.ts +0 -1605
  116. package/lib/front_end/core/sdk/EmulationModel.ts +0 -648
  117. package/lib/front_end/core/sdk/EnhancedTracesParser.ts +0 -515
  118. package/lib/front_end/core/sdk/EventBreakpointsModel.ts +0 -183
  119. package/lib/front_end/core/sdk/FrameAssociated.ts +0 -11
  120. package/lib/front_end/core/sdk/FrameManager.ts +0 -259
  121. package/lib/front_end/core/sdk/HeapProfilerModel.ts +0 -225
  122. package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +0 -77
  123. package/lib/front_end/core/sdk/IOModel.ts +0 -91
  124. package/lib/front_end/core/sdk/IsolateManager.ts +0 -257
  125. package/lib/front_end/core/sdk/IssuesModel.ts +0 -70
  126. package/lib/front_end/core/sdk/LayerTreeBase.ts +0 -169
  127. package/lib/front_end/core/sdk/LogModel.ts +0 -56
  128. package/lib/front_end/core/sdk/NetworkManager.ts +0 -2823
  129. package/lib/front_end/core/sdk/NetworkRequest.ts +0 -2253
  130. package/lib/front_end/core/sdk/OverlayColorGenerator.ts +0 -52
  131. package/lib/front_end/core/sdk/OverlayModel.ts +0 -1011
  132. package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -522
  133. package/lib/front_end/core/sdk/PageLoad.ts +0 -35
  134. package/lib/front_end/core/sdk/PageResourceLoader.ts +0 -435
  135. package/lib/front_end/core/sdk/PaintProfiler.ts +0 -110
  136. package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +0 -84
  137. package/lib/front_end/core/sdk/PreloadingModel.ts +0 -863
  138. package/lib/front_end/core/sdk/RehydratingConnection.ts +0 -386
  139. package/lib/front_end/core/sdk/RehydratingObject.ts +0 -66
  140. package/lib/front_end/core/sdk/RemoteObject.ts +0 -1160
  141. package/lib/front_end/core/sdk/Resource.ts +0 -232
  142. package/lib/front_end/core/sdk/ResourceTreeModel.ts +0 -1160
  143. package/lib/front_end/core/sdk/RuntimeModel.ts +0 -732
  144. package/lib/front_end/core/sdk/SDKModel.ts +0 -65
  145. package/lib/front_end/core/sdk/ScopeTreeCache.ts +0 -45
  146. package/lib/front_end/core/sdk/ScreenCaptureModel.ts +0 -255
  147. package/lib/front_end/core/sdk/Script.ts +0 -534
  148. package/lib/front_end/core/sdk/SecurityOriginManager.ts +0 -76
  149. package/lib/front_end/core/sdk/ServerSentEvents.ts +0 -80
  150. package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +0 -122
  151. package/lib/front_end/core/sdk/ServerTiming.ts +0 -260
  152. package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -377
  153. package/lib/front_end/core/sdk/ServiceWorkerManager.ts +0 -605
  154. package/lib/front_end/core/sdk/SourceMap.ts +0 -867
  155. package/lib/front_end/core/sdk/SourceMapCache.ts +0 -54
  156. package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +0 -156
  157. package/lib/front_end/core/sdk/SourceMapManager.ts +0 -239
  158. package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +0 -189
  159. package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +0 -508
  160. package/lib/front_end/core/sdk/StorageBucketsModel.ts +0 -204
  161. package/lib/front_end/core/sdk/StorageKeyManager.ts +0 -98
  162. package/lib/front_end/core/sdk/Target.ts +0 -332
  163. package/lib/front_end/core/sdk/TargetManager.ts +0 -453
  164. package/lib/front_end/core/sdk/TraceObject.ts +0 -61
  165. package/lib/front_end/core/sdk/WebAuthnModel.ts +0 -104
  166. package/lib/front_end/core/sdk/sdk.ts +0 -174
  167. package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -59
  168. package/lib/front_end/generated/InspectorBackendCommands.js +0 -1617
  169. package/lib/front_end/generated/SupportedCSSProperties.js +0 -7512
  170. package/lib/front_end/generated/protocol-proxy-api.d.ts +0 -5022
  171. package/lib/front_end/generated/protocol.ts +0 -22014
  172. package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -318
  173. package/lib/front_end/models/bindings/CompilerScriptMapping.ts +0 -536
  174. package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +0 -187
  175. package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1197
  176. package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -733
  177. package/lib/front_end/models/bindings/DefaultScriptMapping.ts +0 -141
  178. package/lib/front_end/models/bindings/FileUtils.ts +0 -228
  179. package/lib/front_end/models/bindings/LiveLocation.ts +0 -81
  180. package/lib/front_end/models/bindings/NetworkProject.ts +0 -157
  181. package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +0 -312
  182. package/lib/front_end/models/bindings/ResourceMapping.ts +0 -539
  183. package/lib/front_end/models/bindings/ResourceScriptMapping.ts +0 -491
  184. package/lib/front_end/models/bindings/ResourceUtils.ts +0 -103
  185. package/lib/front_end/models/bindings/SASSSourceMapping.ts +0 -222
  186. package/lib/front_end/models/bindings/StylesSourceMapping.ts +0 -316
  187. package/lib/front_end/models/bindings/TempFile.ts +0 -67
  188. package/lib/front_end/models/bindings/bindings.ts +0 -39
  189. package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +0 -571
  190. package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +0 -103
  191. package/lib/front_end/models/cpu_profile/cpu_profile.ts +0 -11
  192. package/lib/front_end/models/formatter/FormatterWorkerPool.ts +0 -219
  193. package/lib/front_end/models/formatter/ScriptFormatter.ts +0 -112
  194. package/lib/front_end/models/formatter/formatter.ts +0 -8
  195. package/lib/front_end/models/source_map_scopes/NamesResolver.ts +0 -765
  196. package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +0 -84
  197. package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +0 -11
  198. package/lib/front_end/models/stack_trace/StackTrace.ts +0 -53
  199. package/lib/front_end/models/stack_trace/StackTraceImpl.ts +0 -85
  200. package/lib/front_end/models/stack_trace/StackTraceModel.ts +0 -128
  201. package/lib/front_end/models/stack_trace/Trie.ts +0 -163
  202. package/lib/front_end/models/stack_trace/stack_trace.ts +0 -9
  203. package/lib/front_end/models/stack_trace/stack_trace_impl.ts +0 -13
  204. package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +0 -37
  205. package/lib/front_end/models/text_utils/ContentData.ts +0 -199
  206. package/lib/front_end/models/text_utils/ContentProvider.ts +0 -68
  207. package/lib/front_end/models/text_utils/StaticContentProvider.ts +0 -49
  208. package/lib/front_end/models/text_utils/StreamingContentData.ts +0 -108
  209. package/lib/front_end/models/text_utils/Text.ts +0 -90
  210. package/lib/front_end/models/text_utils/TextCursor.ts +0 -44
  211. package/lib/front_end/models/text_utils/TextRange.ts +0 -266
  212. package/lib/front_end/models/text_utils/TextUtils.ts +0 -401
  213. package/lib/front_end/models/text_utils/WasmDisassembly.ts +0 -87
  214. package/lib/front_end/models/text_utils/text_utils.ts +0 -27
  215. package/lib/front_end/models/trace/EntityMapper.ts +0 -141
  216. package/lib/front_end/models/trace/EventsSerializer.ts +0 -101
  217. package/lib/front_end/models/trace/LanternComputationData.ts +0 -438
  218. package/lib/front_end/models/trace/ModelImpl.ts +0 -236
  219. package/lib/front_end/models/trace/Name.ts +0 -136
  220. package/lib/front_end/models/trace/Processor.ts +0 -652
  221. package/lib/front_end/models/trace/Styles.ts +0 -1138
  222. package/lib/front_end/models/trace/extras/FilmStrip.ts +0 -78
  223. package/lib/front_end/models/trace/extras/MainThreadActivity.ts +0 -86
  224. package/lib/front_end/models/trace/extras/ScriptDuplication.ts +0 -236
  225. package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +0 -203
  226. package/lib/front_end/models/trace/extras/ThirdParties.ts +0 -164
  227. package/lib/front_end/models/trace/extras/TraceFilter.ts +0 -62
  228. package/lib/front_end/models/trace/extras/TraceTree.ts +0 -701
  229. package/lib/front_end/models/trace/extras/extras.ts +0 -11
  230. package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +0 -128
  231. package/lib/front_end/models/trace/handlers/AnimationHandler.ts +0 -36
  232. package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +0 -239
  233. package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
  234. package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +0 -31
  235. package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -306
  236. package/lib/front_end/models/trace/handlers/FlowsHandler.ts +0 -175
  237. package/lib/front_end/models/trace/handlers/FramesHandler.ts +0 -571
  238. package/lib/front_end/models/trace/handlers/GPUHandler.ts +0 -50
  239. package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +0 -183
  240. package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -193
  241. package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -168
  242. package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +0 -109
  243. package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +0 -35
  244. package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +0 -123
  245. package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +0 -573
  246. package/lib/front_end/models/trace/handlers/MemoryHandler.ts +0 -31
  247. package/lib/front_end/models/trace/handlers/MetaHandler.ts +0 -525
  248. package/lib/front_end/models/trace/handlers/ModelHandlers.ts +0 -34
  249. package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +0 -672
  250. package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +0 -52
  251. package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +0 -460
  252. package/lib/front_end/models/trace/handlers/RendererHandler.ts +0 -428
  253. package/lib/front_end/models/trace/handlers/SamplesHandler.ts +0 -271
  254. package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +0 -122
  255. package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +0 -336
  256. package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +0 -110
  257. package/lib/front_end/models/trace/handlers/Threads.ts +0 -139
  258. package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +0 -400
  259. package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -233
  260. package/lib/front_end/models/trace/handlers/WarningsHandler.ts +0 -162
  261. package/lib/front_end/models/trace/handlers/WorkersHandler.ts +0 -45
  262. package/lib/front_end/models/trace/handlers/handlers.ts +0 -8
  263. package/lib/front_end/models/trace/handlers/helpers.ts +0 -196
  264. package/lib/front_end/models/trace/handlers/types.ts +0 -75
  265. package/lib/front_end/models/trace/helpers/Extensions.ts +0 -54
  266. package/lib/front_end/models/trace/helpers/Network.ts +0 -129
  267. package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +0 -544
  268. package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +0 -87
  269. package/lib/front_end/models/trace/helpers/Timing.ts +0 -248
  270. package/lib/front_end/models/trace/helpers/Trace.ts +0 -928
  271. package/lib/front_end/models/trace/helpers/TreeHelpers.ts +0 -320
  272. package/lib/front_end/models/trace/helpers/helpers.ts +0 -11
  273. package/lib/front_end/models/trace/insights/CLSCulprits.ts +0 -668
  274. package/lib/front_end/models/trace/insights/Cache.ts +0 -269
  275. package/lib/front_end/models/trace/insights/Common.ts +0 -453
  276. package/lib/front_end/models/trace/insights/DOMSize.ts +0 -223
  277. package/lib/front_end/models/trace/insights/DocumentLatency.ts +0 -319
  278. package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +0 -126
  279. package/lib/front_end/models/trace/insights/FontDisplay.ts +0 -119
  280. package/lib/front_end/models/trace/insights/ForcedReflow.ts +0 -220
  281. package/lib/front_end/models/trace/insights/INPBreakdown.ts +0 -171
  282. package/lib/front_end/models/trace/insights/ImageDelivery.ts +0 -348
  283. package/lib/front_end/models/trace/insights/LCPBreakdown.ts +0 -268
  284. package/lib/front_end/models/trace/insights/LCPDiscovery.ts +0 -237
  285. package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +0 -138
  286. package/lib/front_end/models/trace/insights/Models.ts +0 -22
  287. package/lib/front_end/models/trace/insights/ModernHTTP.ts +0 -257
  288. package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +0 -726
  289. package/lib/front_end/models/trace/insights/RenderBlocking.ts +0 -257
  290. package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +0 -175
  291. package/lib/front_end/models/trace/insights/Statistics.ts +0 -101
  292. package/lib/front_end/models/trace/insights/ThirdParties.ts +0 -130
  293. package/lib/front_end/models/trace/insights/Viewport.ts +0 -138
  294. package/lib/front_end/models/trace/insights/insights.ts +0 -10
  295. package/lib/front_end/models/trace/insights/types.ts +0 -157
  296. package/lib/front_end/models/trace/lantern/core/LanternError.ts +0 -7
  297. package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +0 -619
  298. package/lib/front_end/models/trace/lantern/core/core.ts +0 -6
  299. package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +0 -345
  300. package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +0 -80
  301. package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +0 -101
  302. package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +0 -636
  303. package/lib/front_end/models/trace/lantern/graph/graph.ts +0 -8
  304. package/lib/front_end/models/trace/lantern/lantern.ts +0 -17
  305. package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +0 -187
  306. package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +0 -88
  307. package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +0 -92
  308. package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +0 -72
  309. package/lib/front_end/models/trace/lantern/metrics/Metric.ts +0 -126
  310. package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +0 -126
  311. package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +0 -82
  312. package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +0 -112
  313. package/lib/front_end/models/trace/lantern/metrics/metrics.ts +0 -12
  314. package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +0 -150
  315. package/lib/front_end/models/trace/lantern/simulation/Constants.ts +0 -46
  316. package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +0 -61
  317. package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +0 -196
  318. package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +0 -556
  319. package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +0 -192
  320. package/lib/front_end/models/trace/lantern/simulation/simulation.ts +0 -10
  321. package/lib/front_end/models/trace/lantern/types/Lantern.ts +0 -220
  322. package/lib/front_end/models/trace/lantern/types/types.ts +0 -5
  323. package/lib/front_end/models/trace/trace.ts +0 -33
  324. package/lib/front_end/models/trace/types/Configuration.ts +0 -110
  325. package/lib/front_end/models/trace/types/Extensions.ts +0 -136
  326. package/lib/front_end/models/trace/types/File.ts +0 -281
  327. package/lib/front_end/models/trace/types/Overlays.ts +0 -138
  328. package/lib/front_end/models/trace/types/Timing.ts +0 -30
  329. package/lib/front_end/models/trace/types/TraceEvents.ts +0 -3277
  330. package/lib/front_end/models/trace/types/types.ts +0 -10
  331. package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +0 -240
  332. package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +0 -5
  333. package/lib/front_end/models/workspace/FileManager.ts +0 -97
  334. package/lib/front_end/models/workspace/IgnoreListManager.ts +0 -628
  335. package/lib/front_end/models/workspace/SearchConfig.ts +0 -149
  336. package/lib/front_end/models/workspace/UISourceCode.ts +0 -698
  337. package/lib/front_end/models/workspace/WorkspaceImpl.ts +0 -339
  338. package/lib/front_end/models/workspace/workspace.ts +0 -17
  339. package/lib/front_end/panels/timeline/TimelineUIUtils.ts +0 -1029
  340. package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +0 -49
  341. package/lib/front_end/panels/timeline/extensions/extensions.ts +0 -9
  342. package/lib/front_end/third_party/codemirror.next/LICENSE +0 -21
  343. package/lib/front_end/third_party/codemirror.next/README.chromium +0 -30
  344. package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
  345. package/lib/front_end/third_party/codemirror.next/bundle.ts +0 -135
  346. package/lib/front_end/third_party/codemirror.next/chunk/angular.js +0 -2
  347. package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +0 -1
  348. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +0 -2
  349. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +0 -1
  350. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +0 -2
  351. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +0 -1
  352. package/lib/front_end/third_party/codemirror.next/chunk/css.js +0 -2
  353. package/lib/front_end/third_party/codemirror.next/chunk/html.js +0 -4
  354. package/lib/front_end/third_party/codemirror.next/chunk/java.js +0 -2
  355. package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +0 -1
  356. package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +0 -2
  357. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +0 -2
  358. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +0 -1
  359. package/lib/front_end/third_party/codemirror.next/chunk/less.js +0 -2
  360. package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +0 -1
  361. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +0 -2
  362. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +0 -1
  363. package/lib/front_end/third_party/codemirror.next/chunk/php.js +0 -2
  364. package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +0 -1
  365. package/lib/front_end/third_party/codemirror.next/chunk/python.js +0 -2
  366. package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +0 -1
  367. package/lib/front_end/third_party/codemirror.next/chunk/sass.js +0 -2
  368. package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +0 -1
  369. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +0 -2
  370. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +0 -1
  371. package/lib/front_end/third_party/codemirror.next/chunk/vue.js +0 -2
  372. package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +0 -1
  373. package/lib/front_end/third_party/codemirror.next/chunk/wast.js +0 -2
  374. package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +0 -1
  375. package/lib/front_end/third_party/codemirror.next/chunk/xml.js +0 -2
  376. package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +0 -1
  377. package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +0 -8057
  378. package/lib/front_end/third_party/codemirror.next/codemirror.next.js +0 -2
  379. package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +0 -1
  380. package/lib/front_end/third_party/codemirror.next/package.json +0 -43
  381. package/lib/front_end/third_party/codemirror.next/rebuild.sh +0 -6
  382. package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +0 -49
  383. package/lib/front_end/third_party/i18n/LICENSE +0 -202
  384. package/lib/front_end/third_party/i18n/README.chromium +0 -15
  385. package/lib/front_end/third_party/i18n/i18n-impl.ts +0 -61
  386. package/lib/front_end/third_party/i18n/i18n.ts +0 -11
  387. package/lib/front_end/third_party/i18n/localized-string-set.ts +0 -129
  388. package/lib/front_end/third_party/intl-messageformat/LICENSE +0 -33
  389. package/lib/front_end/third_party/intl-messageformat/README.chromium +0 -24
  390. package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
  391. package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +0 -6
  392. package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +0 -33
  393. package/lib/front_end/third_party/intl-messageformat/package/README.md +0 -3
  394. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +0 -6
  395. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +0 -1
  396. package/lib/front_end/third_party/intl-messageformat/package/index.js +0 -13
  397. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +0 -5
  398. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +0 -1710
  399. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +0 -1815
  400. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +0 -6
  401. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +0 -1
  402. package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +0 -10
  403. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +0 -34
  404. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +0 -1
  405. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +0 -229
  406. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +0 -28
  407. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +0 -1
  408. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +0 -48
  409. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +0 -34
  410. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +0 -1
  411. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +0 -179
  412. package/lib/front_end/third_party/intl-messageformat/package/package.json +0 -42
  413. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +0 -34
  414. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +0 -1
  415. package/lib/front_end/third_party/intl-messageformat/package/src/core.js +0 -230
  416. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +0 -28
  417. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +0 -1
  418. package/lib/front_end/third_party/intl-messageformat/package/src/error.js +0 -51
  419. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +0 -34
  420. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +0 -1
  421. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +0 -182
  422. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +0 -79
  423. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +0 -15
  424. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +0 -153
  425. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +0 -139
  426. package/lib/front_end/third_party/legacy-javascript/LICENSE +0 -202
  427. package/lib/front_end/third_party/legacy-javascript/README.chromium +0 -13
  428. package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
  429. package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +0 -3
  430. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +0 -18
  431. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +0 -943
  432. package/lib/front_end/third_party/legacy-javascript/package.json +0 -8
  433. package/lib/front_end/third_party/legacy-javascript/rebuild.sh +0 -9
  434. package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +0 -26
  435. package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +0 -31
  436. package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -33
  437. package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -26
  438. package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +0 -64
  439. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -62
  440. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +0 -1
  441. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -37
  442. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -1
  443. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -29
  444. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -1
  445. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -8
  446. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -1
  447. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -6
  448. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -1
  449. package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +0 -21
  450. package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +0 -14
  451. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +0 -196
  452. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +0 -1
  453. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +0 -262
  454. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -235
  455. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -1
  456. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -359
  457. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -39
  458. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -1
  459. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -53
  460. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -438
  461. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -1
  462. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -539
  463. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -23
  464. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -1
  465. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -35
  466. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -257
  467. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -1
  468. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -348
  469. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -8
  470. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -1
  471. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -20
  472. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
  473. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -184
  474. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -9
  475. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -1
  476. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -12
  477. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -82
  478. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -1
  479. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -99
  480. package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +0 -5
  481. package/lib/front_end/third_party/third-party-web/LICENSE +0 -20
  482. package/lib/front_end/third_party/third-party-web/README.chromium +0 -13
  483. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
  484. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +0 -149
  485. package/lib/front_end/third_party/third-party-web/package/LICENSE +0 -20
  486. package/lib/front_end/third_party/third-party-web/package/README.md +0 -929
  487. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +0 -1
  488. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +0 -1
  489. package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +0 -1
  490. package/lib/front_end/third_party/third-party-web/package/dist/entities.json +0 -1
  491. package/lib/front_end/third_party/third-party-web/package/facades.md +0 -46
  492. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +0 -1
  493. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +0 -1
  494. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +0 -1
  495. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +0 -1
  496. package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +0 -1006
  497. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +0 -139
  498. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +0 -44
  499. package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +0 -27
  500. package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +0 -34
  501. package/lib/front_end/third_party/third-party-web/package/lib/index.js +0 -3
  502. package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +0 -246
  503. package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +0 -36
  504. package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +0 -9
  505. package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +0 -5
  506. package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +0 -151
  507. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +0 -1
  508. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +0 -1
  509. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +0 -1
  510. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +0 -14
  511. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +0 -1
  512. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +0 -3
  513. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +0 -1
  514. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +0 -3
  515. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +0 -1
  516. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +0 -3
  517. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
  518. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +0 -3
  519. package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +0 -1
  520. package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +0 -1
  521. package/lib/front_end/third_party/third-party-web/package/package.json +0 -46
  522. package/lib/front_end/third_party/third-party-web/package.json +0 -8
  523. package/lib/front_end/third_party/third-party-web/rebuild.sh +0 -13
  524. package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
  525. package/lib/front_end/third_party/third-party-web/third-party-web.ts +0 -3
  526. package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +0 -222
  527. package/lib/front_end/ui/legacy/theme_support/theme_support.ts +0 -5
  528. package/patches/chrome-devtools-frontend+1.0.1533544.patch +0 -1716
@@ -1,348 +0,0 @@
1
- // Copyright 2024 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as i18n from '../../../core/i18n/i18n.js';
6
- import type * as Handlers from '../handlers/handlers.js';
7
- import * as Helpers from '../helpers/helpers.js';
8
- import type * as Types from '../types/types.js';
9
-
10
- import {metricSavingsForWastedBytes} from './Common.js';
11
- import {
12
- InsightCategory,
13
- InsightKeys,
14
- type InsightModel,
15
- type InsightSetContext,
16
- type PartialInsightModel,
17
- } from './types.js';
18
-
19
- export const UIStrings = {
20
- /**
21
- * @description Title of an insight that recommends ways to reduce the size of images downloaded and used on the page.
22
- */
23
- title: 'Improve image delivery',
24
- /**
25
- * @description Description of an insight that recommends ways to reduce the size of images downloaded and used on the page.
26
- */
27
- description:
28
- 'Reducing the download time of images can improve the perceived load time of the page and LCP. [Learn more about optimizing image size](https://developer.chrome.com/docs/performance/insights/image-delivery)',
29
- /**
30
- * @description Message displayed in a chip explaining that an image file size is large for the # of pixels it has and recommends possible adjustments to improve the image size.
31
- */
32
- useCompression: 'Increasing the image compression factor could improve this image\'s download size.',
33
- /**
34
- * @description Message displayed in a chip explaining that an image file size is large for the # of pixels it has and recommends possible adjustments to improve the image size.
35
- */
36
- useModernFormat:
37
- 'Using a modern image format (WebP, AVIF) or increasing the image compression could improve this image\'s download size.',
38
- /**
39
- * @description Message displayed in a chip advising the user to use video formats instead of GIFs because videos generally have smaller file sizes.
40
- */
41
- useVideoFormat: 'Using video formats instead of GIFs can improve the download size of animated content.',
42
- /**
43
- * @description Message displayed in a chip explaining that an image was displayed on the page with dimensions much smaller than the image file dimensions.
44
- * @example {1000x500} PH1
45
- * @example {100x50} PH2
46
- */
47
- useResponsiveSize:
48
- 'This image file is larger than it needs to be ({PH1}) for its displayed dimensions ({PH2}). Use responsive images to reduce the image download size.',
49
- /**
50
- * @description Column header for a table column containing network requests for images which can improve their file size (e.g. use a different format, increase compression, etc).
51
- */
52
- optimizeFile: 'Optimize file size',
53
- /**
54
- * @description Table row value representing the remaining items not shown in the table due to size constraints. This row will always represent at least 2 items.
55
- * @example {5} PH1
56
- */
57
- others: '{PH1} others',
58
- /**
59
- * @description Text status indicating that no potential optimizations were found for any image file
60
- */
61
- noOptimizableImages: 'No optimizable images',
62
- /**
63
- * @description Text describing the estimated number of bytes that an image file optimization can save. This text is appended to another block of text describing the image optimization in more detail. "Est" means "Estimated".
64
- * @example {Use the correct image dimensions to reduce the image file size.} PH1
65
- * @example {50 MB} PH2
66
- */
67
- estimatedSavings: '{PH1} (Est {PH2})',
68
- } as const;
69
-
70
- const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ImageDelivery.ts', UIStrings);
71
- export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
72
-
73
- /**
74
- * Even JPEGs with lots of detail can usually be compressed down to <1 byte per pixel
75
- * Using 4:2:2 subsampling already gets an uncompressed bitmap to 2 bytes per pixel.
76
- * The compression ratio for JPEG is usually somewhere around 10:1 depending on content, so
77
- * 8:1 is a reasonable expectation for web content which is 1.5MB for a 6MP image.
78
- *
79
- * WebP usually gives ~20% additional savings on top of that, so we will assume 10:1 for WebP.
80
- * This is quite pessimistic as their study shows a photographic compression ratio of ~29:1.
81
- * https://developers.google.com/speed/webp/docs/webp_lossless_alpha_study#results
82
- *
83
- * AVIF usually gives ~20% additional savings on top of WebP, so we will use 12:1 for AVIF.
84
- * This is quite pessimistic as Netflix study shows a photographic compression ratio of ~40:1
85
- * (0.4 *bits* per pixel at SSIM 0.97).
86
- * https://netflixtechblog.com/avif-for-next-generation-image-coding-b1d75675fe4
87
- */
88
- const TARGET_BYTES_PER_PIXEL_AVIF = 2 * 1 / 12;
89
-
90
- /**
91
- * If GIFs are above this size, we'll flag them
92
- * See https://github.com/GoogleChrome/lighthouse/pull/4885#discussion_r178406623 and https://github.com/GoogleChrome/lighthouse/issues/4696#issuecomment-370979920
93
- */
94
- const GIF_SIZE_THRESHOLD = 100 * 1024;
95
-
96
- const BYTE_SAVINGS_THRESHOLD = 4096;
97
-
98
- // Ignore up to 12KB of waste for responsive images if an effort was made with breakpoints.
99
- const BYTE_SAVINGS_THRESHOLD_RESPONSIVE_BREAKPOINTS = 12288;
100
-
101
- export enum ImageOptimizationType {
102
- ADJUST_COMPRESSION = 'ADJUST_COMPRESSION',
103
- MODERN_FORMAT_OR_COMPRESSION = 'MODERN_FORMAT_OR_COMPRESSION',
104
- VIDEO_FORMAT = 'VIDEO_FORMAT',
105
- RESPONSIVE_SIZE = 'RESPONSIVE_SIZE',
106
- }
107
-
108
- export type ImageOptimization = {
109
- type: Exclude<ImageOptimizationType, ImageOptimizationType.RESPONSIVE_SIZE>,
110
- byteSavings: number,
111
- }|{
112
- type: ImageOptimizationType.RESPONSIVE_SIZE,
113
- byteSavings: number,
114
- fileDimensions: {width: number, height: number},
115
- displayDimensions: {width: number, height: number},
116
- };
117
-
118
- export interface OptimizableImage {
119
- request: Types.Events.SyntheticNetworkRequest;
120
- optimizations: ImageOptimization[];
121
- byteSavings: number;
122
- /**
123
- * If the an image resource has multiple `PaintImage`s, we compare its intrinsic size to the largest of the displayed sizes.
124
- *
125
- * It is theoretically possible for `PaintImage` events with the same URL to have different intrinsic sizes.
126
- * However, this should be rare because it requires serving different images from the same URL.
127
- */
128
- largestImagePaint: Types.Events.PaintImage;
129
- }
130
-
131
- export type ImageDeliveryInsightModel = InsightModel<typeof UIStrings, {
132
- /** Sorted by potential byte savings, then by size of image. */
133
- optimizableImages: OptimizableImage[],
134
- wastedBytes: number,
135
- }>;
136
-
137
- export function isImageDeliveryInsight(model: InsightModel): model is ImageDeliveryInsightModel {
138
- return model.insightKey === 'ImageDelivery';
139
- }
140
-
141
- export function getOptimizationMessage(optimization: ImageOptimization): string {
142
- switch (optimization.type) {
143
- case ImageOptimizationType.ADJUST_COMPRESSION:
144
- return i18nString(UIStrings.useCompression);
145
- case ImageOptimizationType.MODERN_FORMAT_OR_COMPRESSION:
146
- return i18nString(UIStrings.useModernFormat);
147
- case ImageOptimizationType.VIDEO_FORMAT:
148
- return i18nString(UIStrings.useVideoFormat);
149
- case ImageOptimizationType.RESPONSIVE_SIZE:
150
- return i18nString(UIStrings.useResponsiveSize, {
151
- PH1: `${optimization.fileDimensions.width}x${optimization.fileDimensions.height}`,
152
- PH2: `${optimization.displayDimensions.width}x${optimization.displayDimensions.height}`,
153
- });
154
- }
155
- }
156
-
157
- export function getOptimizationMessageWithBytes(optimization: ImageOptimization): string {
158
- const byteSavingsText = i18n.ByteUtilities.bytesToString(optimization.byteSavings);
159
- const optimizationMessage = getOptimizationMessage(optimization);
160
- return i18nString(UIStrings.estimatedSavings, {PH1: optimizationMessage, PH2: byteSavingsText});
161
- }
162
-
163
- function finalize(partialModel: PartialInsightModel<ImageDeliveryInsightModel>): ImageDeliveryInsightModel {
164
- return {
165
- insightKey: InsightKeys.IMAGE_DELIVERY,
166
- strings: UIStrings,
167
- title: i18nString(UIStrings.title),
168
- description: i18nString(UIStrings.description),
169
- docs: 'https://developer.chrome.com/docs/performance/insights/image-delivery',
170
- category: InsightCategory.LCP,
171
- state: partialModel.optimizableImages.length > 0 ? 'fail' : 'pass',
172
- ...partialModel,
173
- relatedEvents: new Map(partialModel.optimizableImages.map(
174
- image => [image.request, image.optimizations.map(getOptimizationMessageWithBytes)])),
175
- };
176
- }
177
-
178
- /**
179
- * Calculate rough savings percentage based on 1000 real gifs transcoded to video
180
- * https://github.com/GoogleChrome/lighthouse/issues/4696#issuecomment-380296510
181
- */
182
- function estimateGIFPercentSavings(request: Types.Events.SyntheticNetworkRequest): number {
183
- return Math.round((29.1 * Math.log10(request.args.data.decodedBodyLength) - 100.7)) / 100;
184
- }
185
-
186
- function getDisplayedSize(
187
- data: Handlers.Types.HandlerData, paintImage: Types.Events.PaintImage): {width: number, height: number} {
188
- // Note: for traces made prior to metadata.hostDPR (which means no data in
189
- // paintEventToCorrectedDisplaySize), the displayed size unexpectedly ignores any
190
- // emulated DPR and so the results may be very misleading.
191
- return data.ImagePainting.paintEventToCorrectedDisplaySize.get(paintImage) ?? {
192
- width: paintImage.args.data.width,
193
- height: paintImage.args.data.height,
194
- };
195
- }
196
-
197
- function getPixelCounts(data: Handlers.Types.HandlerData, paintImage: Types.Events.PaintImage):
198
- {displayedPixels: number, filePixels: number} {
199
- const {width, height} = getDisplayedSize(data, paintImage);
200
- return {
201
- filePixels: paintImage.args.data.srcWidth * paintImage.args.data.srcHeight,
202
- displayedPixels: width * height,
203
- };
204
- }
205
-
206
- export function generateInsight(
207
- data: Handlers.Types.HandlerData, context: InsightSetContext): ImageDeliveryInsightModel {
208
- const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
209
-
210
- const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
211
-
212
- const optimizableImages: OptimizableImage[] = [];
213
- for (const request of contextRequests) {
214
- if (request.args.data.resourceType !== 'Image') {
215
- continue;
216
- }
217
-
218
- if (request.args.data.mimeType === 'image/svg+xml') {
219
- continue;
220
- }
221
-
222
- // If the request was redirected, the image paints will have the pre-redirect URL.
223
- const url = request.args.data.redirects[0]?.url ?? request.args.data.url;
224
- const imagePaints = data.ImagePainting.paintImageEventForUrl.get(url)?.filter(isWithinContext);
225
-
226
- // This will filter out things like preloaded image requests where an image file is downloaded
227
- // but never rendered on the page.
228
- if (!imagePaints?.length) {
229
- continue;
230
- }
231
-
232
- const largestImagePaint = imagePaints.reduce((prev, curr) => {
233
- const prevPixels = getPixelCounts(data, prev).displayedPixels;
234
- const currPixels = getPixelCounts(data, curr).displayedPixels;
235
- return prevPixels > currPixels ? prev : curr;
236
- });
237
-
238
- const {
239
- filePixels: imageFilePixels,
240
- displayedPixels: largestImageDisplayPixels,
241
- } = getPixelCounts(data, largestImagePaint);
242
-
243
- // Decoded body length is almost always the right one to be using because of the below:
244
- // `encodedDataLength = decodedBodyLength + headers`.
245
- // HOWEVER, there are some cases where an image is compressed again over the network and transfer size
246
- // is smaller (see https://github.com/GoogleChrome/lighthouse/pull/4968).
247
- // Use the min of the two numbers to be safe.
248
- const imageBytes = Math.min(request.args.data.decodedBodyLength, request.args.data.encodedDataLength);
249
-
250
- const bytesPerPixel = imageBytes / imageFilePixels;
251
-
252
- let optimizations: ImageOptimization[] = [];
253
- if (request.args.data.mimeType === 'image/gif') {
254
- if (imageBytes > GIF_SIZE_THRESHOLD) {
255
- const percentSavings = estimateGIFPercentSavings(request);
256
- const byteSavings = Math.round(imageBytes * percentSavings);
257
- optimizations.push({type: ImageOptimizationType.VIDEO_FORMAT, byteSavings});
258
- }
259
- } else if (bytesPerPixel > TARGET_BYTES_PER_PIXEL_AVIF) {
260
- const idealAvifImageSize = Math.round(TARGET_BYTES_PER_PIXEL_AVIF * imageFilePixels);
261
- const byteSavings = imageBytes - idealAvifImageSize;
262
- if (request.args.data.mimeType !== 'image/webp' && request.args.data.mimeType !== 'image/avif') {
263
- optimizations.push({type: ImageOptimizationType.MODERN_FORMAT_OR_COMPRESSION, byteSavings});
264
- } else {
265
- optimizations.push({type: ImageOptimizationType.ADJUST_COMPRESSION, byteSavings});
266
- }
267
- }
268
-
269
- // At this point (before looking at image size), the # of optimizations should only ever be 1 or 0
270
- // Math.max handles both cases correctly, and is defensive against future patches that would add
271
- // more than 1 format-specific optimization by this point.
272
- const imageByteSavingsFromFormat = Math.max(0, ...optimizations.map(o => o.byteSavings));
273
- let imageByteSavings = imageByteSavingsFromFormat;
274
-
275
- const wastedPixelRatio = 1 - (largestImageDisplayPixels / imageFilePixels);
276
-
277
- // Ignore CSS images because it's difficult to determine what is a spritesheet,
278
- // and the reward-to-effort ratio for responsive CSS images is quite low https://css-tricks.com/responsive-images-css/.
279
- if (wastedPixelRatio > 0 && !largestImagePaint.args.data.isCSS) {
280
- const byteSavings = Math.round(wastedPixelRatio * imageBytes);
281
-
282
- const hadBreakpoints = largestImagePaint.args.data.isPicture || largestImagePaint.args.data.srcsetAttribute;
283
- if (!hadBreakpoints || byteSavings > BYTE_SAVINGS_THRESHOLD_RESPONSIVE_BREAKPOINTS) {
284
- // This will compound the byte savings from any potential format changes with the image size
285
- // optimization added here.
286
- imageByteSavings += Math.round(wastedPixelRatio * (imageBytes - imageByteSavingsFromFormat));
287
-
288
- const {width, height} = getDisplayedSize(data, largestImagePaint);
289
-
290
- optimizations.push({
291
- type: ImageOptimizationType.RESPONSIVE_SIZE,
292
- byteSavings,
293
- fileDimensions: {
294
- width: Math.round(largestImagePaint.args.data.srcWidth),
295
- height: Math.round(largestImagePaint.args.data.srcHeight),
296
- },
297
- displayDimensions: {
298
- width: Math.round(width),
299
- height: Math.round(height),
300
- },
301
- });
302
- }
303
- }
304
-
305
- optimizations = optimizations.filter(optimization => optimization.byteSavings > BYTE_SAVINGS_THRESHOLD);
306
-
307
- if (optimizations.length > 0) {
308
- optimizableImages.push({
309
- request,
310
- largestImagePaint,
311
- optimizations,
312
- byteSavings: imageByteSavings,
313
- });
314
- }
315
- }
316
-
317
- const wastedBytesByRequestId = new Map<string, number>();
318
- for (const image of optimizableImages) {
319
- wastedBytesByRequestId.set(image.request.args.data.requestId, image.byteSavings);
320
- }
321
-
322
- // Sort by savings, then by size of image.
323
- optimizableImages.sort((a, b) => {
324
- if (b.byteSavings !== a.byteSavings) {
325
- return b.byteSavings - a.byteSavings;
326
- }
327
-
328
- return b.request.args.data.decodedBodyLength - a.request.args.data.decodedBodyLength;
329
- });
330
-
331
- return finalize({
332
- optimizableImages,
333
- metricSavings: metricSavingsForWastedBytes(wastedBytesByRequestId, context),
334
- wastedBytes: optimizableImages.reduce((total, img) => total + img.byteSavings, 0),
335
- });
336
- }
337
-
338
- export function createOverlayForRequest(request: Types.Events.SyntheticNetworkRequest): Types.Overlays.EntryOutline {
339
- return {
340
- type: 'ENTRY_OUTLINE',
341
- entry: request,
342
- outlineReason: 'ERROR',
343
- };
344
- }
345
-
346
- export function createOverlays(model: ImageDeliveryInsightModel): Types.Overlays.Overlay[] {
347
- return model.optimizableImages.map(image => createOverlayForRequest(image.request));
348
- }
@@ -1,268 +0,0 @@
1
- // Copyright 2024 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import type * as Common from '../../../core/common/common.js';
6
- import * as i18n from '../../../core/i18n/i18n.js';
7
- import * as Handlers from '../handlers/handlers.js';
8
- import * as Helpers from '../helpers/helpers.js';
9
- import * as Types from '../types/types.js';
10
-
11
- import {calculateDocFirstByteTs} from './Common.js';
12
- import {
13
- InsightCategory,
14
- InsightKeys,
15
- type InsightModel,
16
- type InsightSetContext,
17
- InsightWarning,
18
- type PartialInsightModel,
19
- } from './types.js';
20
-
21
- export const UIStrings = {
22
- /**
23
- * @description Title of an insight that provides details about the LCP metric, broken down by parts.
24
- */
25
- title: 'LCP breakdown',
26
- /**
27
- * @description Description of a DevTools insight that presents a breakdown for the LCP metric by subparts.
28
- * This is displayed after a user expands the section to see more. No character length limits.
29
- */
30
- description:
31
- 'Each [subpart has specific improvement strategies](https://developer.chrome.com/docs/performance/insights/lcp-breakdown). Ideally, most of the LCP time should be spent on loading the resources, not within delays.',
32
- /**
33
- * @description Time to first byte title for the Largest Contentful Paint's subparts timespan breakdown.
34
- */
35
- timeToFirstByte: 'Time to first byte',
36
- /**
37
- * @description Resource load delay title for the Largest Contentful Paint subparts timespan breakdown.
38
- */
39
- resourceLoadDelay: 'Resource load delay',
40
- /**
41
- * @description Resource load duration title for the Largest Contentful Paint subparts timespan breakdown.
42
- */
43
- resourceLoadDuration: 'Resource load duration',
44
- /**
45
- * @description Element render delay title for the Largest Contentful Paint subparts timespan breakdown.
46
- */
47
- elementRenderDelay: 'Element render delay',
48
- /**
49
- * @description Label used for the subpart (section) of a larger duration.
50
- */
51
- subpart: 'Subpart',
52
- /**
53
- * @description Label used for the duration a single subpart (section) takes up of a larger duration.
54
- */
55
- duration: 'Duration',
56
- /**
57
- * @description Label used for the duration a single subpart (section) takes up of a larger duration. The value will be the 75th percentile of aggregate data. "Field" means that the data was collected from real users in the field as opposed to the developers local environment. "Field" is synonymous with "Real user data".
58
- */
59
- fieldDuration: 'Field p75',
60
- /**
61
- * @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. "LCP" is an acronym and should not be translated.
62
- */
63
- noLcp: 'No LCP detected',
64
- } as const;
65
- const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LCPBreakdown.ts', UIStrings);
66
- export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
67
-
68
- /** A TraceWindow plus its UIString. **/
69
- export type Subpart = Types.Timing.TraceWindowMicro&{label: Common.UIString.LocalizedString};
70
- interface LCPSubparts {
71
- /**
72
- * The time between when the user initiates loading the page until when
73
- * the browser receives the first byte of the html response.
74
- */
75
- ttfb: Subpart;
76
- /**
77
- * The time between ttfb and the LCP request request being started.
78
- * For a text LCP, this is undefined given no request is loaded.
79
- */
80
- loadDelay?: Subpart;
81
- /**
82
- * The time it takes to load the LCP request.
83
- */
84
- loadDuration?: Subpart;
85
- /**
86
- * The time between when the LCP request finishes loading and when
87
- * the LCP element is rendered.
88
- */
89
- renderDelay: Subpart;
90
- }
91
-
92
- export function isLCPBreakdownInsight(model: InsightModel): model is LCPBreakdownInsightModel {
93
- return model.insightKey === 'LCPBreakdown';
94
- }
95
- export type LCPBreakdownInsightModel = InsightModel<typeof UIStrings, {
96
- lcpMs?: Types.Timing.Milli,
97
- lcpTs?: Types.Timing.Milli,
98
- lcpEvent?: Types.Events.LargestContentfulPaintCandidate,
99
- /** The network request for the LCP image, if there was one. */
100
- lcpRequest?: Types.Events.SyntheticNetworkRequest,
101
- subparts?: LCPSubparts,
102
- }>;
103
-
104
- function anyValuesNaN(...values: number[]): boolean {
105
- return values.some(v => Number.isNaN(v));
106
- }
107
- /**
108
- * Calculates the 2–4 subparts of an LCP as bounds.
109
- * Will return `null` if any required values were missing. We don't ever expect
110
- * them to be missing on newer traces, but old trace files may lack some of the
111
- * data we rely on, so we want to handle that case.
112
- */
113
- function determineSubparts(
114
- nav: Types.Events.NavigationStart, docRequest: Types.Events.SyntheticNetworkRequest,
115
- lcpEvent: Types.Events.LargestContentfulPaintCandidate,
116
- lcpRequest: Types.Events.SyntheticNetworkRequest|undefined): LCPSubparts|null {
117
- const firstDocByteTs = calculateDocFirstByteTs(docRequest);
118
- if (firstDocByteTs === null) {
119
- return null;
120
- }
121
-
122
- const ttfb = Helpers.Timing.traceWindowFromMicroSeconds(nav.ts, firstDocByteTs) as Subpart;
123
- ttfb.label = i18nString(UIStrings.timeToFirstByte);
124
-
125
- let renderDelay = Helpers.Timing.traceWindowFromMicroSeconds(ttfb.max, lcpEvent.ts) as Subpart;
126
- renderDelay.label = i18nString(UIStrings.elementRenderDelay);
127
-
128
- // If the LCP is text, we don't have a request, so just 2 subparts.
129
- if (!lcpRequest) {
130
- /**
131
- * Text LCP. 2 subparts, thus 3 timestamps
132
- *
133
- * | ttfb | renderDelay |
134
- * ^ lcpEvent.ts
135
- * ^ firstDocByteTs
136
- * ^ navStartTs
137
- */
138
- if (anyValuesNaN(ttfb.range, renderDelay.range)) {
139
- return null;
140
- }
141
- return {ttfb, renderDelay};
142
- }
143
-
144
- /**
145
- * Image LCP. 4 subparts means 5 timestamps
146
- *
147
- * | ttfb | loadDelay | loadTime | renderDelay |
148
- * ^ lcpEvent.ts
149
- * ^ lcpReqEndTs
150
- * ^ lcpStartTs
151
- * ^ ttfbTs
152
- * ^ navStartTs
153
- */
154
- const lcpStartTs = lcpRequest.ts;
155
- const lcpReqEndTs = lcpRequest.args.data.syntheticData.finishTime;
156
-
157
- const loadDelay = Helpers.Timing.traceWindowFromMicroSeconds(ttfb.max, lcpStartTs) as Subpart;
158
- const loadDuration = Helpers.Timing.traceWindowFromMicroSeconds(lcpStartTs, lcpReqEndTs) as Subpart;
159
- renderDelay = Helpers.Timing.traceWindowFromMicroSeconds(lcpReqEndTs, lcpEvent.ts) as Subpart;
160
- loadDelay.label = i18nString(UIStrings.resourceLoadDelay);
161
- loadDuration.label = i18nString(UIStrings.resourceLoadDuration);
162
- renderDelay.label = i18nString(UIStrings.elementRenderDelay);
163
- if (anyValuesNaN(ttfb.range, loadDelay.range, loadDuration.range, renderDelay.range)) {
164
- return null;
165
- }
166
-
167
- return {
168
- ttfb,
169
- loadDelay,
170
- loadDuration,
171
- renderDelay,
172
- };
173
- }
174
-
175
- function finalize(partialModel: PartialInsightModel<LCPBreakdownInsightModel>): LCPBreakdownInsightModel {
176
- const relatedEvents = [];
177
- if (partialModel.lcpEvent) {
178
- relatedEvents.push(partialModel.lcpEvent);
179
- }
180
- if (partialModel.lcpRequest) {
181
- relatedEvents.push(partialModel.lcpRequest);
182
- }
183
-
184
- let state: LCPBreakdownInsightModel['state'] = 'pass';
185
- if (partialModel.lcpMs !== undefined) {
186
- const classification = Handlers.ModelHandlers.PageLoadMetrics.scoreClassificationForLargestContentfulPaint(
187
- Helpers.Timing.milliToMicro(partialModel.lcpMs));
188
- if (classification === Handlers.ModelHandlers.PageLoadMetrics.ScoreClassification.GOOD) {
189
- state = 'informative';
190
- } else {
191
- state = 'fail';
192
- }
193
- }
194
-
195
- return {
196
- insightKey: InsightKeys.LCP_BREAKDOWN,
197
- strings: UIStrings,
198
- title: i18nString(UIStrings.title),
199
- description: i18nString(UIStrings.description),
200
- docs: 'https://developer.chrome.com/docs/performance/insights/lcp-breakdown',
201
- category: InsightCategory.LCP,
202
- state,
203
- ...partialModel,
204
- relatedEvents,
205
- };
206
- }
207
-
208
- export function generateInsight(
209
- data: Handlers.Types.HandlerData, context: InsightSetContext): LCPBreakdownInsightModel {
210
- if (!context.navigation) {
211
- return finalize({});
212
- }
213
-
214
- const networkRequests = data.NetworkRequests;
215
-
216
- const frameMetrics = data.PageLoadMetrics.metricScoresByFrameId.get(context.frameId);
217
- if (!frameMetrics) {
218
- throw new Error('no frame metrics');
219
- }
220
-
221
- const navMetrics = frameMetrics.get(context.navigationId);
222
- if (!navMetrics) {
223
- throw new Error('no navigation metrics');
224
- }
225
- const metricScore = navMetrics.get(Handlers.ModelHandlers.PageLoadMetrics.MetricName.LCP);
226
- const lcpEvent = metricScore?.event;
227
- if (!lcpEvent || !Types.Events.isLargestContentfulPaintCandidate(lcpEvent)) {
228
- return finalize({warnings: [InsightWarning.NO_LCP]});
229
- }
230
-
231
- // This helps calculate the subparts.
232
- const lcpMs = Helpers.Timing.microToMilli(metricScore.timing);
233
- // This helps position things on the timeline's UI accurately for a trace.
234
- const lcpTs = metricScore.event?.ts ? Helpers.Timing.microToMilli(metricScore.event?.ts) : undefined;
235
- const lcpRequest = data.LargestImagePaint.lcpRequestByNavigationId.get(context.navigationId);
236
-
237
- const docRequest = networkRequests.byId.get(context.navigationId);
238
- if (!docRequest) {
239
- return finalize({lcpMs, lcpTs, lcpEvent, lcpRequest, warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});
240
- }
241
-
242
- return finalize({
243
- lcpMs,
244
- lcpTs,
245
- lcpEvent,
246
- lcpRequest,
247
- subparts: determineSubparts(context.navigation, docRequest, lcpEvent, lcpRequest) ?? undefined,
248
- });
249
- }
250
-
251
- export function createOverlays(model: LCPBreakdownInsightModel): Types.Overlays.Overlay[] {
252
- if (!model.subparts || !model.lcpTs) {
253
- return [];
254
- }
255
-
256
- const overlays: Types.Overlays.Overlay[] = [
257
- {
258
- type: 'TIMESPAN_BREAKDOWN',
259
- sections: Object.values(model.subparts)
260
- .map((subpart: Subpart) => ({bounds: subpart, label: subpart.label, showDuration: true})),
261
- },
262
- ];
263
- if (model.lcpRequest) {
264
- overlays.push({type: 'ENTRY_OUTLINE', entry: model.lcpRequest, outlineReason: 'INFO'});
265
- }
266
-
267
- return overlays;
268
- }