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,668 +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 * as Platform from '../../../core/platform/platform.js';
7
- import type * as Protocol from '../../../generated/protocol.js';
8
- import * as Handlers from '../handlers/handlers.js';
9
- import * as Helpers from '../helpers/helpers.js';
10
- import * as Types from '../types/types.js';
11
-
12
- import {
13
- InsightCategory,
14
- InsightKeys,
15
- type InsightModel,
16
- type InsightSetContext,
17
- type PartialInsightModel,
18
- } from './types.js';
19
-
20
- export const UIStrings = {
21
- /** Title of an insight that provides details about why elements shift/move on the page. The causes for these shifts are referred to as culprits ("reasons"). */
22
- title: 'Layout shift culprits',
23
- /**
24
- * @description Description of a DevTools insight that identifies the reasons that elements shift on the page.
25
- * This is displayed after a user expands the section to see more. No character length limits.
26
- */
27
- description:
28
- 'Layout shifts occur when elements move absent any user interaction. [Investigate the causes of layout shifts](https://developer.chrome.com/docs/performance/insights/cls-culprit), such as elements being added, removed, or their fonts changing as the page loads.',
29
- /**
30
- * @description Text indicating the worst layout shift cluster.
31
- */
32
- worstLayoutShiftCluster: 'Worst layout shift cluster',
33
- /**
34
- * @description Text indicating the worst layout shift cluster.
35
- */
36
- worstCluster: 'Worst cluster',
37
- /**
38
- * @description Text indicating a layout shift cluster and its start time.
39
- * @example {32 ms} PH1
40
- */
41
- layoutShiftCluster: 'Layout shift cluster @ {PH1}',
42
- /**
43
- * @description Text indicating the biggest reasons for the layout shifts.
44
- */
45
- topCulprits: 'Top layout shift culprits',
46
- /**
47
- * @description Text for a culprit type of Injected iframe.
48
- */
49
- injectedIframe: 'Injected iframe',
50
- /**
51
- * @description Text for a culprit type of web font request.
52
- */
53
- webFont: 'Web font',
54
- /**
55
- * @description Text for a culprit type of Animation.
56
- */
57
- animation: 'Animation',
58
- /**
59
- * @description Text for a culprit type of Unsized image.
60
- */
61
- unsizedImage: 'Unsized image element',
62
- /**
63
- * @description Text status when there were no layout shifts detected.
64
- */
65
- noLayoutShifts: 'No layout shifts',
66
- /**
67
- * @description Text status when there no layout shifts culprits/root causes were found.
68
- */
69
- noCulprits: 'Could not detect any layout shift culprits',
70
- } as const;
71
-
72
- const str_ = i18n.i18n.registerUIStrings('models/trace/insights/CLSCulprits.ts', UIStrings);
73
- export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
74
-
75
- export type CLSCulpritsInsightModel = InsightModel<typeof UIStrings, {
76
- animationFailures: readonly NoncompositedAnimationFailure[],
77
- shifts: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>,
78
- clusters: Types.Events.SyntheticLayoutShiftCluster[],
79
- worstCluster: Types.Events.SyntheticLayoutShiftCluster | undefined,
80
- /** The top 3 shift root causes for each cluster. */
81
- topCulpritsByCluster: Map<Types.Events.SyntheticLayoutShiftCluster, LayoutShiftItem[]>,
82
- }>;
83
-
84
- export const enum AnimationFailureReasons {
85
- ACCELERATED_ANIMATIONS_DISABLED = 'ACCELERATED_ANIMATIONS_DISABLED',
86
- EFFECT_SUPPRESSED_BY_DEVTOOLS = 'EFFECT_SUPPRESSED_BY_DEVTOOLS',
87
- INVALID_ANIMATION_OR_EFFECT = 'INVALID_ANIMATION_OR_EFFECT',
88
- EFFECT_HAS_UNSUPPORTED_TIMING_PARAMS = 'EFFECT_HAS_UNSUPPORTED_TIMING_PARAMS',
89
- EFFECT_HAS_NON_REPLACE_COMPOSITE_MODE = 'EFFECT_HAS_NON_REPLACE_COMPOSITE_MODE',
90
- TARGET_HAS_INVALID_COMPOSITING_STATE = 'TARGET_HAS_INVALID_COMPOSITING_STATE',
91
- TARGET_HAS_INCOMPATIBLE_ANIMATIONS = 'TARGET_HAS_INCOMPATIBLE_ANIMATIONS',
92
- TARGET_HAS_CSS_OFFSET = 'TARGET_HAS_CSS_OFFSET',
93
- ANIMATION_AFFECTS_NON_CSS_PROPERTIES = 'ANIMATION_AFFECTS_NON_CSS_PROPERTIES',
94
- TRANSFORM_RELATED_PROPERTY_CANNOT_BE_ACCELERATED_ON_TARGET =
95
- 'TRANSFORM_RELATED_PROPERTY_CANNOT_BE_ACCELERATED_ON_TARGET',
96
- TRANSFROM_BOX_SIZE_DEPENDENT = 'TRANSFROM_BOX_SIZE_DEPENDENT',
97
- FILTER_RELATED_PROPERTY_MAY_MOVE_PIXELS = 'FILTER_RELATED_PROPERTY_MAY_MOVE_PIXELS',
98
- UNSUPPORTED_CSS_PROPERTY = 'UNSUPPORTED_CSS_PROPERTY',
99
- MIXED_KEYFRAME_VALUE_TYPES = 'MIXED_KEYFRAME_VALUE_TYPES',
100
- TIMELINE_SOURCE_HAS_INVALID_COMPOSITING_STATE = 'TIMELINE_SOURCE_HAS_INVALID_COMPOSITING_STATE',
101
- ANIMATION_HAS_NO_VISIBLE_CHANGE = 'ANIMATION_HAS_NO_VISIBLE_CHANGE',
102
- AFFECTS_IMPORTANT_PROPERTY = 'AFFECTS_IMPORTANT_PROPERTY',
103
- SVG_TARGET_HAS_INDEPENDENT_TRANSFORM_PROPERTY = 'SVG_TARGET_HAS_INDEPENDENT_TRANSFORM_PROPERTY',
104
- }
105
-
106
- export const enum LayoutShiftType {
107
- WEB_FONT = 0,
108
- IFRAMES = 1,
109
- ANIMATIONS = 2,
110
- UNSIZED_IMAGE = 3,
111
- }
112
-
113
- export type LayoutShiftItem = {
114
- type: LayoutShiftType.UNSIZED_IMAGE,
115
- description: Platform.UIString.LocalizedString,
116
- url: string,
117
- backendNodeId: Protocol.DOM.BackendNodeId,
118
- frame: string,
119
- }|{
120
- type: Exclude<LayoutShiftType, LayoutShiftType.UNSIZED_IMAGE>,
121
- description: Platform.UIString.LocalizedString,
122
- };
123
-
124
- export interface NoncompositedAnimationFailure {
125
- /**
126
- * Animation name.
127
- */
128
- name?: string;
129
- /**
130
- * Failure reason based on mask number defined in
131
- * https://source.chromium.org/search?q=f:compositor_animations.h%20%22enum%20FailureReason%22.
132
- */
133
- failureReasons: AnimationFailureReasons[];
134
- /**
135
- * Unsupported properties.
136
- */
137
- unsupportedProperties?: Types.Events.Animation['args']['data']['unsupportedProperties'];
138
- /**
139
- * Animation event.
140
- */
141
- animation?: Types.Events.SyntheticAnimationPair;
142
- }
143
-
144
- /**
145
- * Each failure reason is represented by a bit flag. The bit shift operator '<<' is used to define
146
- * which bit corresponds to each failure reason.
147
- * https://source.chromium.org/search?q=f:compositor_animations.h%20%22enum%20FailureReason%22
148
- */
149
- const ACTIONABLE_FAILURE_REASONS: Array<{
150
- flag: number,
151
- failure: AnimationFailureReasons,
152
- }> =
153
- [
154
- {
155
- flag: 1 << 0,
156
- failure: AnimationFailureReasons.ACCELERATED_ANIMATIONS_DISABLED,
157
- },
158
- {
159
- flag: 1 << 1,
160
- failure: AnimationFailureReasons.EFFECT_SUPPRESSED_BY_DEVTOOLS,
161
- },
162
- {
163
- flag: 1 << 2,
164
- failure: AnimationFailureReasons.INVALID_ANIMATION_OR_EFFECT,
165
- },
166
- {
167
- flag: 1 << 3,
168
- failure: AnimationFailureReasons.EFFECT_HAS_UNSUPPORTED_TIMING_PARAMS,
169
- },
170
- {
171
- flag: 1 << 4,
172
- failure: AnimationFailureReasons.EFFECT_HAS_NON_REPLACE_COMPOSITE_MODE,
173
- },
174
- {
175
- flag: 1 << 5,
176
- failure: AnimationFailureReasons.TARGET_HAS_INVALID_COMPOSITING_STATE,
177
- },
178
- {
179
- flag: 1 << 6,
180
- failure: AnimationFailureReasons.TARGET_HAS_INCOMPATIBLE_ANIMATIONS,
181
- },
182
- {
183
- flag: 1 << 7,
184
- failure: AnimationFailureReasons.TARGET_HAS_CSS_OFFSET,
185
- },
186
- // The failure 1 << 8 is marked as obsolete in Blink
187
- {
188
- flag: 1 << 9,
189
- failure: AnimationFailureReasons.ANIMATION_AFFECTS_NON_CSS_PROPERTIES,
190
- },
191
- {
192
- flag: 1 << 10,
193
- failure: AnimationFailureReasons.TRANSFORM_RELATED_PROPERTY_CANNOT_BE_ACCELERATED_ON_TARGET,
194
- },
195
- {
196
- flag: 1 << 11,
197
- failure: AnimationFailureReasons.TRANSFROM_BOX_SIZE_DEPENDENT,
198
- },
199
- {
200
- flag: 1 << 12,
201
- failure: AnimationFailureReasons.FILTER_RELATED_PROPERTY_MAY_MOVE_PIXELS,
202
- },
203
- {
204
- flag: 1 << 13,
205
- failure: AnimationFailureReasons.UNSUPPORTED_CSS_PROPERTY,
206
- },
207
- // The failure 1 << 14 is marked as obsolete in Blink
208
- {
209
- flag: 1 << 15,
210
- failure: AnimationFailureReasons.MIXED_KEYFRAME_VALUE_TYPES,
211
- },
212
- {
213
- flag: 1 << 16,
214
- failure: AnimationFailureReasons.TIMELINE_SOURCE_HAS_INVALID_COMPOSITING_STATE,
215
- },
216
- {
217
- flag: 1 << 17,
218
- failure: AnimationFailureReasons.ANIMATION_HAS_NO_VISIBLE_CHANGE,
219
- },
220
- {
221
- flag: 1 << 18,
222
- failure: AnimationFailureReasons.AFFECTS_IMPORTANT_PROPERTY,
223
- },
224
- {
225
- flag: 1 << 19,
226
- failure: AnimationFailureReasons.SVG_TARGET_HAS_INDEPENDENT_TRANSFORM_PROPERTY,
227
- },
228
- ] as const;
229
-
230
- // 500ms window.
231
- // Use this window to consider events and requests that may have caused a layout shift.
232
- const ROOT_CAUSE_WINDOW = Helpers.Timing.secondsToMicro(Types.Timing.Seconds(0.5));
233
-
234
- export interface UnsizedImage {
235
- backendNodeId: Protocol.DOM.BackendNodeId;
236
- paintImageEvent: Types.Events.PaintImage;
237
- }
238
-
239
- export interface IframeRootCause {
240
- frame: string;
241
- url?: string;
242
- }
243
-
244
- export interface LayoutShiftRootCausesData {
245
- iframes: IframeRootCause[];
246
- webFonts: Types.Events.SyntheticNetworkRequest[];
247
- nonCompositedAnimations: NoncompositedAnimationFailure[];
248
- unsizedImages: UnsizedImage[];
249
- }
250
-
251
- /**
252
- * Returns if an event happens within the root cause window, before the target event.
253
- * ROOT_CAUSE_WINDOW v target event
254
- * |------------------------|=======================
255
- */
256
- function isInRootCauseWindow(event: Types.Events.Event, targetEvent: Types.Events.Event): boolean {
257
- const eventEnd = event.dur ? event.ts + event.dur : event.ts;
258
- return eventEnd < targetEvent.ts && eventEnd >= targetEvent.ts - ROOT_CAUSE_WINDOW;
259
- }
260
-
261
- export function getNonCompositedFailure(animationEvent: Types.Events.SyntheticAnimationPair):
262
- NoncompositedAnimationFailure[] {
263
- const failures: NoncompositedAnimationFailure[] = [];
264
- const beginEvent = animationEvent.args.data.beginEvent;
265
- const instantEvents = animationEvent.args.data.instantEvents || [];
266
- /**
267
- * Animation events containing composite information are ASYNC_NESTABLE_INSTANT ('n').
268
- * An animation may also contain multiple 'n' events, so we look through those with useful non-composited data.
269
- */
270
- for (const event of instantEvents) {
271
- const failureMask = event.args.data.compositeFailed;
272
- const unsupportedProperties = event.args.data.unsupportedProperties;
273
- if (!failureMask) {
274
- continue;
275
- }
276
- const failureReasons =
277
- ACTIONABLE_FAILURE_REASONS.filter(reason => failureMask & reason.flag).map(reason => reason.failure);
278
- const failure: NoncompositedAnimationFailure = {
279
- name: beginEvent.args.data.displayName,
280
- failureReasons,
281
- unsupportedProperties,
282
- animation: animationEvent,
283
- };
284
- failures.push(failure);
285
- }
286
- return failures;
287
- }
288
-
289
- function getNonCompositedFailureRootCauses(
290
- animationEvents: Types.Events.SyntheticAnimationPair[],
291
- prePaintEvents: Types.Events.PrePaint[],
292
- shiftsByPrePaint: Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]>,
293
- rootCausesByShift: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>,
294
- ): NoncompositedAnimationFailure[] {
295
- const allAnimationFailures: NoncompositedAnimationFailure[] = [];
296
- for (const animation of animationEvents) {
297
- /**
298
- * Animation events containing composite information are ASYNC_NESTABLE_INSTANT ('n').
299
- * An animation may also contain multiple 'n' events, so we look through those with useful non-composited data.
300
- */
301
- const failures = getNonCompositedFailure(animation);
302
- if (!failures) {
303
- continue;
304
- }
305
- allAnimationFailures.push(...failures);
306
-
307
- const nextPrePaint = getNextEvent(prePaintEvents, animation) as Types.Events.PrePaint | null;
308
- // If no following prePaint, this is not a root cause.
309
- if (!nextPrePaint) {
310
- continue;
311
- }
312
-
313
- // If the animation event is outside the ROOT_CAUSE_WINDOW, it could not be a root cause.
314
- if (!isInRootCauseWindow(animation, nextPrePaint)) {
315
- continue;
316
- }
317
-
318
- const shifts = shiftsByPrePaint.get(nextPrePaint);
319
- // if no layout shift(s), this is not a root cause.
320
- if (!shifts) {
321
- continue;
322
- }
323
-
324
- for (const shift of shifts) {
325
- const rootCausesForShift = rootCausesByShift.get(shift);
326
- if (!rootCausesForShift) {
327
- throw new Error('Unaccounted shift');
328
- }
329
- rootCausesForShift.nonCompositedAnimations.push(...failures);
330
- }
331
- }
332
-
333
- return allAnimationFailures;
334
- }
335
-
336
- /**
337
- * Given an array of layout shift and PrePaint events, returns a mapping from
338
- * PrePaint events to layout shifts dispatched within it.
339
- */
340
- function getShiftsByPrePaintEvents(
341
- layoutShifts: Types.Events.SyntheticLayoutShift[],
342
- prePaintEvents: Types.Events.PrePaint[],
343
- ): Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]> {
344
- // Maps from PrePaint events to LayoutShifts that occurred in each one.
345
- const shiftsByPrePaint = new Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]>();
346
-
347
- // Associate all shifts to their corresponding PrePaint.
348
- for (const prePaintEvent of prePaintEvents) {
349
- const firstShiftIndex =
350
- Platform.ArrayUtilities.nearestIndexFromBeginning(layoutShifts, shift => shift.ts >= prePaintEvent.ts);
351
- if (firstShiftIndex === null) {
352
- // No layout shifts registered after this PrePaint start. Continue.
353
- continue;
354
- }
355
- for (let i = firstShiftIndex; i < layoutShifts.length; i++) {
356
- const shift = layoutShifts[i];
357
- if (shift.ts >= prePaintEvent.ts && shift.ts <= prePaintEvent.ts + prePaintEvent.dur) {
358
- const shiftsInPrePaint = Platform.MapUtilities.getWithDefault(shiftsByPrePaint, prePaintEvent, () => []);
359
- shiftsInPrePaint.push(shift);
360
- }
361
- if (shift.ts > prePaintEvent.ts + prePaintEvent.dur) {
362
- // Reached all layoutShifts of this PrePaint. Break out to continue with the next prePaint event.
363
- break;
364
- }
365
- }
366
- }
367
- return shiftsByPrePaint;
368
- }
369
-
370
- /**
371
- * Given a source event list, this returns the first event of that list that directly follows the target event.
372
- */
373
- function getNextEvent(sourceEvents: Types.Events.Event[], targetEvent: Types.Events.Event): Types.Events.Event|
374
- undefined {
375
- const index = Platform.ArrayUtilities.nearestIndexFromBeginning(
376
- sourceEvents, source => source.ts > targetEvent.ts + (targetEvent.dur || 0));
377
- // No PrePaint event registered after this event
378
- if (index === null) {
379
- return undefined;
380
- }
381
-
382
- return sourceEvents[index];
383
- }
384
-
385
- /**
386
- * An Iframe is considered a root cause if the iframe event occurs before a prePaint event
387
- * and within this prePaint event a layout shift(s) occurs.
388
- */
389
- function getIframeRootCauses(
390
- data: Handlers.Types.HandlerData, iframeCreatedEvents: readonly Types.Events.RenderFrameImplCreateChildFrame[],
391
- prePaintEvents: Types.Events.PrePaint[],
392
- shiftsByPrePaint: Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]>,
393
- rootCausesByShift: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>,
394
- domLoadingEvents: readonly Types.Events.DomLoading[]):
395
- Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData> {
396
- for (const iframeEvent of iframeCreatedEvents) {
397
- const nextPrePaint = getNextEvent(prePaintEvents, iframeEvent) as Types.Events.PrePaint | null;
398
- // If no following prePaint, this is not a root cause.
399
- if (!nextPrePaint) {
400
- continue;
401
- }
402
- const shifts = shiftsByPrePaint.get(nextPrePaint);
403
- // if no layout shift(s), this is not a root cause.
404
- if (!shifts) {
405
- continue;
406
- }
407
- for (const shift of shifts) {
408
- const rootCausesForShift = rootCausesByShift.get(shift);
409
- if (!rootCausesForShift) {
410
- throw new Error('Unaccounted shift');
411
- }
412
-
413
- // Look for the first dom event that occurs within the bounds of the iframe event.
414
- // This contains the frame id.
415
- const domEvent = domLoadingEvents.find(e => {
416
- const maxIframe = Types.Timing.Micro(iframeEvent.ts + (iframeEvent.dur ?? 0));
417
- return e.ts >= iframeEvent.ts && e.ts <= maxIframe;
418
- });
419
- if (domEvent?.args.frame) {
420
- const frame = domEvent.args.frame;
421
-
422
- let url;
423
- const processes = data.Meta.rendererProcessesByFrame.get(frame);
424
- if (processes && processes.size > 0) {
425
- url = [...processes.values()][0]?.[0].frame.url;
426
- }
427
-
428
- rootCausesForShift.iframes.push({frame, url});
429
- }
430
- }
431
- }
432
- return rootCausesByShift;
433
- }
434
-
435
- /**
436
- * An unsized image is considered a root cause if its PaintImage can be correlated to a
437
- * layout shift. We can correlate PaintImages with unsized images by their matching nodeIds.
438
- * X <- layout shift
439
- * |----------------|
440
- * ^ PrePaint event |-----|
441
- * ^ PaintImage
442
- */
443
- function getUnsizedImageRootCauses(
444
- unsizedImageEvents: readonly Types.Events.LayoutImageUnsized[], paintImageEvents: Types.Events.PaintImage[],
445
- shiftsByPrePaint: Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]>,
446
- rootCausesByShift: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>):
447
- Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData> {
448
- shiftsByPrePaint.forEach((shifts, prePaint) => {
449
- const paintImage = getNextEvent(paintImageEvents, prePaint) as Types.Events.PaintImage | null;
450
- if (!paintImage) {
451
- return;
452
- }
453
- // The unsized image corresponds to this PaintImage.
454
- const matchingNode =
455
- unsizedImageEvents.find(unsizedImage => unsizedImage.args.data.nodeId === paintImage.args.data.nodeId);
456
- if (!matchingNode) {
457
- return;
458
- }
459
- // The unsized image is a potential root cause of all the shifts of this prePaint.
460
- for (const shift of shifts) {
461
- const rootCausesForShift = rootCausesByShift.get(shift);
462
- if (!rootCausesForShift) {
463
- throw new Error('Unaccounted shift');
464
- }
465
- rootCausesForShift.unsizedImages.push({
466
- backendNodeId: matchingNode.args.data.nodeId,
467
- paintImageEvent: paintImage,
468
- });
469
- }
470
- });
471
- return rootCausesByShift;
472
- }
473
-
474
- export function isCLSCulpritsInsight(insight: InsightModel): insight is CLSCulpritsInsightModel {
475
- return insight.insightKey === InsightKeys.CLS_CULPRITS;
476
- }
477
-
478
- /**
479
- * A font request is considered a root cause if the request occurs before a prePaint event
480
- * and within this prePaint event a layout shift(s) occurs. Additionally, this font request should
481
- * happen within the ROOT_CAUSE_WINDOW of the prePaint event.
482
- */
483
- function getFontRootCauses(
484
- networkRequests: Types.Events.SyntheticNetworkRequest[], prePaintEvents: Types.Events.PrePaint[],
485
- shiftsByPrePaint: Map<Types.Events.PrePaint, Types.Events.SyntheticLayoutShift[]>,
486
- rootCausesByShift: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>):
487
- Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData> {
488
- const fontRequests =
489
- networkRequests.filter(req => req.args.data.resourceType === 'Font' && req.args.data.mimeType.startsWith('font'));
490
-
491
- for (const req of fontRequests) {
492
- const nextPrePaint = getNextEvent(prePaintEvents, req) as Types.Events.PrePaint | null;
493
- if (!nextPrePaint) {
494
- continue;
495
- }
496
-
497
- // If the req is outside the ROOT_CAUSE_WINDOW, it could not be a root cause.
498
- if (!isInRootCauseWindow(req, nextPrePaint)) {
499
- continue;
500
- }
501
-
502
- // Get the shifts that belong to this prepaint
503
- const shifts = shiftsByPrePaint.get(nextPrePaint);
504
-
505
- // if no layout shift(s) in this prePaint, the request is not a root cause.
506
- if (!shifts) {
507
- continue;
508
- }
509
- // Include the root cause to the shifts in this prePaint.
510
- for (const shift of shifts) {
511
- const rootCausesForShift = rootCausesByShift.get(shift);
512
- if (!rootCausesForShift) {
513
- throw new Error('Unaccounted shift');
514
- }
515
- rootCausesForShift.webFonts.push(req);
516
- }
517
- }
518
- return rootCausesByShift;
519
- }
520
-
521
- /**
522
- * Returns the top 3 shift root causes based on the given cluster.
523
- */
524
- function getTopCulprits(
525
- cluster: Types.Events.SyntheticLayoutShiftCluster,
526
- culpritsByShift: Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>): LayoutShiftItem[] {
527
- const MAX_TOP_CULPRITS = 3;
528
- const causes: LayoutShiftItem[] = [];
529
-
530
- const shifts = cluster.events;
531
- for (const shift of shifts) {
532
- const culprits = culpritsByShift.get(shift);
533
- if (!culprits) {
534
- continue;
535
- }
536
-
537
- const fontReq = culprits.webFonts;
538
- const iframes = culprits.iframes;
539
- const animations = culprits.nonCompositedAnimations;
540
- const unsizedImages = culprits.unsizedImages;
541
-
542
- for (let i = 0; i < fontReq.length && causes.length < MAX_TOP_CULPRITS; i++) {
543
- causes.push({type: LayoutShiftType.WEB_FONT, description: i18nString(UIStrings.webFont)});
544
- }
545
- for (let i = 0; i < iframes.length && causes.length < MAX_TOP_CULPRITS; i++) {
546
- causes.push({type: LayoutShiftType.IFRAMES, description: i18nString(UIStrings.injectedIframe)});
547
- }
548
- for (let i = 0; i < animations.length && causes.length < MAX_TOP_CULPRITS; i++) {
549
- causes.push({type: LayoutShiftType.ANIMATIONS, description: i18nString(UIStrings.animation)});
550
- }
551
- for (let i = 0; i < unsizedImages.length && causes.length < MAX_TOP_CULPRITS; i++) {
552
- causes.push({
553
- type: LayoutShiftType.UNSIZED_IMAGE,
554
- description: i18nString(UIStrings.unsizedImage),
555
- url: unsizedImages[i].paintImageEvent.args.data.url || '',
556
- backendNodeId: unsizedImages[i].backendNodeId,
557
- frame: unsizedImages[i].paintImageEvent.args.data.frame || '',
558
- });
559
- }
560
-
561
- if (causes.length >= MAX_TOP_CULPRITS) {
562
- break;
563
- }
564
- }
565
-
566
- return causes.slice(0, MAX_TOP_CULPRITS);
567
- }
568
-
569
- function finalize(partialModel: PartialInsightModel<CLSCulpritsInsightModel>): CLSCulpritsInsightModel {
570
- let state: CLSCulpritsInsightModel['state'] = 'pass';
571
- if (partialModel.worstCluster) {
572
- const classification = Handlers.ModelHandlers.LayoutShifts.scoreClassificationForLayoutShift(
573
- partialModel.worstCluster.clusterCumulativeScore);
574
- if (classification === Handlers.ModelHandlers.PageLoadMetrics.ScoreClassification.GOOD) {
575
- state = 'informative';
576
- } else {
577
- state = 'fail';
578
- }
579
- }
580
-
581
- return {
582
- insightKey: InsightKeys.CLS_CULPRITS,
583
- strings: UIStrings,
584
- title: i18nString(UIStrings.title),
585
- description: i18nString(UIStrings.description),
586
- docs: 'https://developer.chrome.com/docs/performance/insights/cls-culprit',
587
- category: InsightCategory.CLS,
588
- state,
589
- ...partialModel,
590
- };
591
- }
592
-
593
- export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): CLSCulpritsInsightModel {
594
- const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
595
-
596
- const compositeAnimationEvents = data.Animations.animations.filter(isWithinContext);
597
- const iframeEvents = data.LayoutShifts.renderFrameImplCreateChildFrameEvents.filter(isWithinContext);
598
- const networkRequests = data.NetworkRequests.byTime.filter(isWithinContext);
599
- const domLoadingEvents = data.LayoutShifts.domLoadingEvents.filter(isWithinContext);
600
- const unsizedImageEvents = data.LayoutShifts.layoutImageUnsizedEvents.filter(isWithinContext);
601
-
602
- const clusterKey = context.navigation ? context.navigationId : Types.Events.NO_NAVIGATION;
603
- const clusters = data.LayoutShifts.clustersByNavigationId.get(clusterKey) ?? [];
604
- const clustersByScore = clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore);
605
- const worstCluster = clustersByScore.at(0);
606
- const layoutShifts = clusters.flatMap(cluster => cluster.events);
607
- const prePaintEvents = data.LayoutShifts.prePaintEvents.filter(isWithinContext);
608
- const paintImageEvents = data.LayoutShifts.paintImageEvents.filter(isWithinContext);
609
-
610
- // Get root causes.
611
- const rootCausesByShift = new Map<Types.Events.SyntheticLayoutShift, LayoutShiftRootCausesData>();
612
- const shiftsByPrePaint = getShiftsByPrePaintEvents(layoutShifts, prePaintEvents);
613
-
614
- for (const shift of layoutShifts) {
615
- rootCausesByShift.set(shift, {iframes: [], webFonts: [], nonCompositedAnimations: [], unsizedImages: []});
616
- }
617
-
618
- // Populate root causes for rootCausesByShift.
619
- getIframeRootCauses(data, iframeEvents, prePaintEvents, shiftsByPrePaint, rootCausesByShift, domLoadingEvents);
620
- getFontRootCauses(networkRequests, prePaintEvents, shiftsByPrePaint, rootCausesByShift);
621
- getUnsizedImageRootCauses(unsizedImageEvents, paintImageEvents, shiftsByPrePaint, rootCausesByShift);
622
- const animationFailures =
623
- getNonCompositedFailureRootCauses(compositeAnimationEvents, prePaintEvents, shiftsByPrePaint, rootCausesByShift);
624
-
625
- const relatedEvents: Types.Events.Event[] = [...layoutShifts];
626
- if (worstCluster) {
627
- relatedEvents.push(worstCluster);
628
- }
629
-
630
- const topCulpritsByCluster = new Map<Types.Events.SyntheticLayoutShiftCluster, LayoutShiftItem[]>();
631
- for (const cluster of clusters) {
632
- topCulpritsByCluster.set(cluster, getTopCulprits(cluster, rootCausesByShift));
633
- }
634
-
635
- return finalize({
636
- relatedEvents,
637
- animationFailures,
638
- shifts: rootCausesByShift,
639
- clusters,
640
- worstCluster,
641
- topCulpritsByCluster,
642
- });
643
- }
644
-
645
- export function createOverlays(model: CLSCulpritsInsightModel): Types.Overlays.Overlay[] {
646
- const clustersByScore = model.clusters.toSorted((a, b) => b.clusterCumulativeScore - a.clusterCumulativeScore) ?? [];
647
- const worstCluster = clustersByScore[0];
648
- if (!worstCluster) {
649
- return [];
650
- }
651
-
652
- const range = Types.Timing.Micro(worstCluster.dur ?? 0);
653
- const max = Types.Timing.Micro(worstCluster.ts + range);
654
-
655
- return [{
656
- type: 'TIMESPAN_BREAKDOWN',
657
- sections: [
658
- {
659
- bounds: {min: worstCluster.ts, range, max},
660
- label: i18nString(UIStrings.worstLayoutShiftCluster),
661
- showDuration: false,
662
- },
663
- ],
664
- // This allows for the overlay to sit over the layout shift.
665
- entry: worstCluster.events[0],
666
- renderLocation: 'ABOVE_EVENT',
667
- }];
668
- }