devtools-tracing 1.1.1 → 1.2.1

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 (527) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +28854 -0
  3. package/package.json +11 -8
  4. package/generate.ts +0 -649
  5. package/index.ts +0 -17
  6. package/lib/extension-api/ExtensionAPI.d.ts +0 -357
  7. package/lib/front_end/core/common/App.ts +0 -7
  8. package/lib/front_end/core/common/AppProvider.ts +0 -32
  9. package/lib/front_end/core/common/Base64.ts +0 -47
  10. package/lib/front_end/core/common/CharacterIdMap.ts +0 -30
  11. package/lib/front_end/core/common/Color.ts +0 -2506
  12. package/lib/front_end/core/common/ColorConverter.ts +0 -402
  13. package/lib/front_end/core/common/ColorUtils.ts +0 -252
  14. package/lib/front_end/core/common/Console.ts +0 -114
  15. package/lib/front_end/core/common/Debouncer.ts +0 -15
  16. package/lib/front_end/core/common/EventTarget.ts +0 -52
  17. package/lib/front_end/core/common/Gzip.ts +0 -74
  18. package/lib/front_end/core/common/JavaScriptMetaData.ts +0 -29
  19. package/lib/front_end/core/common/Lazy.ts +0 -31
  20. package/lib/front_end/core/common/Linkifier.ts +0 -55
  21. package/lib/front_end/core/common/MapWithDefault.ts +0 -26
  22. package/lib/front_end/core/common/Mutex.ts +0 -55
  23. package/lib/front_end/core/common/Object.ts +0 -145
  24. package/lib/front_end/core/common/ParsedURL.ts +0 -554
  25. package/lib/front_end/core/common/Progress.ts +0 -180
  26. package/lib/front_end/core/common/QueryParamHandler.ts +0 -7
  27. package/lib/front_end/core/common/ResolverBase.ts +0 -85
  28. package/lib/front_end/core/common/ResourceType.ts +0 -588
  29. package/lib/front_end/core/common/ReturnToPanel.ts +0 -17
  30. package/lib/front_end/core/common/Revealer.ts +0 -192
  31. package/lib/front_end/core/common/Runnable.ts +0 -41
  32. package/lib/front_end/core/common/SegmentedRange.ts +0 -87
  33. package/lib/front_end/core/common/SettingRegistration.ts +0 -339
  34. package/lib/front_end/core/common/Settings.ts +0 -1497
  35. package/lib/front_end/core/common/SimpleHistoryManager.ts +0 -124
  36. package/lib/front_end/core/common/StringOutputStream.ts +0 -26
  37. package/lib/front_end/core/common/TextDictionary.ts +0 -48
  38. package/lib/front_end/core/common/Throttler.ts +0 -99
  39. package/lib/front_end/core/common/Trie.ts +0 -152
  40. package/lib/front_end/core/common/Worker.ts +0 -60
  41. package/lib/front_end/core/common/common.ts +0 -81
  42. package/lib/front_end/core/host/AidaClient.ts +0 -733
  43. package/lib/front_end/core/host/GdpClient.ts +0 -316
  44. package/lib/front_end/core/host/InspectorFrontendHost.ts +0 -648
  45. package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +0 -551
  46. package/lib/front_end/core/host/Platform.ts +0 -76
  47. package/lib/front_end/core/host/ResourceLoader.ts +0 -282
  48. package/lib/front_end/core/host/UserMetrics.ts +0 -1230
  49. package/lib/front_end/core/host/host.ts +0 -23
  50. package/lib/front_end/core/i18n/ByteUtilities.ts +0 -82
  51. package/lib/front_end/core/i18n/DevToolsLocale.ts +0 -87
  52. package/lib/front_end/core/i18n/NumberFormatter.ts +0 -82
  53. package/lib/front_end/core/i18n/i18n.ts +0 -17
  54. package/lib/front_end/core/i18n/i18nImpl.ts +0 -204
  55. package/lib/front_end/core/i18n/i18nTypes.ts +0 -10
  56. package/lib/front_end/core/i18n/locales.js +0 -14
  57. package/lib/front_end/core/i18n/time-utilities.ts +0 -174
  58. package/lib/front_end/core/platform/ArrayUtilities.ts +0 -271
  59. package/lib/front_end/core/platform/Brand.ts +0 -23
  60. package/lib/front_end/core/platform/Constructor.ts +0 -10
  61. package/lib/front_end/core/platform/DOMUtilities.ts +0 -138
  62. package/lib/front_end/core/platform/DateUtilities.ts +0 -15
  63. package/lib/front_end/core/platform/DevToolsPath.ts +0 -53
  64. package/lib/front_end/core/platform/KeyboardUtilities.ts +0 -38
  65. package/lib/front_end/core/platform/MapUtilities.ts +0 -95
  66. package/lib/front_end/core/platform/MimeType.ts +0 -175
  67. package/lib/front_end/core/platform/NumberUtilities.ts +0 -80
  68. package/lib/front_end/core/platform/StringUtilities.ts +0 -588
  69. package/lib/front_end/core/platform/Timing.ts +0 -17
  70. package/lib/front_end/core/platform/TypedArrayUtilities.ts +0 -189
  71. package/lib/front_end/core/platform/TypescriptUtilities.ts +0 -86
  72. package/lib/front_end/core/platform/UIString.ts +0 -39
  73. package/lib/front_end/core/platform/UserVisibleError.ts +0 -28
  74. package/lib/front_end/core/platform/platform.ts +0 -45
  75. package/lib/front_end/core/protocol_client/ConnectionTransport.ts +0 -26
  76. package/lib/front_end/core/protocol_client/InspectorBackend.ts +0 -1050
  77. package/lib/front_end/core/protocol_client/NodeURL.ts +0 -42
  78. package/lib/front_end/core/protocol_client/protocol_client.ts +0 -13
  79. package/lib/front_end/core/root/Runtime.ts +0 -609
  80. package/lib/front_end/core/root/root.ts +0 -6
  81. package/lib/front_end/core/sdk/AccessibilityModel.ts +0 -353
  82. package/lib/front_end/core/sdk/AnimationModel.ts +0 -1041
  83. package/lib/front_end/core/sdk/AutofillModel.ts +0 -184
  84. package/lib/front_end/core/sdk/CPUProfilerModel.ts +0 -148
  85. package/lib/front_end/core/sdk/CPUThrottlingManager.ts +0 -282
  86. package/lib/front_end/core/sdk/CSSContainerQuery.ts +0 -139
  87. package/lib/front_end/core/sdk/CSSFontFace.ts +0 -40
  88. package/lib/front_end/core/sdk/CSSLayer.ts +0 -30
  89. package/lib/front_end/core/sdk/CSSMatchedStyles.ts +0 -1646
  90. package/lib/front_end/core/sdk/CSSMedia.ts +0 -121
  91. package/lib/front_end/core/sdk/CSSMetadata.ts +0 -1647
  92. package/lib/front_end/core/sdk/CSSModel.ts +0 -1128
  93. package/lib/front_end/core/sdk/CSSProperty.ts +0 -384
  94. package/lib/front_end/core/sdk/CSSPropertyParser.ts +0 -681
  95. package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +0 -1395
  96. package/lib/front_end/core/sdk/CSSQuery.ts +0 -72
  97. package/lib/front_end/core/sdk/CSSRule.ts +0 -465
  98. package/lib/front_end/core/sdk/CSSScope.ts +0 -30
  99. package/lib/front_end/core/sdk/CSSStartingStyle.ts +0 -29
  100. package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +0 -313
  101. package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +0 -196
  102. package/lib/front_end/core/sdk/CSSSupports.ts +0 -33
  103. package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +0 -64
  104. package/lib/front_end/core/sdk/ChildTargetManager.ts +0 -314
  105. package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +0 -62
  106. package/lib/front_end/core/sdk/Connections.ts +0 -293
  107. package/lib/front_end/core/sdk/ConsoleModel.ts +0 -808
  108. package/lib/front_end/core/sdk/ConsoleModelTypes.ts +0 -15
  109. package/lib/front_end/core/sdk/Cookie.ts +0 -319
  110. package/lib/front_end/core/sdk/CookieModel.ts +0 -239
  111. package/lib/front_end/core/sdk/CookieParser.ts +0 -185
  112. package/lib/front_end/core/sdk/DOMDebuggerModel.ts +0 -787
  113. package/lib/front_end/core/sdk/DOMModel.ts +0 -1961
  114. package/lib/front_end/core/sdk/DebuggerModel.ts +0 -1605
  115. package/lib/front_end/core/sdk/EmulationModel.ts +0 -648
  116. package/lib/front_end/core/sdk/EnhancedTracesParser.ts +0 -515
  117. package/lib/front_end/core/sdk/EventBreakpointsModel.ts +0 -183
  118. package/lib/front_end/core/sdk/FrameAssociated.ts +0 -11
  119. package/lib/front_end/core/sdk/FrameManager.ts +0 -259
  120. package/lib/front_end/core/sdk/HeapProfilerModel.ts +0 -225
  121. package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +0 -77
  122. package/lib/front_end/core/sdk/IOModel.ts +0 -91
  123. package/lib/front_end/core/sdk/IsolateManager.ts +0 -257
  124. package/lib/front_end/core/sdk/IssuesModel.ts +0 -70
  125. package/lib/front_end/core/sdk/LayerTreeBase.ts +0 -169
  126. package/lib/front_end/core/sdk/LogModel.ts +0 -56
  127. package/lib/front_end/core/sdk/NetworkManager.ts +0 -2823
  128. package/lib/front_end/core/sdk/NetworkRequest.ts +0 -2253
  129. package/lib/front_end/core/sdk/OverlayColorGenerator.ts +0 -52
  130. package/lib/front_end/core/sdk/OverlayModel.ts +0 -1011
  131. package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -522
  132. package/lib/front_end/core/sdk/PageLoad.ts +0 -35
  133. package/lib/front_end/core/sdk/PageResourceLoader.ts +0 -435
  134. package/lib/front_end/core/sdk/PaintProfiler.ts +0 -110
  135. package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +0 -84
  136. package/lib/front_end/core/sdk/PreloadingModel.ts +0 -863
  137. package/lib/front_end/core/sdk/RehydratingConnection.ts +0 -386
  138. package/lib/front_end/core/sdk/RehydratingObject.ts +0 -66
  139. package/lib/front_end/core/sdk/RemoteObject.ts +0 -1160
  140. package/lib/front_end/core/sdk/Resource.ts +0 -232
  141. package/lib/front_end/core/sdk/ResourceTreeModel.ts +0 -1160
  142. package/lib/front_end/core/sdk/RuntimeModel.ts +0 -732
  143. package/lib/front_end/core/sdk/SDKModel.ts +0 -65
  144. package/lib/front_end/core/sdk/ScopeTreeCache.ts +0 -45
  145. package/lib/front_end/core/sdk/ScreenCaptureModel.ts +0 -255
  146. package/lib/front_end/core/sdk/Script.ts +0 -534
  147. package/lib/front_end/core/sdk/SecurityOriginManager.ts +0 -76
  148. package/lib/front_end/core/sdk/ServerSentEvents.ts +0 -80
  149. package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +0 -122
  150. package/lib/front_end/core/sdk/ServerTiming.ts +0 -260
  151. package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -377
  152. package/lib/front_end/core/sdk/ServiceWorkerManager.ts +0 -605
  153. package/lib/front_end/core/sdk/SourceMap.ts +0 -867
  154. package/lib/front_end/core/sdk/SourceMapCache.ts +0 -54
  155. package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +0 -156
  156. package/lib/front_end/core/sdk/SourceMapManager.ts +0 -239
  157. package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +0 -189
  158. package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +0 -508
  159. package/lib/front_end/core/sdk/StorageBucketsModel.ts +0 -204
  160. package/lib/front_end/core/sdk/StorageKeyManager.ts +0 -98
  161. package/lib/front_end/core/sdk/Target.ts +0 -332
  162. package/lib/front_end/core/sdk/TargetManager.ts +0 -453
  163. package/lib/front_end/core/sdk/TraceObject.ts +0 -61
  164. package/lib/front_end/core/sdk/WebAuthnModel.ts +0 -104
  165. package/lib/front_end/core/sdk/sdk.ts +0 -174
  166. package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -59
  167. package/lib/front_end/generated/InspectorBackendCommands.js +0 -1617
  168. package/lib/front_end/generated/SupportedCSSProperties.js +0 -7512
  169. package/lib/front_end/generated/protocol-proxy-api.d.ts +0 -5022
  170. package/lib/front_end/generated/protocol.ts +0 -22014
  171. package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -318
  172. package/lib/front_end/models/bindings/CompilerScriptMapping.ts +0 -536
  173. package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +0 -187
  174. package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1197
  175. package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -733
  176. package/lib/front_end/models/bindings/DefaultScriptMapping.ts +0 -141
  177. package/lib/front_end/models/bindings/FileUtils.ts +0 -228
  178. package/lib/front_end/models/bindings/LiveLocation.ts +0 -81
  179. package/lib/front_end/models/bindings/NetworkProject.ts +0 -157
  180. package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +0 -312
  181. package/lib/front_end/models/bindings/ResourceMapping.ts +0 -539
  182. package/lib/front_end/models/bindings/ResourceScriptMapping.ts +0 -491
  183. package/lib/front_end/models/bindings/ResourceUtils.ts +0 -103
  184. package/lib/front_end/models/bindings/SASSSourceMapping.ts +0 -222
  185. package/lib/front_end/models/bindings/StylesSourceMapping.ts +0 -316
  186. package/lib/front_end/models/bindings/TempFile.ts +0 -67
  187. package/lib/front_end/models/bindings/bindings.ts +0 -39
  188. package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +0 -571
  189. package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +0 -103
  190. package/lib/front_end/models/cpu_profile/cpu_profile.ts +0 -11
  191. package/lib/front_end/models/formatter/FormatterWorkerPool.ts +0 -219
  192. package/lib/front_end/models/formatter/ScriptFormatter.ts +0 -112
  193. package/lib/front_end/models/formatter/formatter.ts +0 -8
  194. package/lib/front_end/models/source_map_scopes/NamesResolver.ts +0 -765
  195. package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +0 -84
  196. package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +0 -11
  197. package/lib/front_end/models/stack_trace/StackTrace.ts +0 -53
  198. package/lib/front_end/models/stack_trace/StackTraceImpl.ts +0 -85
  199. package/lib/front_end/models/stack_trace/StackTraceModel.ts +0 -128
  200. package/lib/front_end/models/stack_trace/Trie.ts +0 -163
  201. package/lib/front_end/models/stack_trace/stack_trace.ts +0 -9
  202. package/lib/front_end/models/stack_trace/stack_trace_impl.ts +0 -13
  203. package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +0 -37
  204. package/lib/front_end/models/text_utils/ContentData.ts +0 -199
  205. package/lib/front_end/models/text_utils/ContentProvider.ts +0 -68
  206. package/lib/front_end/models/text_utils/StaticContentProvider.ts +0 -49
  207. package/lib/front_end/models/text_utils/StreamingContentData.ts +0 -108
  208. package/lib/front_end/models/text_utils/Text.ts +0 -90
  209. package/lib/front_end/models/text_utils/TextCursor.ts +0 -44
  210. package/lib/front_end/models/text_utils/TextRange.ts +0 -266
  211. package/lib/front_end/models/text_utils/TextUtils.ts +0 -401
  212. package/lib/front_end/models/text_utils/WasmDisassembly.ts +0 -87
  213. package/lib/front_end/models/text_utils/text_utils.ts +0 -27
  214. package/lib/front_end/models/trace/EntityMapper.ts +0 -141
  215. package/lib/front_end/models/trace/EventsSerializer.ts +0 -101
  216. package/lib/front_end/models/trace/LanternComputationData.ts +0 -438
  217. package/lib/front_end/models/trace/ModelImpl.ts +0 -236
  218. package/lib/front_end/models/trace/Name.ts +0 -136
  219. package/lib/front_end/models/trace/Processor.ts +0 -652
  220. package/lib/front_end/models/trace/Styles.ts +0 -1138
  221. package/lib/front_end/models/trace/extras/FilmStrip.ts +0 -78
  222. package/lib/front_end/models/trace/extras/MainThreadActivity.ts +0 -86
  223. package/lib/front_end/models/trace/extras/ScriptDuplication.ts +0 -236
  224. package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +0 -203
  225. package/lib/front_end/models/trace/extras/ThirdParties.ts +0 -164
  226. package/lib/front_end/models/trace/extras/TraceFilter.ts +0 -62
  227. package/lib/front_end/models/trace/extras/TraceTree.ts +0 -701
  228. package/lib/front_end/models/trace/extras/extras.ts +0 -11
  229. package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +0 -128
  230. package/lib/front_end/models/trace/handlers/AnimationHandler.ts +0 -36
  231. package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +0 -239
  232. package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
  233. package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +0 -31
  234. package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -306
  235. package/lib/front_end/models/trace/handlers/FlowsHandler.ts +0 -175
  236. package/lib/front_end/models/trace/handlers/FramesHandler.ts +0 -571
  237. package/lib/front_end/models/trace/handlers/GPUHandler.ts +0 -50
  238. package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +0 -183
  239. package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -193
  240. package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -168
  241. package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +0 -109
  242. package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +0 -35
  243. package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +0 -123
  244. package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +0 -573
  245. package/lib/front_end/models/trace/handlers/MemoryHandler.ts +0 -31
  246. package/lib/front_end/models/trace/handlers/MetaHandler.ts +0 -525
  247. package/lib/front_end/models/trace/handlers/ModelHandlers.ts +0 -34
  248. package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +0 -672
  249. package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +0 -52
  250. package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +0 -460
  251. package/lib/front_end/models/trace/handlers/RendererHandler.ts +0 -428
  252. package/lib/front_end/models/trace/handlers/SamplesHandler.ts +0 -271
  253. package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +0 -122
  254. package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +0 -336
  255. package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +0 -110
  256. package/lib/front_end/models/trace/handlers/Threads.ts +0 -139
  257. package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +0 -400
  258. package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -233
  259. package/lib/front_end/models/trace/handlers/WarningsHandler.ts +0 -162
  260. package/lib/front_end/models/trace/handlers/WorkersHandler.ts +0 -45
  261. package/lib/front_end/models/trace/handlers/handlers.ts +0 -8
  262. package/lib/front_end/models/trace/handlers/helpers.ts +0 -196
  263. package/lib/front_end/models/trace/handlers/types.ts +0 -75
  264. package/lib/front_end/models/trace/helpers/Extensions.ts +0 -54
  265. package/lib/front_end/models/trace/helpers/Network.ts +0 -129
  266. package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +0 -544
  267. package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +0 -87
  268. package/lib/front_end/models/trace/helpers/Timing.ts +0 -248
  269. package/lib/front_end/models/trace/helpers/Trace.ts +0 -928
  270. package/lib/front_end/models/trace/helpers/TreeHelpers.ts +0 -320
  271. package/lib/front_end/models/trace/helpers/helpers.ts +0 -11
  272. package/lib/front_end/models/trace/insights/CLSCulprits.ts +0 -668
  273. package/lib/front_end/models/trace/insights/Cache.ts +0 -269
  274. package/lib/front_end/models/trace/insights/Common.ts +0 -453
  275. package/lib/front_end/models/trace/insights/DOMSize.ts +0 -223
  276. package/lib/front_end/models/trace/insights/DocumentLatency.ts +0 -319
  277. package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +0 -126
  278. package/lib/front_end/models/trace/insights/FontDisplay.ts +0 -119
  279. package/lib/front_end/models/trace/insights/ForcedReflow.ts +0 -220
  280. package/lib/front_end/models/trace/insights/INPBreakdown.ts +0 -171
  281. package/lib/front_end/models/trace/insights/ImageDelivery.ts +0 -348
  282. package/lib/front_end/models/trace/insights/LCPBreakdown.ts +0 -268
  283. package/lib/front_end/models/trace/insights/LCPDiscovery.ts +0 -237
  284. package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +0 -138
  285. package/lib/front_end/models/trace/insights/Models.ts +0 -22
  286. package/lib/front_end/models/trace/insights/ModernHTTP.ts +0 -257
  287. package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +0 -726
  288. package/lib/front_end/models/trace/insights/RenderBlocking.ts +0 -257
  289. package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +0 -175
  290. package/lib/front_end/models/trace/insights/Statistics.ts +0 -101
  291. package/lib/front_end/models/trace/insights/ThirdParties.ts +0 -130
  292. package/lib/front_end/models/trace/insights/Viewport.ts +0 -138
  293. package/lib/front_end/models/trace/insights/insights.ts +0 -10
  294. package/lib/front_end/models/trace/insights/types.ts +0 -157
  295. package/lib/front_end/models/trace/lantern/core/LanternError.ts +0 -7
  296. package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +0 -619
  297. package/lib/front_end/models/trace/lantern/core/core.ts +0 -6
  298. package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +0 -345
  299. package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +0 -80
  300. package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +0 -101
  301. package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +0 -636
  302. package/lib/front_end/models/trace/lantern/graph/graph.ts +0 -8
  303. package/lib/front_end/models/trace/lantern/lantern.ts +0 -17
  304. package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +0 -187
  305. package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +0 -88
  306. package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +0 -92
  307. package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +0 -72
  308. package/lib/front_end/models/trace/lantern/metrics/Metric.ts +0 -126
  309. package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +0 -126
  310. package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +0 -82
  311. package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +0 -112
  312. package/lib/front_end/models/trace/lantern/metrics/metrics.ts +0 -12
  313. package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +0 -150
  314. package/lib/front_end/models/trace/lantern/simulation/Constants.ts +0 -46
  315. package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +0 -61
  316. package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +0 -196
  317. package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +0 -556
  318. package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +0 -192
  319. package/lib/front_end/models/trace/lantern/simulation/simulation.ts +0 -10
  320. package/lib/front_end/models/trace/lantern/types/Lantern.ts +0 -220
  321. package/lib/front_end/models/trace/lantern/types/types.ts +0 -5
  322. package/lib/front_end/models/trace/trace.ts +0 -33
  323. package/lib/front_end/models/trace/types/Configuration.ts +0 -110
  324. package/lib/front_end/models/trace/types/Extensions.ts +0 -136
  325. package/lib/front_end/models/trace/types/File.ts +0 -281
  326. package/lib/front_end/models/trace/types/Overlays.ts +0 -138
  327. package/lib/front_end/models/trace/types/Timing.ts +0 -30
  328. package/lib/front_end/models/trace/types/TraceEvents.ts +0 -3277
  329. package/lib/front_end/models/trace/types/types.ts +0 -10
  330. package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +0 -240
  331. package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +0 -5
  332. package/lib/front_end/models/workspace/FileManager.ts +0 -97
  333. package/lib/front_end/models/workspace/IgnoreListManager.ts +0 -628
  334. package/lib/front_end/models/workspace/SearchConfig.ts +0 -149
  335. package/lib/front_end/models/workspace/UISourceCode.ts +0 -698
  336. package/lib/front_end/models/workspace/WorkspaceImpl.ts +0 -339
  337. package/lib/front_end/models/workspace/workspace.ts +0 -17
  338. package/lib/front_end/panels/timeline/TimelineUIUtils.ts +0 -1029
  339. package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +0 -49
  340. package/lib/front_end/panels/timeline/extensions/extensions.ts +0 -9
  341. package/lib/front_end/third_party/codemirror.next/LICENSE +0 -21
  342. package/lib/front_end/third_party/codemirror.next/README.chromium +0 -30
  343. package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
  344. package/lib/front_end/third_party/codemirror.next/bundle.ts +0 -135
  345. package/lib/front_end/third_party/codemirror.next/chunk/angular.js +0 -2
  346. package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +0 -1
  347. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +0 -2
  348. package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +0 -1
  349. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +0 -2
  350. package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +0 -1
  351. package/lib/front_end/third_party/codemirror.next/chunk/css.js +0 -2
  352. package/lib/front_end/third_party/codemirror.next/chunk/html.js +0 -4
  353. package/lib/front_end/third_party/codemirror.next/chunk/java.js +0 -2
  354. package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +0 -1
  355. package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +0 -2
  356. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +0 -2
  357. package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +0 -1
  358. package/lib/front_end/third_party/codemirror.next/chunk/less.js +0 -2
  359. package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +0 -1
  360. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +0 -2
  361. package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +0 -1
  362. package/lib/front_end/third_party/codemirror.next/chunk/php.js +0 -2
  363. package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +0 -1
  364. package/lib/front_end/third_party/codemirror.next/chunk/python.js +0 -2
  365. package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +0 -1
  366. package/lib/front_end/third_party/codemirror.next/chunk/sass.js +0 -2
  367. package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +0 -1
  368. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +0 -2
  369. package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +0 -1
  370. package/lib/front_end/third_party/codemirror.next/chunk/vue.js +0 -2
  371. package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +0 -1
  372. package/lib/front_end/third_party/codemirror.next/chunk/wast.js +0 -2
  373. package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +0 -1
  374. package/lib/front_end/third_party/codemirror.next/chunk/xml.js +0 -2
  375. package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +0 -1
  376. package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +0 -8057
  377. package/lib/front_end/third_party/codemirror.next/codemirror.next.js +0 -2
  378. package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +0 -1
  379. package/lib/front_end/third_party/codemirror.next/package.json +0 -43
  380. package/lib/front_end/third_party/codemirror.next/rebuild.sh +0 -6
  381. package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +0 -49
  382. package/lib/front_end/third_party/i18n/LICENSE +0 -202
  383. package/lib/front_end/third_party/i18n/README.chromium +0 -15
  384. package/lib/front_end/third_party/i18n/i18n-impl.ts +0 -61
  385. package/lib/front_end/third_party/i18n/i18n.ts +0 -11
  386. package/lib/front_end/third_party/i18n/localized-string-set.ts +0 -129
  387. package/lib/front_end/third_party/intl-messageformat/LICENSE +0 -33
  388. package/lib/front_end/third_party/intl-messageformat/README.chromium +0 -24
  389. package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
  390. package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +0 -6
  391. package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +0 -33
  392. package/lib/front_end/third_party/intl-messageformat/package/README.md +0 -3
  393. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +0 -6
  394. package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +0 -1
  395. package/lib/front_end/third_party/intl-messageformat/package/index.js +0 -13
  396. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +0 -5
  397. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +0 -1710
  398. package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +0 -1815
  399. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +0 -6
  400. package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +0 -1
  401. package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +0 -10
  402. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +0 -34
  403. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +0 -1
  404. package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +0 -229
  405. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +0 -28
  406. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +0 -1
  407. package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +0 -48
  408. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +0 -34
  409. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +0 -1
  410. package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +0 -179
  411. package/lib/front_end/third_party/intl-messageformat/package/package.json +0 -42
  412. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +0 -34
  413. package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +0 -1
  414. package/lib/front_end/third_party/intl-messageformat/package/src/core.js +0 -230
  415. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +0 -28
  416. package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +0 -1
  417. package/lib/front_end/third_party/intl-messageformat/package/src/error.js +0 -51
  418. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +0 -34
  419. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +0 -1
  420. package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +0 -182
  421. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +0 -79
  422. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +0 -15
  423. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +0 -153
  424. package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +0 -139
  425. package/lib/front_end/third_party/legacy-javascript/LICENSE +0 -202
  426. package/lib/front_end/third_party/legacy-javascript/README.chromium +0 -13
  427. package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
  428. package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +0 -3
  429. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +0 -18
  430. package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +0 -943
  431. package/lib/front_end/third_party/legacy-javascript/package.json +0 -8
  432. package/lib/front_end/third_party/legacy-javascript/rebuild.sh +0 -9
  433. package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +0 -26
  434. package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +0 -31
  435. package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -33
  436. package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -26
  437. package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +0 -64
  438. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -62
  439. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +0 -1
  440. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -37
  441. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -1
  442. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -29
  443. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -1
  444. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -8
  445. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -1
  446. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -6
  447. package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -1
  448. package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +0 -21
  449. package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +0 -14
  450. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +0 -196
  451. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +0 -1
  452. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +0 -262
  453. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -235
  454. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -1
  455. package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -359
  456. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -39
  457. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -1
  458. package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -53
  459. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -438
  460. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -1
  461. package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -539
  462. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -23
  463. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -1
  464. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -35
  465. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -257
  466. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -1
  467. package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -348
  468. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -8
  469. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -1
  470. package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -20
  471. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
  472. package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -184
  473. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -9
  474. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -1
  475. package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -12
  476. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -82
  477. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -1
  478. package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -99
  479. package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +0 -5
  480. package/lib/front_end/third_party/third-party-web/LICENSE +0 -20
  481. package/lib/front_end/third_party/third-party-web/README.chromium +0 -13
  482. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
  483. package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +0 -149
  484. package/lib/front_end/third_party/third-party-web/package/LICENSE +0 -20
  485. package/lib/front_end/third_party/third-party-web/package/README.md +0 -929
  486. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +0 -1
  487. package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +0 -1
  488. package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +0 -1
  489. package/lib/front_end/third_party/third-party-web/package/dist/entities.json +0 -1
  490. package/lib/front_end/third_party/third-party-web/package/facades.md +0 -46
  491. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +0 -1
  492. package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +0 -1
  493. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +0 -1
  494. package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +0 -1
  495. package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +0 -1006
  496. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +0 -139
  497. package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +0 -44
  498. package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +0 -27
  499. package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +0 -34
  500. package/lib/front_end/third_party/third-party-web/package/lib/index.js +0 -3
  501. package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +0 -246
  502. package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +0 -36
  503. package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +0 -9
  504. package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +0 -5
  505. package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +0 -151
  506. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +0 -1
  507. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +0 -1
  508. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +0 -1
  509. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +0 -14
  510. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +0 -1
  511. package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +0 -3
  512. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +0 -1
  513. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +0 -3
  514. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +0 -1
  515. package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +0 -3
  516. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
  517. package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +0 -3
  518. package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +0 -1
  519. package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +0 -1
  520. package/lib/front_end/third_party/third-party-web/package/package.json +0 -46
  521. package/lib/front_end/third_party/third-party-web/package.json +0 -8
  522. package/lib/front_end/third_party/third-party-web/rebuild.sh +0 -13
  523. package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
  524. package/lib/front_end/third_party/third-party-web/third-party-web.ts +0 -3
  525. package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +0 -222
  526. package/lib/front_end/ui/legacy/theme_support/theme_support.ts +0 -5
  527. 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
- }