chrome-devtools-frontend 1.0.1522145 → 1.0.1524741

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 (348) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/README.md +1 -0
  3. package/docs/policy/README.md +1 -0
  4. package/docs/policy/console-policy.md +144 -0
  5. package/docs/policy/images/console-policy1.png +0 -0
  6. package/docs/policy/images/console-policy2.png +0 -0
  7. package/docs/policy/images/console-policy3.png +0 -0
  8. package/docs/ui_engineering.md +98 -0
  9. package/front_end/Tests.js +1 -1
  10. package/front_end/core/common/Color.ts +13 -9
  11. package/front_end/core/common/ColorConverter.ts +9 -7
  12. package/front_end/core/common/Gzip.ts +1 -1
  13. package/front_end/core/common/MapWithDefault.ts +5 -3
  14. package/front_end/core/common/ResourceType.ts +0 -12
  15. package/front_end/core/common/ReturnToPanel.ts +6 -4
  16. package/front_end/core/common/Trie.ts +4 -2
  17. package/front_end/core/host/AidaClient.ts +3 -3
  18. package/front_end/core/host/GdpClient.ts +7 -5
  19. package/front_end/core/host/InspectorFrontendHostAPI.ts +7 -5
  20. package/front_end/core/host/Platform.ts +5 -3
  21. package/front_end/core/host/UserMetrics.ts +6 -4
  22. package/front_end/core/platform/ArrayUtilities.ts +1 -1
  23. package/front_end/core/platform/StringUtilities.ts +34 -31
  24. package/front_end/core/root/Runtime.ts +1 -1
  25. package/front_end/core/sdk/CSSMetadata.ts +6 -4
  26. package/front_end/core/sdk/CSSPropertyParser.ts +17 -13
  27. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +19 -13
  28. package/front_end/core/sdk/ChildTargetManager.ts +35 -0
  29. package/front_end/core/sdk/DOMModel.ts +1 -1
  30. package/front_end/core/sdk/EnhancedTracesParser.ts +13 -6
  31. package/front_end/core/sdk/EventBreakpointsModel.ts +4 -2
  32. package/front_end/core/sdk/HttpReasonPhraseStrings.ts +4 -2
  33. package/front_end/core/sdk/NetworkManager.ts +8 -48
  34. package/front_end/core/sdk/NetworkRequest.ts +0 -28
  35. package/front_end/core/sdk/PageResourceLoader.ts +1 -1
  36. package/front_end/core/sdk/PreloadingModel.ts +22 -18
  37. package/front_end/core/sdk/RehydratingConnection.ts +1 -1
  38. package/front_end/core/sdk/RehydratingObject.ts +1 -1
  39. package/front_end/core/sdk/RemoteObject.ts +1 -1
  40. package/front_end/core/sdk/ResourceTreeModel.ts +2 -0
  41. package/front_end/core/sdk/ScreenCaptureModel.ts +24 -20
  42. package/front_end/core/sdk/Target.ts +7 -1
  43. package/front_end/core/sdk/TraceObject.ts +2 -2
  44. package/front_end/entrypoints/formatter_worker/Substitute.ts +6 -4
  45. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -16
  46. package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +2 -1
  47. package/front_end/entrypoints/main/MainImpl.ts +6 -4
  48. package/front_end/generated/Deprecation.ts +4 -4
  49. package/front_end/generated/InspectorBackendCommands.js +2 -2
  50. package/front_end/generated/protocol-mapping.d.ts +3 -2
  51. package/front_end/generated/protocol-proxy-api.d.ts +3 -1
  52. package/front_end/generated/protocol.ts +7 -1
  53. package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +600 -0
  54. package/front_end/models/ai_assistance/agents/StylingAgent.ts +83 -222
  55. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +23 -0
  56. package/front_end/models/ai_assistance/performance/AIContext.ts +19 -4
  57. package/front_end/models/ai_code_completion/AiCodeCompletion.ts +4 -2
  58. package/front_end/models/autofill_manager/AutofillManager.ts +4 -2
  59. package/front_end/models/cpu_profile/CPUProfileDataModel.ts +1 -1
  60. package/front_end/models/crux-manager/CrUXManager.ts +1 -1
  61. package/front_end/models/extensions/HostUrlPattern.ts +13 -5
  62. package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +1 -1
  63. package/front_end/models/issues_manager/CookieIssue.ts +2 -2
  64. package/front_end/models/issues_manager/MarkdownIssueDescription.ts +1 -1
  65. package/front_end/models/issues_manager/SharedDictionaryIssue.ts +20 -0
  66. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
  67. package/front_end/models/issues_manager/descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
  68. package/front_end/models/javascript_metadata/NativeFunctions.js +9 -1
  69. package/front_end/models/network_time_calculator/Calculator.ts +4 -2
  70. package/front_end/models/network_time_calculator/RequestTimeRanges.ts +6 -4
  71. package/front_end/models/source_map_scopes/NamesResolver.ts +7 -5
  72. package/front_end/models/text_utils/ContentProvider.ts +6 -4
  73. package/front_end/models/trace/LanternComputationData.ts +1 -0
  74. package/front_end/models/trace/extras/TraceTree.ts +1 -1
  75. package/front_end/models/trace/handlers/FramesHandler.ts +7 -5
  76. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +13 -7
  77. package/front_end/models/trace/handlers/MetaHandler.ts +16 -14
  78. package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +30 -8
  79. package/front_end/models/trace/handlers/helpers.ts +1 -1
  80. package/front_end/models/trace/handlers/types.ts +23 -19
  81. package/front_end/models/trace/helpers/Timing.ts +4 -2
  82. package/front_end/models/trace/helpers/Trace.ts +8 -4
  83. package/front_end/models/trace/insights/DocumentLatency.ts +10 -11
  84. package/front_end/models/trace/insights/INPBreakdown.ts +13 -2
  85. package/front_end/models/trace/insights/LCPBreakdown.ts +14 -2
  86. package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -2
  87. package/front_end/models/trace/types/File.ts +12 -8
  88. package/front_end/models/trace/types/Timing.ts +1 -1
  89. package/front_end/models/trace/types/TraceEvents.ts +43 -28
  90. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
  91. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +12 -10
  92. package/front_end/panels/application/KeyValueStorageItemsView.ts +31 -33
  93. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +6 -11
  94. package/front_end/panels/application/components/OriginTrialTreeView.ts +7 -5
  95. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -0
  96. package/front_end/panels/application/components/ReportsGrid.ts +4 -10
  97. package/front_end/panels/application/components/SharedStorageAccessGrid.ts +5 -13
  98. package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +1 -1
  99. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +3 -7
  100. package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -2
  101. package/front_end/panels/application/preloading/components/RuleSetGrid.ts +3 -10
  102. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -2
  103. package/front_end/panels/browser_debugger/browser_debugger-meta.ts +7 -5
  104. package/front_end/panels/changes/ChangesSidebar.ts +97 -95
  105. package/front_end/panels/changes/changesSidebar.css +3 -0
  106. package/front_end/panels/console/ConsoleView.ts +2 -2
  107. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +22 -35
  108. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
  109. package/front_end/panels/elements/ElementStatePaneWidget.ts +12 -0
  110. package/front_end/panels/elements/ElementsTreeElement.ts +9 -5
  111. package/front_end/panels/elements/ElementsTreeOutline.ts +11 -8
  112. package/front_end/panels/elements/PropertyRenderer.ts +19 -15
  113. package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -4
  114. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  115. package/front_end/panels/elements/components/AccessibilityTreeNode.ts +4 -2
  116. package/front_end/panels/elements/components/AdornerManager.ts +5 -3
  117. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +6 -4
  118. package/front_end/panels/media/PlayerPropertiesView.ts +1 -1
  119. package/front_end/panels/network/NetworkDataGridNode.ts +2 -44
  120. package/front_end/panels/network/NetworkLogView.ts +6 -4
  121. package/front_end/panels/network/RequestPreviewView.ts +0 -7
  122. package/front_end/panels/network/components/RequestHeadersView.ts +0 -6
  123. package/front_end/panels/network/components/components.ts +0 -2
  124. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +1 -1
  125. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
  126. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +40 -48
  127. package/front_end/panels/search/SearchResultsPane.ts +2 -3
  128. package/front_end/panels/security/IPProtectionView.ts +1 -1
  129. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +4 -0
  130. package/front_end/panels/settings/emulation/utils/StructuredHeaders.ts +45 -37
  131. package/front_end/panels/sources/BreakpointsViewUtils.ts +11 -9
  132. package/front_end/panels/sources/DebuggerPlugin.ts +8 -4
  133. package/front_end/panels/sources/SourcesPanel.ts +1 -1
  134. package/front_end/panels/sources/UISourceCodeFrame.ts +1 -1
  135. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +4 -2
  136. package/front_end/panels/timeline/CountersGraph.ts +12 -5
  137. package/front_end/panels/timeline/EasterEgg.d.ts +5 -3
  138. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +8 -6
  139. package/front_end/panels/timeline/ModificationsManager.ts +5 -3
  140. package/front_end/panels/timeline/ThreadAppender.ts +7 -5
  141. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -8
  142. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +1 -1
  143. package/front_end/panels/timeline/TimelineFlameChartView.ts +17 -0
  144. package/front_end/panels/timeline/TimelinePanel.ts +15 -8
  145. package/front_end/panels/timeline/TimelineSelection.ts +4 -2
  146. package/front_end/panels/timeline/TimelineUIUtils.ts +17 -6
  147. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +6 -4
  148. package/front_end/panels/timeline/components/ExportTraceOptions.ts +21 -9
  149. package/front_end/panels/timeline/components/Utils.ts +1 -1
  150. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -3
  151. package/front_end/panels/timeline/timelineDetailsView.css +5 -0
  152. package/front_end/panels/timeline/utils/Helpers.ts +1 -1
  153. package/front_end/panels/utils/utils.ts +1 -7
  154. package/front_end/services/trace_bounds/TraceBounds.ts +4 -2
  155. package/front_end/services/tracing/PerformanceTracing.ts +1 -1
  156. package/front_end/third_party/chromium/README.chromium +1 -1
  157. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  158. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  159. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  160. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  161. package/front_end/third_party/codemirror.next/package.json +3 -2
  162. package/front_end/third_party/puppeteer/README.chromium +2 -2
  163. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts +8 -10
  164. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.d.ts.map +1 -1
  165. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js +8 -10
  166. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Dialog.js.map +1 -1
  167. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts +28 -30
  168. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
  169. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js +27 -29
  170. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
  171. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +34 -38
  172. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
  173. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js +34 -38
  174. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
  175. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts +8 -1
  176. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  177. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js +12 -14
  178. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/HTTPRequest.js.map +1 -1
  179. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +92 -108
  180. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  181. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +33 -39
  182. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  183. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  184. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +5 -3
  185. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  186. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  187. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  188. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  189. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  190. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  191. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +14 -5
  192. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
  193. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
  194. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
  195. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +12 -6
  196. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
  197. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  198. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js +24 -2
  199. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Browser.js.map +1 -1
  200. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -2
  201. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  202. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  203. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js +3 -0
  204. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/HTTPRequest.js.map +1 -1
  205. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  206. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  207. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  208. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  209. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts +6 -8
  210. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.d.ts.map +1 -1
  211. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js +6 -8
  212. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Device.js.map +1 -1
  213. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
  214. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
  215. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  216. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +1 -1
  217. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  218. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +6 -3
  219. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
  220. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts +5 -7
  221. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  222. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js +5 -7
  223. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PuppeteerNode.js.map +1 -1
  224. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
  225. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
  226. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  227. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  228. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +188 -224
  229. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +140 -166
  230. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts +8 -10
  231. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.d.ts.map +1 -1
  232. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js +8 -10
  233. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Dialog.js.map +1 -1
  234. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts +28 -30
  235. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
  236. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js +27 -29
  237. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
  238. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +34 -38
  239. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
  240. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js +34 -38
  241. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
  242. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts +8 -1
  243. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.d.ts.map +1 -1
  244. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js +12 -14
  245. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/HTTPRequest.js.map +1 -1
  246. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +92 -108
  247. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  248. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +33 -39
  249. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  250. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  251. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +5 -3
  252. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  253. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  254. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  255. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  256. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +4 -2
  257. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
  258. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +15 -6
  259. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
  260. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
  261. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
  262. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +12 -6
  263. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
  264. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.d.ts.map +1 -1
  265. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js +24 -2
  266. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Browser.js.map +1 -1
  267. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts +1 -0
  268. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.d.ts.map +1 -1
  269. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js +3 -0
  270. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/HTTPRequest.js.map +1 -1
  271. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts +13 -22
  272. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.d.ts.map +1 -1
  273. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js +13 -22
  274. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/PredefinedNetworkConditions.js.map +1 -1
  275. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts +6 -8
  276. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.d.ts.map +1 -1
  277. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js +6 -8
  278. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Device.js.map +1 -1
  279. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
  280. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
  281. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +1 -1
  282. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
  283. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +6 -3
  284. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
  285. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts +5 -7
  286. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.d.ts.map +1 -1
  287. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js +5 -7
  288. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PuppeteerNode.js.map +1 -1
  289. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
  290. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
  291. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  292. package/front_end/third_party/puppeteer/package/lib/types.d.ts +188 -224
  293. package/front_end/third_party/puppeteer/package/package.json +3 -3
  294. package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +8 -10
  295. package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +27 -29
  296. package/front_end/third_party/puppeteer/package/src/api/Frame.ts +34 -38
  297. package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +17 -14
  298. package/front_end/third_party/puppeteer/package/src/api/Page.ts +92 -108
  299. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +5 -3
  300. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +5 -1
  301. package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +28 -3
  302. package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +16 -7
  303. package/front_end/third_party/puppeteer/package/src/bidi/core/Browser.ts +28 -2
  304. package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +4 -0
  305. package/front_end/third_party/puppeteer/package/src/cdp/PredefinedNetworkConditions.ts +13 -22
  306. package/front_end/third_party/puppeteer/package/src/common/Device.ts +6 -8
  307. package/front_end/third_party/puppeteer/package/src/generated/version.ts +1 -1
  308. package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +6 -3
  309. package/front_end/third_party/puppeteer/package/src/node/PuppeteerNode.ts +5 -7
  310. package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
  311. package/front_end/ui/components/chrome_link/ChromeLink.ts +4 -2
  312. package/front_end/ui/components/dialogs/Dialog.ts +13 -9
  313. package/front_end/ui/components/highlighting/HighlightElement.ts +77 -0
  314. package/front_end/ui/components/highlighting/HighlightManager.ts +37 -0
  315. package/front_end/ui/components/highlighting/highlighting.ts +2 -0
  316. package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +5 -3
  317. package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -3
  318. package/front_end/ui/components/menus/SelectMenu.ts +6 -4
  319. package/front_end/ui/components/survey_link/SurveyLink.ts +4 -2
  320. package/front_end/ui/components/text_editor/config.ts +10 -6
  321. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  322. package/front_end/ui/components/tooltips/Tooltip.ts +13 -4
  323. package/front_end/ui/legacy/ForwardedInputEventHandler.ts +4 -2
  324. package/front_end/ui/legacy/GlassPane.ts +1 -1
  325. package/front_end/ui/legacy/SettingsUI.ts +1 -5
  326. package/front_end/ui/legacy/Treeoutline.ts +12 -33
  327. package/front_end/ui/legacy/UIUtils.ts +19 -1
  328. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +12 -10
  329. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +30 -32
  330. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  331. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +25 -25
  332. package/front_end/ui/legacy/components/data_grid/dataGrid.css +5 -0
  333. package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +4 -2
  334. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -2
  335. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -6
  336. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +6 -4
  337. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -3
  338. package/front_end/ui/legacy/components/source_frame/XMLView.ts +22 -16
  339. package/front_end/ui/legacy/components/source_frame/xmlView.css +0 -2
  340. package/front_end/ui/legacy/components/utils/Linkifier.ts +6 -4
  341. package/front_end/ui/visual_logging/Debugging.ts +10 -6
  342. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -3
  343. package/inspector_overlay/common.ts +5 -3
  344. package/inspector_overlay/highlight_grid_common.ts +1 -1
  345. package/package.json +1 -1
  346. package/front_end/Images/src/bundle.svg +0 -3
  347. package/front_end/panels/network/components/WebBundleInfoView.css +0 -27
  348. package/front_end/panels/network/components/WebBundleInfoView.ts +0 -95
@@ -0,0 +1 @@
1
+ # The `ttl` field of the `Use-As-Dictionary` HTTP response header must be an integer
@@ -7085,6 +7085,10 @@ export const NativeFunctions = [
7085
7085
  name: "sendMessageToEmbedder",
7086
7086
  signatures: [["message"]]
7087
7087
  },
7088
+ {
7089
+ name: "IntersectionObserver",
7090
+ signatures: [["callback","?options"]]
7091
+ },
7088
7092
  {
7089
7093
  name: "layoutNextFragment",
7090
7094
  signatures: [["?options"]]
@@ -7982,7 +7986,7 @@ export const NativeFunctions = [
7982
7986
  },
7983
7987
  {
7984
7988
  name: "constant",
7985
- signatures: [["tensor"],["desc","buffer"]]
7989
+ signatures: [["tensor"],["desc","buffer"],["type","value"]]
7986
7990
  },
7987
7991
  {
7988
7992
  name: "argMin",
@@ -8830,6 +8834,10 @@ export const NativeFunctions = [
8830
8834
  name: "VideoEncoder",
8831
8835
  signatures: [["init"]]
8832
8836
  },
8837
+ {
8838
+ name: "VideoFrame",
8839
+ signatures: [["source","?init"],["data","init"]]
8840
+ },
8833
8841
  {
8834
8842
  name: "clipControlEXT",
8835
8843
  signatures: [["origin","depth"]]
@@ -2,8 +2,10 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- // The TimelineGrid is used in the Performance panel and Memory panel -> Allocating sampling, so the value can be either
6
- // milliseconds or bytes
5
+ /**
6
+ * The TimelineGrid is used in the Performance panel and Memory panel -> Allocating sampling, so the value can be either
7
+ * milliseconds or bytes
8
+ **/
7
9
  export interface Calculator {
8
10
  computePosition(value: number): number;
9
11
  formatValue(value: number, precision?: number): string;
@@ -72,10 +72,12 @@ export function calculateRequestTimeRanges(
72
72
  }
73
73
  }
74
74
 
75
- // In some situations, argument `start` may come before `startTime` (`timing.requestStart`). This is especially true
76
- // in cases such as SW static routing API where fields like `workerRouterEvaluationStart` or `workerCacheLookupStart`
77
- // is set before setting `timing.requestStart`. If the `start` and `end` is known to be a valid value (i.e. not default
78
- // invalid value -1 or undefined), we allow adding the range.
75
+ /**
76
+ * In some situations, argument `start` may come before `startTime` (`timing.requestStart`). This is especially true
77
+ * in cases such as SW static routing API where fields like `workerRouterEvaluationStart` or `workerCacheLookupStart`
78
+ * is set before setting `timing.requestStart`. If the `start` and `end` is known to be a valid value (i.e. not default
79
+ * invalid value -1 or undefined), we allow adding the range.
80
+ **/
79
81
  function addMaybeNegativeOffsetRange(name: RequestTimeRangeNames, start: number, end: number): void {
80
82
  addRange(name, startTime + (start / 1000), startTime + (end / 1000));
81
83
  }
@@ -240,7 +240,7 @@ const resolveScope = async(script: SDK.Script.Script, scopeChain: Formatter.Form
240
240
  return;
241
241
  }
242
242
  }
243
- // If there is no entry with the name field, try to infer the name from the source positions.
243
+ /** If there is no entry with the name field, try to infer the name from the source positions. **/
244
244
  async function resolvePosition(): Promise<void> {
245
245
  if (!sourceMap) {
246
246
  return;
@@ -684,10 +684,12 @@ export class RemoteObject extends SDK.RemoteObject.RemoteObject {
684
684
  }
685
685
  }
686
686
 
687
- // Resolve the frame's function name using the name associated with the opening
688
- // paren that starts the scope. If there is no name associated with the scope
689
- // start or if the function scope does not start with a left paren (e.g., arrow
690
- // function with one parameter), the resolution returns null.
687
+ /**
688
+ * Resolve the frame's function name using the name associated with the opening
689
+ * paren that starts the scope. If there is no name associated with the scope
690
+ * start or if the function scope does not start with a left paren (e.g., arrow
691
+ * function with one parameter), the resolution returns null.
692
+ **/
691
693
  async function getFunctionNameFromScopeStart(
692
694
  script: SDK.Script.Script, lineNumber: number, columnNumber: number): Promise<string|null> {
693
695
  // To reduce the overhead of resolving function names,
@@ -53,10 +53,12 @@ export type DeferredContent = {
53
53
  isEncoded: boolean,
54
54
  };
55
55
 
56
- // Some ContentProvider like NetworkRequests might never actually be able to return
57
- // a fully completed "requestContentData" as the request keeps on going indefinitely.
58
- // Such proivders can implement the "StreamingContentProvider" addition, which allows
59
- // for partial/streaming content.
56
+ /**
57
+ * Some ContentProvider like NetworkRequests might never actually be able to return
58
+ * a fully completed "requestContentData" as the request keeps on going indefinitely.
59
+ * Such proivders can implement the "StreamingContentProvider" addition, which allows
60
+ * for partial/streaming content.
61
+ **/
60
62
  export interface StreamingContentProvider extends ContentProvider {
61
63
  requestStreamingContent(): Promise<StreamingContentDataOrError>;
62
64
  }
@@ -192,6 +192,7 @@ function createLanternRequest(
192
192
  priority: request.args.data.priority,
193
193
  frameId: request.args.data.frame,
194
194
  fromWorker,
195
+ serverResponseTime: request.args.data.lrServerResponseTime ?? undefined,
195
196
  // Set later.
196
197
  redirects: undefined,
197
198
  redirectSource: undefined,
@@ -668,7 +668,7 @@ export function eventStackFrame(event: Types.Events.Event): Protocol.Runtime.Cal
668
668
  return {...topFrame, scriptId: String(topFrame.scriptId) as Protocol.Runtime.ScriptId};
669
669
  }
670
670
 
671
- // TODO(paulirish): rename to generateNodeId
671
+ /** TODO(paulirish): rename to generateNodeId **/
672
672
  export function generateEventID(event: Types.Events.Event): string {
673
673
  if (Types.Events.isProfileCall(event)) {
674
674
  const name = SamplesIntegrator.isNativeRuntimeFrame(event.callFrame) ?
@@ -483,7 +483,7 @@ export class PendingFrame {
483
483
  }
484
484
  }
485
485
 
486
- // The parameters of an impl-side BeginFrame.
486
+ /** The parameters of an impl-side BeginFrame. **/
487
487
  class BeginFrameInfo {
488
488
  seqId: number;
489
489
  startTime: Types.Timing.Micro;
@@ -497,10 +497,12 @@ class BeginFrameInfo {
497
497
  }
498
498
  }
499
499
 
500
- // A queue of BeginFrames pending visualization.
501
- // BeginFrames are added into this queue as they occur; later when their
502
- // corresponding DrawFrames occur (or lack thereof), the BeginFrames are removed
503
- // from the queue and their timestamps are used for visualization.
500
+ /**
501
+ * A queue of BeginFrames pending visualization.
502
+ * BeginFrames are added into this queue as they occur; later when their
503
+ * corresponding DrawFrames occur (or lack thereof), the BeginFrames are removed
504
+ * from the queue and their timestamps are used for visualization.
505
+ **/
504
506
  export class TimelineFrameBeginFrameQueue {
505
507
  private queueFrames: number[] = [];
506
508
 
@@ -64,12 +64,16 @@ interface RemoteFont {
64
64
  beginRemoteFontLoadEvent: Types.Events.BeginRemoteFontLoad;
65
65
  }
66
66
 
67
- // This represents the maximum #time we will allow a cluster to go before we
68
- // reset it.
67
+ /**
68
+ * This represents the maximum #time we will allow a cluster to go before we
69
+ * reset it.
70
+ **/
69
71
  export const MAX_CLUSTER_DURATION = Helpers.Timing.milliToMicro(Types.Timing.Milli(5000));
70
72
 
71
- // This represents the maximum #time we will allow between layout shift events
72
- // before considering it to be the start of a new cluster.
73
+ /**
74
+ * This represents the maximum #time we will allow between layout shift events
75
+ * before considering it to be the start of a new cluster.
76
+ **/
73
77
  export const MAX_SHIFT_TIME_DELTA = Helpers.Timing.milliToMicro(Types.Timing.Milli(1000));
74
78
 
75
79
  // Layout shifts are reported globally to the developer, irrespective of which
@@ -108,8 +112,10 @@ let clsWindowID = -1;
108
112
  let clusters: Types.Events.SyntheticLayoutShiftCluster[] = [];
109
113
  let clustersByNavigationId = new Map<Types.Events.NavigationId, Types.Events.SyntheticLayoutShiftCluster[]>();
110
114
 
111
- // Represents a point in time in which a LS score change
112
- // was recorded.
115
+ /**
116
+ * Represents a point in time in which a LS score change
117
+ * was recorded.
118
+ **/
113
119
  interface ScoreRecord {
114
120
  ts: number;
115
121
  score: number;
@@ -559,7 +565,7 @@ export function scoreClassificationForLayoutShift(score: number): ScoreClassific
559
565
  return state;
560
566
  }
561
567
 
562
- // Based on https://web.dev/cls/
568
+ /** Based on https://web.dev/cls/ **/
563
569
  export const enum LayoutShiftsThreshold {
564
570
  GOOD = 0,
565
571
  NEEDS_IMPROVEMENT = 0.1,
@@ -472,20 +472,22 @@ export interface MetaHandlerData {
472
472
  devicePixelRatio?: number;
473
473
  }
474
474
 
475
- // Each frame has a single render process at a given time but it can have
476
- // multiple render processes during a trace, for example if a navigation
477
- // occurred in the frame. This map tracks the process that was active for
478
- // each frame at each point in time. Also, because a process can be
479
- // assigned to multiple URLs, there is a window for each URL a process
480
- // was assigned.
481
- //
482
- // Note that different sites always end up in different render
483
- // processes, however two different URLs can point to the same site.
484
- // For example: https://google.com and https://maps.google.com point to
485
- // the same site.
486
- // Read more about this in
487
- // https://developer.chrome.com/articles/renderingng-architecture/#threads
488
- // and https://web.dev/same-site-same-origin/
475
+ /**
476
+ * Each frame has a single render process at a given time but it can have
477
+ * multiple render processes during a trace, for example if a navigation
478
+ * occurred in the frame. This map tracks the process that was active for
479
+ * each frame at each point in time. Also, because a process can be
480
+ * assigned to multiple URLs, there is a window for each URL a process
481
+ * was assigned.
482
+ *
483
+ * Note that different sites always end up in different render
484
+ * processes, however two different URLs can point to the same site.
485
+ * For example: https://google.com and https://maps.google.com point to
486
+ * the same site.
487
+ * Read more about this in
488
+ * https://developer.chrome.com/articles/renderingng-architecture/#threads
489
+ * and https://web.dev/same-site-same-origin/
490
+ **/
489
491
  export type FrameProcessData =
490
492
  Map<string,
491
493
  Map<Types.Events.ProcessID, Array<{frame: Types.Events.TraceFrame, window: Types.Timing.TraceWindowMicro}>>>;
@@ -14,14 +14,16 @@ import type {HandlerName} from './types.js';
14
14
  const MILLISECONDS_TO_MICROSECONDS = 1000;
15
15
  const SECONDS_TO_MICROSECONDS = 1000000;
16
16
 
17
- // Network requests from traces are actually formed of 5 trace records.
18
- // This handler tracks all trace records based on the request ID, and
19
- // then creates a new synthetic trace event for those network requests.
20
- //
21
- // This interface, then, defines the shape of the object we intend to
22
- // keep for each request in the trace. In the finalize we will convert
23
- // these 5 types of trace records to a synthetic complete event that
24
- // represents a composite of these trace records.
17
+ /**
18
+ * Network requests from traces are actually formed of 5 trace records.
19
+ * This handler tracks all trace records based on the request ID, and
20
+ * then creates a new synthetic trace event for those network requests.
21
+ *
22
+ * This interface, then, defines the shape of the object we intend to
23
+ * keep for each request in the trace. In the finalize we will convert
24
+ * these 5 types of trace records to a synthetic complete event that
25
+ * represents a composite of these trace records.
26
+ **/
25
27
  export interface TraceEventsForNetworkRequest {
26
28
  changePriority?: Types.Events.ResourceChangePriority;
27
29
  willSendRequests?: Types.Events.ResourceWillSendRequest[];
@@ -295,6 +297,7 @@ export async function finalize(): Promise<void> {
295
297
  *
296
298
  * See `_updateTimingsForLightrider` in Lighthouse for more detail.
297
299
  */
300
+ let lrServerResponseTime;
298
301
  if (isLightrider && request.receiveResponse?.args.data.headers) {
299
302
  timing = {
300
303
  requestTime: Helpers.Timing.microToSeconds(request.sendRequests.at(0)?.ts ?? 0 as Types.Timing.Micro),
@@ -330,6 +333,14 @@ export async function finalize(): Promise<void> {
330
333
  timing.connectEnd = TCPMs as Types.Timing.Milli;
331
334
  timing.sslEnd = TCPMs as Types.Timing.Milli;
332
335
  }
336
+
337
+ // Lightrider does not have any equivalent for `sendEnd` timing values. The
338
+ // closest we can get to the server response time is from a header that
339
+ // Lightrider sets.
340
+ const ResponseMsHeader = request.receiveResponse.args.data.headers.find(h => h.name === 'X-ResponseMs');
341
+ if (ResponseMsHeader) {
342
+ lrServerResponseTime = Math.max(0, parseInt(ResponseMsHeader.value, 10)) as Types.Timing.Milli;
343
+ }
333
344
  }
334
345
 
335
346
  // TODO: consider allowing chrome / about.
@@ -437,6 +448,15 @@ export async function finalize(): Promise<void> {
437
448
  Types.Timing.Micro((timing.receiveHeadersEnd - timing.sendEnd) * MILLISECONDS_TO_MICROSECONDS) :
438
449
  Types.Timing.Micro(0);
439
450
 
451
+ // Server Response Time
452
+ // =======================
453
+ // Time from when the send finished going to when the first byte of headers were received.
454
+ const serverResponseTime = timing ?
455
+ Types.Timing.Micro(
456
+ ((timing.receiveHeadersStart ?? timing.receiveHeadersEnd) - timing.sendEnd) *
457
+ MILLISECONDS_TO_MICROSECONDS) :
458
+ Types.Timing.Micro(0);
459
+
440
460
  // Download
441
461
  // =======================
442
462
  // Time from receipt of headers to the finish time.
@@ -502,6 +522,7 @@ export async function finalize(): Promise<void> {
502
522
  stalled,
503
523
  totalTime,
504
524
  waiting,
525
+ serverResponseTime,
505
526
  },
506
527
  // All fields below are from TraceEventsForNetworkRequest.
507
528
  decodedBodyLength,
@@ -526,6 +547,7 @@ export async function finalize(): Promise<void> {
526
547
  initiator: finalSendRequest.args.data.initiator,
527
548
  stackTrace: finalSendRequest.args.data.stackTrace,
528
549
  timing,
550
+ lrServerResponseTime,
529
551
  url,
530
552
  failed: request.resourceFinish?.args.data.didFail ?? false,
531
553
  finished: Boolean(request.resourceFinish),
@@ -184,7 +184,7 @@ export function addEventToEntityMapping(event: Types.Events.Event, entityMapping
184
184
  entityMappings.entityByEvent.set(event, entity);
185
185
  }
186
186
 
187
- // A slight upgrade of addEventToEntityMapping to handle the sub-events of a network request.
187
+ /** A slight upgrade of addEventToEntityMapping to handle the sub-events of a network request. **/
188
188
  export function addNetworkRequestToEntityMapping(
189
189
  networkRequest: Types.Events.SyntheticNetworkRequest, entityMappings: EntityMappings,
190
190
  requestTraceEvents: TraceEventsForNetworkRequest): void {
@@ -20,22 +20,24 @@ export interface Handler {
20
20
 
21
21
  export type HandlerName = keyof typeof ModelHandlers;
22
22
 
23
- // This type maps Handler names to the return type of their data
24
- // function. So, for example, if we are given an object with a key of 'foo'
25
- // and a value which is a TraceHandler containing a data() function that
26
- // returns a string, this type will be { foo: string }.
27
- //
28
- // This allows us to model the behavior of the TraceProcessor in the model,
29
- // which takes an object with Handlers as part of its config, and
30
- // which ultimately returns an object keyed off the names of the
31
- // Handlers, and with values that are derived from each
32
- // Handler's data function.
33
- //
34
- // So, concretely, we provide a Handler for calculating the #time
35
- // bounds of a trace called TraceBounds, whose data() function returns a
36
- // TraceWindow. The HandlerData, therefore, would determine that the
37
- // TraceProcessor would contain a key called 'TraceBounds' whose value is
38
- // a TraceWindow.
23
+ /**
24
+ * This type maps Handler names to the return type of their data
25
+ * function. So, for example, if we are given an object with a key of 'foo'
26
+ * and a value which is a TraceHandler containing a data() function that
27
+ * returns a string, this type will be { foo: string }.
28
+ *
29
+ * This allows us to model the behavior of the TraceProcessor in the model,
30
+ * which takes an object with Handlers as part of its config, and
31
+ * which ultimately returns an object keyed off the names of the
32
+ * Handlers, and with values that are derived from each
33
+ * Handler's data function.
34
+ *
35
+ * So, concretely, we provide a Handler for calculating the #time
36
+ * bounds of a trace called TraceBounds, whose data() function returns a
37
+ * TraceWindow. The HandlerData, therefore, would determine that the
38
+ * TraceProcessor would contain a key called 'TraceBounds' whose value is
39
+ * a TraceWindow.
40
+ **/
39
41
  export type EnabledHandlerDataWithMeta<T extends Record<string, Handler>> = {
40
42
  // We allow the user to configure which handlers are created by passing them
41
43
  // in when constructing a model instance. However, we then ensure that the
@@ -58,9 +60,11 @@ export type HandlersWithMeta<T extends Record<string, Handler>> = {
58
60
  [K in keyof T]: T[K];
59
61
  };
60
62
 
61
- // Represents the final data from all of the handlers. If you instantiate a
62
- // TraceProcessor with a subset of handlers, you should instead use
63
- // `EnabledHandlerDataWithMeta<>`.
63
+ /**
64
+ * Represents the final data from all of the handlers. If you instantiate a
65
+ * TraceProcessor with a subset of handlers, you should instead use
66
+ * `EnabledHandlerDataWithMeta<>`.
67
+ **/
64
68
  export type HandlerData = Readonly<EnabledHandlerDataWithMeta<typeof ModelHandlers>>;
65
69
 
66
70
  type DeepWriteable<T> = {
@@ -39,8 +39,10 @@ export function timeStampForEventAdjustedByClosestNavigation(
39
39
  return Types.Timing.Micro(eventTimeStamp);
40
40
  }
41
41
 
42
- // Expands the trace window by a provided percentage or, if it the expanded window is smaller than 1 millisecond, expands it to 1 millisecond.
43
- // If the expanded window is outside of the max trace window, cut the overflowing bound to the max trace window bound.
42
+ /**
43
+ * Expands the trace window by a provided percentage or, if it the expanded window is smaller than 1 millisecond, expands it to 1 millisecond.
44
+ * If the expanded window is outside of the max trace window, cut the overflowing bound to the max trace window bound.
45
+ **/
44
46
  export function expandWindowByPercentOrToOneMillisecond(
45
47
  annotationWindow: Types.Timing.TraceWindowMicro, maxTraceWindow: Types.Timing.TraceWindowMicro,
46
48
  percentage: number): Types.Timing.TraceWindowMicro {
@@ -85,8 +85,10 @@ export function extractOriginFromTrace(firstNavigationURL: string): string|null
85
85
  }
86
86
 
87
87
  export type EventsInThread<T extends Types.Events.Event> = Map<Types.Events.ThreadID, T[]>;
88
- // Each thread contains events. Events indicate the thread and process IDs, which are
89
- // used to store the event in the correct process thread entry below.
88
+ /**
89
+ * Each thread contains events. Events indicate the thread and process IDs, which are
90
+ * used to store the event in the correct process thread entry below.
91
+ **/
90
92
  export function addEventToProcessThread<T extends Types.Events.Event>(
91
93
  event: T,
92
94
  eventsInProcessThread: Map<Types.Events.ProcessID, EventsInThread<T>>,
@@ -822,8 +824,10 @@ export function extractSampleTraceId(event: Types.Events.Event): number|null {
822
824
  return event.args?.sampleTraceId ?? event.args?.data?.sampleTraceId ?? null;
823
825
  }
824
826
 
825
- // This exactly matches Trace.Styles.visibleTypes. See the runtime verification in maybeInitStylesMap.
826
- // TODO(crbug.com/410884528)
827
+ /**
828
+ * This exactly matches Trace.Styles.visibleTypes. See the runtime verification in maybeInitStylesMap.
829
+ * TODO(crbug.com/410884528)
830
+ **/
827
831
  export const VISIBLE_TRACE_EVENT_TYPES = new Set<Types.Events.Name>([
828
832
  Types.Events.Name.ABORT_POST_TASK_CALLBACK,
829
833
  Types.Events.Name.ANIMATION,
@@ -95,15 +95,14 @@ export type DocumentLatencyInsightModel = InsightModel<typeof UIStrings, {
95
95
  },
96
96
  }>;
97
97
 
98
- function getServerResponseTime(
99
- request: Types.Events.SyntheticNetworkRequest, context: InsightSetContext): Types.Timing.Milli|null {
100
- // Prefer the value as given by the Lantern provider.
101
- // For PSI, Lighthouse uses this to set a better value for the server response
102
- // time. For technical reasons, in Lightrider we do not have `sendEnd` timing
103
- // values. See Lighthouse's `asLanternNetworkRequest` function for more.
104
- const lanternRequest = context.navigation && context.lantern?.requests.find(r => r.rawRequest === request);
105
- if (lanternRequest?.serverResponseTime !== undefined) {
106
- return lanternRequest.serverResponseTime as Types.Timing.Milli;
98
+ function getServerResponseTime(request: Types.Events.SyntheticNetworkRequest): Types.Timing.Milli|null {
99
+ // For technical reasons, Lightrider does not have `sendEnd` timing values. The
100
+ // closest we can get to the server response time is from a header that Lightrider
101
+ // sets.
102
+ // @ts-expect-error
103
+ const isLightrider = globalThis.isLightrider;
104
+ if (isLightrider) {
105
+ return request.args.data.lrServerResponseTime ?? null;
107
106
  }
108
107
 
109
108
  const timing = request.args.data.timing;
@@ -111,7 +110,7 @@ function getServerResponseTime(
111
110
  return null;
112
111
  }
113
112
 
114
- const ms = Helpers.Timing.microToMilli(request.args.data.syntheticData.waiting);
113
+ const ms = Helpers.Timing.microToMilli(request.args.data.syntheticData.serverResponseTime);
115
114
  return Math.round(ms) as Types.Timing.Milli;
116
115
  }
117
116
 
@@ -202,7 +201,7 @@ export function generateInsight(
202
201
  return finalize({warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});
203
202
  }
204
203
 
205
- const serverResponseTime = getServerResponseTime(documentRequest, context);
204
+ const serverResponseTime = getServerResponseTime(documentRequest);
206
205
  if (serverResponseTime === null) {
207
206
  throw new Error('missing document request timing');
208
207
  }
@@ -3,7 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as i18n from '../../../core/i18n/i18n.js';
6
- import type * as Handlers from '../handlers/handlers.js';
6
+ import * as Handlers from '../handlers/handlers.js';
7
7
  import * as Helpers from '../helpers/helpers.js';
8
8
  import type {SyntheticInteractionPair} from '../types/TraceEvents.js';
9
9
  import type * as Types from '../types/types.js';
@@ -67,13 +67,24 @@ export function isINPBreakdownInsight(insight: InsightModel): insight is INPBrea
67
67
  }
68
68
 
69
69
  function finalize(partialModel: PartialInsightModel<INPBreakdownInsightModel>): INPBreakdownInsightModel {
70
+ let state: INPBreakdownInsightModel['state'] = 'pass';
71
+ if (partialModel.longestInteractionEvent) {
72
+ const classification = Handlers.ModelHandlers.UserInteractions.scoreClassificationForInteractionToNextPaint(
73
+ partialModel.longestInteractionEvent.dur);
74
+ if (classification === Handlers.ModelHandlers.PageLoadMetrics.ScoreClassification.GOOD) {
75
+ state = 'informative';
76
+ } else {
77
+ state = 'fail';
78
+ }
79
+ }
80
+
70
81
  return {
71
82
  insightKey: InsightKeys.INP_BREAKDOWN,
72
83
  strings: UIStrings,
73
84
  title: i18nString(UIStrings.title),
74
85
  description: i18nString(UIStrings.description),
75
86
  category: InsightCategory.INP,
76
- state: partialModel.longestInteractionEvent ? 'informative' : 'pass',
87
+ state,
77
88
  ...partialModel,
78
89
  };
79
90
  }
@@ -65,7 +65,7 @@ export const UIStrings = {
65
65
  const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LCPBreakdown.ts', UIStrings);
66
66
  export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
67
67
 
68
- // A TraceWindow plus its UIString.
68
+ /** A TraceWindow plus its UIString. **/
69
69
  export type Subpart = Types.Timing.TraceWindowMicro&{label: Common.UIString.LocalizedString};
70
70
  interface LCPSubparts {
71
71
  /**
@@ -180,13 +180,25 @@ function finalize(partialModel: PartialInsightModel<LCPBreakdownInsightModel>):
180
180
  if (partialModel.lcpRequest) {
181
181
  relatedEvents.push(partialModel.lcpRequest);
182
182
  }
183
+
184
+ let state: LCPBreakdownInsightModel['state'] = 'pass';
185
+ if (partialModel.lcpMs !== undefined) {
186
+ const classification = Handlers.ModelHandlers.PageLoadMetrics.scoreClassificationForLargestContentfulPaint(
187
+ Helpers.Timing.milliToMicro(partialModel.lcpMs));
188
+ if (classification === Handlers.ModelHandlers.PageLoadMetrics.ScoreClassification.GOOD) {
189
+ state = 'informative';
190
+ } else {
191
+ state = 'fail';
192
+ }
193
+ }
194
+
183
195
  return {
184
196
  insightKey: InsightKeys.LCP_BREAKDOWN,
185
197
  strings: UIStrings,
186
198
  title: i18nString(UIStrings.title),
187
199
  description: i18nString(UIStrings.description),
188
200
  category: InsightCategory.LCP,
189
- state: partialModel.lcpEvent || partialModel.lcpRequest ? 'informative' : 'pass',
201
+ state,
190
202
  ...partialModel,
191
203
  relatedEvents,
192
204
  };
@@ -458,7 +458,7 @@ export function handleLinkResponseHeader(linkHeaderValue: string): Array<{url: s
458
458
  return preconnectedOrigins;
459
459
  }
460
460
 
461
- // Export the function for test purpose.
461
+ /** Export the function for test purpose. **/
462
462
  export function generatePreconnectedOrigins(
463
463
  data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation,
464
464
  contextRequests: Types.Events.SyntheticNetworkRequest[],
@@ -584,7 +584,7 @@ function candidateRequestsByOrigin(
584
584
  return origins;
585
585
  }
586
586
 
587
- // Export the function for test purpose.
587
+ /** Export the function for test purpose. **/
588
588
  export function generatePreconnectCandidates(
589
589
  data: Handlers.Types.HandlerData, context: InsightSetContextWithNavigation,
590
590
  contextRequests: Types.Events.SyntheticNetworkRequest[]): PreconnectCandidate[] {
@@ -124,17 +124,19 @@ export function isEntriesLinkAnnotation(annotation: Annotation): annotation is E
124
124
  return annotation.type === 'ENTRIES_LINK';
125
125
  }
126
126
 
127
- // Serializable keys are created for trace events to be able to save
128
- // references to timeline events in a trace file. These keys enable
129
- // user modifications that can be saved. See go/cpq:event-data-json for
130
- // more details on the key format.
127
+ /**
128
+ * Serializable keys are created for trace events to be able to save
129
+ * references to timeline events in a trace file. These keys enable
130
+ * user modifications that can be saved. See go/cpq:event-data-json for
131
+ * more details on the key format.
132
+ **/
131
133
  export type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;
132
134
  export type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;
133
135
  export type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;
134
136
  export type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;
135
137
  export type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;
136
138
 
137
- // Serializable keys values objects contain data that maps the keys to original Trace Events
139
+ /** Serializable keys values objects contain data that maps the keys to original Trace Events **/
138
140
  export interface RawEventKeyValues {
139
141
  type: EventKeyType.RAW_EVENT;
140
142
  rawIndex: number;
@@ -172,9 +174,11 @@ export interface Modifications {
172
174
  annotations: SerializedAnnotations;
173
175
  }
174
176
 
175
- // IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig
176
- // However, the PerfUI code should not depend on the model/trace, and similarly
177
- // this model cannot depend on that code, so we duplicate it.
177
+ /**
178
+ * IMPORTANT: this is the same as PerfUI.FlameChart.PersistedGroupConfig
179
+ * However, the PerfUI code should not depend on the model/trace, and similarly
180
+ * this model cannot depend on that code, so we duplicate it.
181
+ **/
178
182
  export interface TrackVisualConfig {
179
183
  hidden: boolean;
180
184
  expanded: boolean;
@@ -25,6 +25,6 @@ export interface TraceWindow<TimeFormat extends Micro|Milli> {
25
25
  range: TimeFormat;
26
26
  }
27
27
 
28
- // See front_end/models/trace/helpers/Timing.ts for helpful utility functions like traceWindowFromMicroSeconds
28
+ /** See front_end/models/trace/helpers/Timing.ts for helpful utility functions like traceWindowFromMicroSeconds **/
29
29
  export type TraceWindowMicro = TraceWindow<Micro>;
30
30
  export type TraceWindowMilli = TraceWindow<Milli>;