chrome-devtools-frontend 1.0.1602348 → 1.0.1603822

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 (105) hide show
  1. package/.agents/skills/version-control/SKILL.md +17 -2
  2. package/AUTHORS +1 -0
  3. package/front_end/core/common/Settings.ts +1 -871
  4. package/front_end/core/common/VersionController.ts +880 -0
  5. package/front_end/core/common/common.ts +2 -0
  6. package/front_end/core/platform/HostRuntime.ts +9 -3
  7. package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
  8. package/front_end/core/root/Runtime.ts +5 -0
  9. package/front_end/core/sdk/OverlayModel.ts +13 -13
  10. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +13 -10
  11. package/front_end/core/sdk/RuntimeModel.ts +5 -5
  12. package/front_end/core/sdk/ServiceWorkerManager.ts +4 -2
  13. package/front_end/core/sdk/Target.ts +5 -0
  14. package/front_end/core/sdk/TargetManager.ts +5 -0
  15. package/front_end/core/sdk/WebMCPModel.ts +104 -0
  16. package/front_end/core/sdk/sdk.ts +2 -0
  17. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +13 -19
  18. package/front_end/generated/InspectorBackendCommands.ts +3 -0
  19. package/front_end/generated/protocol-mapping.d.ts +8 -0
  20. package/front_end/generated/protocol-proxy-api.d.ts +10 -0
  21. package/front_end/generated/protocol.ts +57 -0
  22. package/front_end/models/ai_assistance/AiConversation.ts +3 -3
  23. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +50 -0
  24. package/front_end/models/ai_assistance/agents/AiAgent.ts +14 -1
  25. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +19 -4
  26. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +7 -1
  27. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +30 -7
  28. package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -23
  29. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +60 -9
  30. package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +71 -15
  31. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +7 -7
  32. package/front_end/models/javascript_metadata/NativeFunctions.js +6 -2
  33. package/front_end/models/lighthouse/LighthouseReporterTypes.ts +10 -8
  34. package/front_end/models/lighthouse/RunTypes.ts +3 -1
  35. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +13 -5
  36. package/front_end/panels/ai_assistance/components/ChatMessage.ts +143 -18
  37. package/front_end/panels/ai_assistance/components/WalkthroughView.ts +30 -10
  38. package/front_end/panels/ai_assistance/components/chatMessage.css +58 -3
  39. package/front_end/panels/ai_assistance/components/walkthroughView.css +35 -5
  40. package/front_end/panels/application/AppManifestView.ts +2 -2
  41. package/front_end/panels/application/BackgroundServiceView.ts +9 -9
  42. package/front_end/panels/application/FrameDetailsView.ts +4 -13
  43. package/front_end/panels/application/IndexedDBViews.ts +1 -1
  44. package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -3
  45. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
  46. package/front_end/panels/application/components/permissionsPolicySection.css +54 -52
  47. package/front_end/panels/application/frameDetailsReportView.css +13 -1
  48. package/front_end/panels/common/ThrottlingUtils.ts +46 -0
  49. package/front_end/panels/common/common.ts +1 -0
  50. package/front_end/panels/elements/CSSValueTraceView.ts +9 -1
  51. package/front_end/panels/elements/ComputedStyleWidget.ts +11 -1
  52. package/front_end/panels/elements/PropertiesWidget.ts +14 -13
  53. package/front_end/panels/elements/PropertyRenderer.ts +10 -9
  54. package/front_end/panels/elements/StandaloneStylesContainer.ts +15 -5
  55. package/front_end/panels/elements/StylePropertiesSection.ts +0 -49
  56. package/front_end/panels/elements/StylePropertyTreeElement.ts +20 -0
  57. package/front_end/panels/elements/StylesContainer.ts +0 -1
  58. package/front_end/panels/elements/StylesSidebarPane.ts +65 -31
  59. package/front_end/panels/elements/stylePropertiesTreeOutline.css +5 -0
  60. package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +2 -2
  61. package/front_end/panels/lighthouse/LighthouseController.ts +4 -1
  62. package/front_end/panels/media/EventDisplayTable.ts +3 -2
  63. package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +14 -0
  64. package/front_end/panels/network/EventSourceMessagesView.ts +2 -2
  65. package/front_end/panels/network/ResourceChunkView.ts +1 -1
  66. package/front_end/panels/profiler/HeapDetachedElementsView.ts +9 -4
  67. package/front_end/panels/profiler/HeapProfileView.ts +8 -4
  68. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +40 -33
  69. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  70. package/front_end/panels/profiler/HeapSnapshotProxy.ts +1 -1
  71. package/front_end/panels/profiler/HeapSnapshotView.ts +12 -18
  72. package/front_end/panels/profiler/LiveHeapProfileView.ts +3 -4
  73. package/front_end/panels/profiler/ProfileHeader.ts +5 -11
  74. package/front_end/panels/profiler/ProfileView.ts +1 -10
  75. package/front_end/panels/sensors/SensorsView.ts +24 -43
  76. package/front_end/panels/settings/keybindsSettingsTab.css +25 -31
  77. package/front_end/panels/timeline/EventsTimelineTreeView.ts +2 -2
  78. package/front_end/panels/timeline/ThirdPartyTreeView.ts +8 -0
  79. package/front_end/panels/timeline/TimelinePanel.ts +14 -2
  80. package/front_end/panels/timeline/TimelineTreeView.ts +19 -17
  81. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +5 -9
  82. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -2
  83. package/front_end/panels/timeline/components/OriginMap.ts +176 -159
  84. package/front_end/panels/timeline/components/originMap.css +4 -51
  85. package/front_end/panels/timeline/components/timelineRangeSummaryView.css +3 -1
  86. package/front_end/panels/timeline/thirdPartyTreeView.css +6 -0
  87. package/front_end/panels/timeline/timeline-meta.ts +11 -0
  88. package/front_end/panels/timeline/utils/Helpers.ts +5 -25
  89. package/front_end/panels/webauthn/WebauthnPane.ts +52 -0
  90. package/front_end/third_party/acorn/README.chromium +1 -0
  91. package/front_end/third_party/chromium/README.chromium +1 -1
  92. package/front_end/ui/components/{list → lists}/List.ts +1 -1
  93. package/front_end/ui/components/{list → lists}/list.css +0 -1
  94. package/front_end/ui/legacy/Treeoutline.ts +7 -3
  95. package/front_end/ui/legacy/UIUtils.ts +13 -11
  96. package/front_end/ui/legacy/Widget.ts +5 -0
  97. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  98. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +3 -3
  99. package/front_end/ui/legacy/components/data_grid/SortableDataGrid.ts +2 -2
  100. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +39 -23
  101. package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +20 -4
  102. package/front_end/ui/legacy/treeoutline.css +4 -0
  103. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  104. package/package.json +1 -1
  105. /package/front_end/ui/components/{list → lists}/lists.ts +0 -0
@@ -831,6 +831,9 @@ export class LightDarkColorRenderer extends rendererBase(SDK.CSSPropertyParserMa
831
831
  lightControls: SDK.CSSPropertyParser.CSSControlMap,
832
832
  darkControls: SDK.CSSPropertyParser.CSSControlMap): Promise<void> {
833
833
  const activeColor = await this.#activeColor(match);
834
+ if (context.signal?.aborted) {
835
+ return;
836
+ }
834
837
  if (!activeColor) {
835
838
  return;
836
839
  }
@@ -967,6 +970,9 @@ export class ColorMixRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
967
970
  context.addControl('color', swatch);
968
971
  const asyncEvalCallback = async(): Promise<boolean> => {
969
972
  const results = await this.#stylesContainer.cssModel()?.resolveValues(undefined, nodeId, colorMixText);
973
+ if (context.signal?.aborted) {
974
+ return false;
975
+ }
970
976
  if (results) {
971
977
  const color = Common.Color.parse(results[0]);
972
978
  if (color) {
@@ -1702,6 +1708,10 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1702
1708
  valueElement: HTMLElement, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<boolean> {
1703
1709
  const pixelValue = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text);
1704
1710
 
1711
+ if (context.signal?.aborted) {
1712
+ return false;
1713
+ }
1714
+
1705
1715
  if (pixelValue?.[0] && pixelValue?.[0] !== match.text) {
1706
1716
  valueElement.textContent = pixelValue[0];
1707
1717
  return true;
@@ -1726,6 +1736,9 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1726
1736
  async getTooltipValue(
1727
1737
  tooltip: Tooltips.Tooltip.Tooltip, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<void> {
1728
1738
  const pixelValue = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text);
1739
+ if (context.signal?.aborted) {
1740
+ return;
1741
+ }
1729
1742
  if (!pixelValue) {
1730
1743
  return;
1731
1744
  }
@@ -1799,6 +1812,9 @@ export class BaseFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatc
1799
1812
  return null;
1800
1813
  });
1801
1814
  const evaled = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, value);
1815
+ if (context.signal?.aborted) {
1816
+ return false;
1817
+ }
1802
1818
  if (!evaled?.[0] || evaled[0] === value) {
1803
1819
  return false;
1804
1820
  }
@@ -1815,6 +1831,9 @@ export class BaseFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatc
1815
1831
  const values = match.args.map(arg => context.matchedResult.getComputedTextRange(arg[0], arg[arg.length - 1]));
1816
1832
  values.unshift(context.matchedResult.getComputedText(match.node));
1817
1833
  const evaledArgs = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, ...values);
1834
+ if (context.signal?.aborted) {
1835
+ return;
1836
+ }
1818
1837
  if (!evaledArgs) {
1819
1838
  return;
1820
1839
  }
@@ -3495,6 +3514,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
3495
3514
  if (this.prompt) {
3496
3515
  this.prompt.detach();
3497
3516
  this.prompt = null;
3517
+ this.#clearGhostTextInValue();
3498
3518
  }
3499
3519
  }
3500
3520
 
@@ -17,7 +17,6 @@ export interface StylesContainer {
17
17
  activeCSSAngle: InlineEditor.CSSAngle.CSSAngle|null;
18
18
  readonly webCustomData: WebCustomData|undefined;
19
19
  isEditingStyle: boolean;
20
- userOperation: boolean;
21
20
  readonly sectionByElement: WeakMap<Node, StylePropertiesSection>;
22
21
  readonly element: HTMLElement;
23
22
  readonly linkifier: Components.Linkifier.Linkifier;
@@ -189,7 +189,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
189
189
  private readonly decorator: StylePropertyHighlighter;
190
190
 
191
191
  private lastRevealedProperty: SDK.CSSProperty.CSSProperty|null = null;
192
- userOperation = false;
192
+ private userOperation = false;
193
193
  isEditingStyle = false;
194
194
  #filterRegex: RegExp|null = null;
195
195
  #isRegex = false;
@@ -212,6 +212,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
212
212
 
213
213
  activeCSSAngle: InlineEditor.CSSAngle.CSSAngle|null = null;
214
214
  #updateAbortController?: AbortController;
215
+ #updateComputedStylesAbortController?: AbortController;
215
216
 
216
217
  constructor(computedStyleModel: ComputedStyle.ComputedStyleModel.ComputedStyleModel) {
217
218
  super(computedStyleModel, {delegatesFocus: true});
@@ -318,7 +319,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
318
319
  forceUpdate(): void {
319
320
  this.needsForceUpdate = true;
320
321
  this.#swatchPopoverHelper.hide();
321
- this.#updateAbortController?.abort();
322
322
  this.resetCache();
323
323
  this.requestUpdate();
324
324
  }
@@ -507,10 +507,8 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
507
507
  this.nodeStylesUpdatedForTest(node, false);
508
508
  }
509
509
 
510
- override async performUpdate(): Promise<void> {
511
- this.#updateAbortController?.abort();
512
- this.#updateAbortController = new AbortController();
513
- await this.#innerDoUpdate(this.#updateAbortController.signal);
510
+ override async performUpdate(signal?: AbortSignal): Promise<void> {
511
+ await this.#innerDoUpdate(signal);
514
512
 
515
513
  // Hide all popovers when scrolling.
516
514
  // Styles and Computed panels both have popover (e.g. imagePreviewPopover),
@@ -526,10 +524,10 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
526
524
  }
527
525
  }
528
526
 
529
- async #innerDoUpdate(signal: AbortSignal): Promise<void> {
527
+ async #innerDoUpdate(signal?: AbortSignal): Promise<void> {
530
528
  if (!this.initialUpdateCompleted) {
531
529
  window.setTimeout(() => {
532
- if (signal.aborted) {
530
+ if (signal?.aborted) {
533
531
  return;
534
532
  }
535
533
  if (!this.initialUpdateCompleted) {
@@ -541,9 +539,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
541
539
 
542
540
  const matchedStyles = await this.fetchMatchedCascade();
543
541
 
544
- if (signal.aborted) {
545
- return;
546
- }
542
+ signal?.throwIfAborted();
547
543
 
548
544
  this.matchedStyles = matchedStyles;
549
545
  const nodeId = this.node()?.id;
@@ -554,16 +550,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
554
550
  this.fetchComputedStyleExtraFieldsFor(nodeId)
555
551
  ]);
556
552
 
557
- if (signal.aborted) {
558
- return;
559
- }
553
+ signal?.throwIfAborted();
560
554
 
561
555
  await this.innerRebuildUpdate(
562
556
  signal, this.matchedStyles, computedStyles, parentsComputedStyles, computedStyleExtraFields);
563
557
 
564
- if (signal.aborted) {
565
- return;
566
- }
558
+ signal?.throwIfAborted();
567
559
 
568
560
  if (!this.initialUpdateCompleted) {
569
561
  this.initialUpdateCompleted = true;
@@ -698,9 +690,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
698
690
 
699
691
  override onCSSModelChanged(
700
692
  event: Common.EventTarget.EventTargetEvent<ComputedStyle.ComputedStyleModel.CSSModelChangedEvent>): void {
701
- // We only recreate sections if this update is more than an "edit" operation.
702
- // Sections will pull their own updates in the case of an "edit".
703
- if (event?.data && 'edit' in event.data && event.data.edit) {
693
+ const edit = event?.data && 'edit' in event.data ? event.data.edit : null;
694
+ if (edit) {
695
+ for (const section of this.allSections()) {
696
+ section.styleSheetEdited(edit);
697
+ }
698
+ void this.#refreshComputedStyles();
704
699
  return;
705
700
  }
706
701
 
@@ -723,6 +718,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
723
718
 
724
719
  #resetUpdateIfNotEditing(): void {
725
720
  if (this.userOperation || this.isEditingStyle) {
721
+ void this.#refreshComputedStyles();
726
722
  return;
727
723
  }
728
724
 
@@ -871,6 +867,28 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
871
867
  }
872
868
  }
873
869
 
870
+ async #refreshComputedStyles(): Promise<void> {
871
+ this.#updateComputedStylesAbortController?.abort();
872
+ this.#updateAbortController = new AbortController();
873
+ const signal = this.#updateAbortController.signal;
874
+ const matchedStyles = await this.fetchMatchedCascade();
875
+ const nodeId = this.node()?.id;
876
+ const parentNodeId = matchedStyles?.getParentLayoutNodeId();
877
+
878
+ const [computedStyles, parentsComputedStyles] =
879
+ await Promise.all([this.fetchComputedStylesFor(nodeId), this.fetchComputedStylesFor(parentNodeId)]);
880
+
881
+ if (signal.aborted) {
882
+ return;
883
+ }
884
+
885
+ for (const section of this.allSections()) {
886
+ section.setComputedStyles(computedStyles);
887
+ section.setParentsComputedStyles(parentsComputedStyles);
888
+ section.updateAuthoringHint();
889
+ }
890
+ }
891
+
874
892
  focusedSectionIndex(): number {
875
893
  let index = 0;
876
894
  for (const block of this.sectionBlocks) {
@@ -897,7 +915,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
897
915
  }
898
916
 
899
917
  private async innerRebuildUpdate(
900
- signal: AbortSignal, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null,
918
+ signal: AbortSignal|undefined, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null,
901
919
  computedStyles: Map<string, string>|null, parentsComputedStyles: Map<string, string>|null,
902
920
  computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): Promise<void> {
903
921
  // ElementsSidebarPane's throttler schedules this method. Usually,
@@ -913,9 +931,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
913
931
 
914
932
  this.linkifier.reset();
915
933
  const prevSections = this.sectionBlocks.map(block => block.sections).flat();
916
- for (const section of prevSections) {
917
- section.dispose();
918
- }
919
934
  this.sectionBlocks = [];
920
935
 
921
936
  const node = this.node();
@@ -928,12 +943,10 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
928
943
  }
929
944
 
930
945
  const blocks = await this.rebuildSectionsForMatchedStyleRules(
931
- (matchedStyles as SDK.CSSMatchedStyles.CSSMatchedStyles), computedStyles, parentsComputedStyles,
946
+ signal, (matchedStyles as SDK.CSSMatchedStyles.CSSMatchedStyles), computedStyles, parentsComputedStyles,
932
947
  computedStyleExtraFields);
933
948
 
934
- if (signal.aborted) {
935
- return;
936
- }
949
+ signal?.throwIfAborted();
937
950
 
938
951
  this.sectionBlocks = blocks;
939
952
 
@@ -1015,12 +1028,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1015
1028
  parentsComputedStyles: Map<string, string>|null,
1016
1029
  computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): Promise<SectionBlock[]> {
1017
1030
  return this.rebuildSectionsForMatchedStyleRules(
1018
- matchedStyles, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1031
+ undefined, matchedStyles, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1019
1032
  }
1020
1033
 
1021
1034
  private async rebuildSectionsForMatchedStyleRules(
1022
- matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string>|null,
1023
- parentsComputedStyles: Map<string, string>|null,
1035
+ signal: AbortSignal|undefined, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
1036
+ computedStyles: Map<string, string>|null, parentsComputedStyles: Map<string, string>|null,
1024
1037
  computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): Promise<SectionBlock[]> {
1025
1038
  if (this.idleCallbackManager) {
1026
1039
  this.idleCallbackManager.discard();
@@ -1074,6 +1087,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1074
1087
  const lastBlock = blocks[blocks.length - 1];
1075
1088
  if (lastBlock && (!isTransitionOrAnimationStyle || style.allProperties().length > 0)) {
1076
1089
  this.idleCallbackManager.schedule(() => {
1090
+ if (signal?.aborted) {
1091
+ return;
1092
+ }
1077
1093
  const section = new StylePropertiesSection(
1078
1094
  this, matchedStyles, style, sectionIdx, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1079
1095
  sectionIdx++;
@@ -1147,6 +1163,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1147
1163
  addLayerSeparator(style);
1148
1164
  const lastBlock = blocks[blocks.length - 1];
1149
1165
  this.idleCallbackManager.schedule(() => {
1166
+ if (signal?.aborted) {
1167
+ return;
1168
+ }
1150
1169
  const section = new HighlightPseudoStylePropertiesSection(
1151
1170
  this, matchedStyles, style, sectionIdx, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1152
1171
  sectionIdx++;
@@ -1159,6 +1178,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1159
1178
  const block = SectionBlock.createKeyframesBlock(keyframesRule.name().text);
1160
1179
  for (const keyframe of keyframesRule.keyframes()) {
1161
1180
  this.idleCallbackManager.schedule(() => {
1181
+ if (signal?.aborted) {
1182
+ return;
1183
+ }
1162
1184
  block.sections.push(new KeyframePropertiesSection(this, matchedStyles, keyframe.style, sectionIdx));
1163
1185
  sectionIdx++;
1164
1186
  });
@@ -1172,6 +1194,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1172
1194
  const block = SectionBlock.createAtRuleBlock(expandedByDefault);
1173
1195
  for (const atRule of atRules) {
1174
1196
  this.idleCallbackManager.schedule(() => {
1197
+ if (signal?.aborted) {
1198
+ return;
1199
+ }
1175
1200
  block.sections.push(new AtRuleSection(this, matchedStyles, atRule.style, sectionIdx, expandedByDefault));
1176
1201
  sectionIdx++;
1177
1202
  });
@@ -1182,6 +1207,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1182
1207
  for (const positionTryRule of matchedStyles.positionTryRules()) {
1183
1208
  const block = SectionBlock.createPositionTryBlock(positionTryRule.name().text);
1184
1209
  this.idleCallbackManager.schedule(() => {
1210
+ if (signal?.aborted) {
1211
+ return;
1212
+ }
1185
1213
  block.sections.push(new PositionTryRuleSection(
1186
1214
  this, matchedStyles, positionTryRule.style, sectionIdx, positionTryRule.active()));
1187
1215
  sectionIdx++;
@@ -1194,6 +1222,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1194
1222
  const block = SectionBlock.createRegisteredPropertiesBlock(expandedByDefault);
1195
1223
  for (const propertyRule of matchedStyles.registeredProperties()) {
1196
1224
  this.idleCallbackManager.schedule(() => {
1225
+ if (signal?.aborted) {
1226
+ return;
1227
+ }
1197
1228
  block.sections.push(new RegisteredPropertiesSection(
1198
1229
  this, matchedStyles, propertyRule.style(), sectionIdx, propertyRule.propertyName(), expandedByDefault));
1199
1230
  sectionIdx++;
@@ -1207,6 +1238,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1207
1238
  const block = SectionBlock.createFunctionBlock(expandedByDefault);
1208
1239
  for (const functionRule of matchedStyles.functionRules()) {
1209
1240
  this.idleCallbackManager.schedule(() => {
1241
+ if (signal?.aborted) {
1242
+ return;
1243
+ }
1210
1244
  block.sections.push(new FunctionRuleSection(
1211
1245
  this, matchedStyles, functionRule.style, functionRule.children(), sectionIdx,
1212
1246
  functionRule.nameWithParameters(), expandedByDefault));
@@ -86,6 +86,11 @@
86
86
  font-style: italic;
87
87
  pointer-events: none;
88
88
  }
89
+
90
+ &.ghost-row {
91
+ /* As there is no checkbox to the left of the ghost rows, explicitly set padding-left */
92
+ padding-left: 56px;
93
+ }
89
94
  }
90
95
 
91
96
  .tree-outline > li {
@@ -85,8 +85,8 @@ export class AffectedSelectivePermissionsInterventionView extends AffectedResour
85
85
  <td class="affected-resource-cell">
86
86
  <div class="ad-ancestry-list">
87
87
  ${(details.adAncestry?.ancestryChain || []).map(script => {
88
- const link = this.#linkifier.linkifyScriptLocation(
89
- target, script.scriptId, script.name as Platform.DevToolsPath.UrlString, 0);
88
+ const link =
89
+ this.#linkifier.linkifyScriptLocation(target, script.scriptId, '' as Platform.DevToolsPath.UrlString, 0);
90
90
  return html`<div>${link}</div>`;
91
91
  })}
92
92
  ${
@@ -661,6 +661,9 @@ export class LighthouseController extends Common.ObjectWrapper.ObjectWrapper<Eve
661
661
  const inspectedURL = await this.getInspectedURL({force: true});
662
662
  const categoryIDs = overrides?.categoryIds ?? this.getCategoryIDs();
663
663
  const flags = this.getFlags();
664
+ if (overrides?.mode) {
665
+ flags.mode = overrides.mode;
666
+ }
664
667
 
665
668
  this.recordMetrics(flags, categoryIDs);
666
669
 
@@ -783,7 +786,7 @@ export function getRuntimeSettings(): LighthouseModel.RunTypes.RuntimeSetting[]
783
786
  title: i18nLazyString(UIStrings.lighthouseMode),
784
787
  description: i18nLazyString(UIStrings.runLighthouseInMode),
785
788
  setFlags: (flags: LighthouseModel.RunTypes.Flags, value: string|boolean) => {
786
- flags.mode = value;
789
+ flags.mode = value as LighthouseModel.RunTypes.RunMode;
787
790
  },
788
791
  options: [
789
792
  {
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
  /* eslint-disable @devtools/no-imperative-dom-api */
5
5
 
6
+ import type * as Common from '../../core/common/common.js';
6
7
  import * as i18n from '../../core/i18n/i18n.js';
7
8
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
8
9
  import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
@@ -156,10 +157,10 @@ export class PlayerEventsView extends UI.Widget.VBox {
156
157
  private static convertToGridDescriptor(columnConfig: EventDisplayColumnConfig): DataGrid.DataGrid.ColumnDescriptor {
157
158
  return {
158
159
  id: columnConfig.id,
159
- title: columnConfig.title,
160
+ title: columnConfig.title as Common.UIString.LocalizedString,
160
161
  sortable: columnConfig.sortable,
161
162
  weight: columnConfig.weight || 0,
162
163
  sort: DataGrid.DataGrid.Order.Ascending,
163
- } as DataGrid.DataGrid.ColumnDescriptor;
164
+ };
164
165
  }
165
166
  }
@@ -6,9 +6,11 @@ import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
7
  import * as Platform from '../../core/platform/platform.js';
8
8
  import * as SDK from '../../core/sdk/sdk.js';
9
+ import * as CrUXManager from '../../models/crux-manager/crux-manager.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
10
11
  import * as Lit from '../../ui/lit/lit.js';
11
12
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
13
+ import * as PanelsCommon from '../common/common.js';
12
14
 
13
15
  import {ThrottlingManager} from './ThrottlingManager.js';
14
16
  import type {NetworkThrottlingConditionsGroup} from './ThrottlingPresets.js';
@@ -185,6 +187,18 @@ export class NetworkThrottlingSelect extends Common.ObjectWrapper.ObjectWrapper<
185
187
  SDK.NetworkManager.MultitargetNetworkManager.Events.CONDITIONS_CHANGED, () => {
186
188
  select.currentConditions = SDK.NetworkManager.MultitargetNetworkManager.instance().networkConditions();
187
189
  });
190
+
191
+ // Subscribe to CrUX field data changes to show recommended throttling
192
+ // presets based on real-user RTT data.
193
+ const cruxManager = CrUXManager.CrUXManager.instance();
194
+ const updateRecommendation = (): void => {
195
+ const roundTripTimeMetricData = cruxManager.getSelectedFieldMetricData('round_trip_time');
196
+ select.recommendedConditions =
197
+ PanelsCommon.ThrottlingUtils.getRecommendedNetworkConditions(roundTripTimeMetricData);
198
+ };
199
+ cruxManager.addEventListener(CrUXManager.Events.FIELD_DATA_CHANGED, updateRecommendation);
200
+ updateRecommendation();
201
+
188
202
  return select;
189
203
  }
190
204
 
@@ -86,12 +86,12 @@ export class EventSourceMessagesView extends UI.Widget.VBox {
86
86
  }
87
87
  this.mainToolbar.appendToolbarItem(this.filterTextInput);
88
88
 
89
- const columns = ([
89
+ const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
90
90
  {id: 'id', title: i18nString(UIStrings.id), sortable: true, weight: 8},
91
91
  {id: 'type', title: i18nString(UIStrings.type), sortable: true, weight: 8},
92
92
  {id: 'data', title: i18nString(UIStrings.data), sortable: false, weight: 88},
93
93
  {id: 'time', title: i18nString(UIStrings.time), sortable: true, weight: 8},
94
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
94
+ ];
95
95
 
96
96
  this.dataGrid = new DataGrid.SortableDataGrid.SortableDataGrid({
97
97
  displayName: i18nString(UIStrings.eventSource),
@@ -199,7 +199,7 @@ export abstract class ResourceChunkView<Chunk> extends UI.Widget.VBox {
199
199
  weight: 5,
200
200
  },
201
201
  {id: 'time', title: i18nString(UIStrings.time), sortable: true, weight: 7},
202
- ] as DataGrid.DataGrid.ColumnDescriptor[];
202
+ ];
203
203
  }
204
204
 
205
205
  chunkAdded(chunk: Chunk): void {
@@ -168,11 +168,16 @@ export class DetachedElementsProfileHeader extends WritableProfileHeader {
168
168
  readonly #heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null;
169
169
  readonly detachedElements: Protocol.DOM.DetachedElementInfo[]|null;
170
170
  constructor(
171
- heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, type: DetachedElementsProfileType,
172
- detachedElements: Protocol.DOM.DetachedElementInfo[]|null, title?: string) {
171
+ heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null,
172
+ type: DetachedElementsProfileType,
173
+ detachedElements: Protocol.DOM.DetachedElementInfo[]|null,
174
+ title?: string,
175
+ ) {
173
176
  super(
174
- heapProfilerModel?.debuggerModel() ?? null, type,
175
- title || i18nString(UIStrings.detachedElementProfile, {PH1: type.nextProfileUid()}));
177
+ heapProfilerModel?.debuggerModel() ?? null,
178
+ type,
179
+ title || i18nString(UIStrings.detachedElementProfile, {PH1: type.nextProfileUid()}),
180
+ );
176
181
  this.detachedElements = detachedElements;
177
182
  this.#heapProfilerModel = heapProfilerModel;
178
183
  }
@@ -457,11 +457,15 @@ export class SamplingHeapProfileHeader extends WritableProfileHeader {
457
457
  nodes: never[],
458
458
  };
459
459
  constructor(
460
- heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, type: SamplingHeapProfileTypeBase,
461
- title?: string) {
460
+ heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null,
461
+ type: SamplingHeapProfileTypeBase,
462
+ title?: string,
463
+ ) {
462
464
  super(
463
- heapProfilerModel?.debuggerModel() ?? null, type,
464
- title || i18nString(UIStrings.profileD, {PH1: type.nextProfileUid()}));
465
+ heapProfilerModel?.debuggerModel() ?? null,
466
+ type,
467
+ title || i18nString(UIStrings.profileD, {PH1: type.nextProfileUid()}),
468
+ );
465
469
  this.heapProfilerModelInternal = heapProfilerModel;
466
470
  this.protocolProfileInternal = {
467
471
  head: {
@@ -622,28 +622,27 @@ export class HeapSnapshotContainmentDataGrid extends HeapSnapshotSortableDataGri
622
622
  constructor(
623
623
  heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, dataDisplayDelegate: DataDisplayDelegate,
624
624
  displayName: string, columns?: DataGrid.DataGrid.ColumnDescriptor[]) {
625
- columns =
626
- columns || ([
627
- {id: 'object', title: i18nString(UIStrings.object), disclosure: true, sortable: true},
628
- {id: 'distance', title: i18nString(UIStrings.distance), width: '70px', sortable: true, fixedWidth: true},
629
- {
630
- id: 'shallowSize',
631
- title: i18nString(UIStrings.shallowSize),
632
- width: '110px',
633
- sortable: true,
634
- fixedWidth: true,
635
- },
636
- {
637
- id: 'retainedSize',
638
- title: i18nString(UIStrings.retainedSize),
639
- width: '110px',
640
- sortable: true,
641
- fixedWidth: true,
642
- sort: DataGrid.DataGrid.Order.Descending,
643
- },
644
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
645
- const dataGridParameters = ({displayName, columns} as DataGrid.DataGrid.Parameters);
646
- super(heapProfilerModel, dataDisplayDelegate, dataGridParameters);
625
+ const defaultColumns: DataGrid.DataGrid.ColumnDescriptor[] = [
626
+ {id: 'object', title: i18nString(UIStrings.object), disclosure: true, sortable: true},
627
+ {id: 'distance', title: i18nString(UIStrings.distance), width: '70px', sortable: true, fixedWidth: true},
628
+ {
629
+ id: 'shallowSize',
630
+ title: i18nString(UIStrings.shallowSize),
631
+ width: '110px',
632
+ sortable: true,
633
+ fixedWidth: true,
634
+ },
635
+ {
636
+ id: 'retainedSize',
637
+ title: i18nString(UIStrings.retainedSize),
638
+ width: '110px',
639
+ sortable: true,
640
+ fixedWidth: true,
641
+ sort: DataGrid.DataGrid.Order.Descending,
642
+ },
643
+ ];
644
+ columns = columns || defaultColumns;
645
+ super(heapProfilerModel, dataDisplayDelegate, {displayName, columns});
647
646
  }
648
647
 
649
648
  override async setDataSource(snapshot: HeapSnapshotProxy, nodeIndex: number, nodeId?: number): Promise<void> {
@@ -671,7 +670,7 @@ export class HeapSnapshotRetainmentDataGrid extends HeapSnapshotContainmentDataG
671
670
  resetRetainersButton: UI.Toolbar.ToolbarButton|undefined;
672
671
  constructor(
673
672
  heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, dataDisplayDelegate: DataDisplayDelegate) {
674
- const columns = ([
673
+ const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
675
674
  {id: 'object', title: i18nString(UIStrings.object), disclosure: true, sortable: true},
676
675
  {
677
676
  id: 'distance',
@@ -683,7 +682,7 @@ export class HeapSnapshotRetainmentDataGrid extends HeapSnapshotContainmentDataG
683
682
  },
684
683
  {id: 'shallowSize', title: i18nString(UIStrings.shallowSize), width: '110px', sortable: true, fixedWidth: true},
685
684
  {id: 'retainedSize', title: i18nString(UIStrings.retainedSize), width: '110px', sortable: true, fixedWidth: true},
686
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
685
+ ];
687
686
  super(heapProfilerModel, dataDisplayDelegate, i18nString(UIStrings.heapSnapshotRetainment), columns);
688
687
  }
689
688
 
@@ -751,11 +750,19 @@ export class HeapSnapshotConstructorsDataGrid extends HeapSnapshotViewportDataGr
751
750
  filterInProgress?: HeapSnapshotModel.HeapSnapshotModel.NodeFilter|null;
752
751
 
753
752
  constructor(
754
- heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, dataDisplayDelegate: DataDisplayDelegate) {
755
- const columns = ([
753
+ heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null,
754
+ dataDisplayDelegate: DataDisplayDelegate,
755
+ ) {
756
+ const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
756
757
  {id: 'object', title: i18nString(UIStrings.constructorString), disclosure: true, sortable: true},
757
758
  {id: 'distance', title: i18nString(UIStrings.distance), width: '70px', sortable: true, fixedWidth: true},
758
- {id: 'shallowSize', title: i18nString(UIStrings.shallowSize), width: '110px', sortable: true, fixedWidth: true},
759
+ {
760
+ id: 'shallowSize',
761
+ title: i18nString(UIStrings.shallowSize),
762
+ width: '110px',
763
+ sortable: true,
764
+ fixedWidth: true,
765
+ },
759
766
  {
760
767
  id: 'retainedSize',
761
768
  title: i18nString(UIStrings.retainedSize),
@@ -764,7 +771,7 @@ export class HeapSnapshotConstructorsDataGrid extends HeapSnapshotViewportDataGr
764
771
  sortable: true,
765
772
  fixedWidth: true,
766
773
  },
767
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
774
+ ];
768
775
  super(
769
776
  heapProfilerModel, dataDisplayDelegate,
770
777
  ({displayName: i18nString(UIStrings.heapSnapshotConstructors).toString(), columns} as
@@ -845,7 +852,7 @@ export class HeapSnapshotConstructorsDataGrid extends HeapSnapshotViewportDataGr
845
852
 
846
853
  aggregatesReceived(
847
854
  nodeFilter: HeapSnapshotModel.HeapSnapshotModel.NodeFilter,
848
- aggregates: Record<string, HeapSnapshotModel.HeapSnapshotModel.Aggregate>,
855
+ aggregates: Record<string, HeapSnapshotModel.HeapSnapshotModel.AggregatedInfo>,
849
856
  ): void {
850
857
  this.filterInProgress = null;
851
858
  if (this.nextRequestedFilter && this.snapshot) {
@@ -904,7 +911,7 @@ export class HeapSnapshotDiffDataGrid extends HeapSnapshotViewportDataGrid {
904
911
 
905
912
  constructor(
906
913
  heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, dataDisplayDelegate: DataDisplayDelegate) {
907
- const columns = ([
914
+ const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
908
915
  {id: 'object', title: i18nString(UIStrings.constructorString), disclosure: true, sortable: true},
909
916
  {id: 'addedCount', title: i18nString(UIStrings.New), width: '75px', sortable: true, fixedWidth: true},
910
917
  {id: 'removedCount', title: i18nString(UIStrings.Deleted), width: '75px', sortable: true, fixedWidth: true},
@@ -919,7 +926,7 @@ export class HeapSnapshotDiffDataGrid extends HeapSnapshotViewportDataGrid {
919
926
  },
920
927
  {id: 'removedSize', title: i18nString(UIStrings.freedSize), width: '75px', sortable: true, fixedWidth: true},
921
928
  {id: 'sizeDelta', title: i18nString(UIStrings.sizeDelta), width: '75px', sortable: true, fixedWidth: true},
922
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
929
+ ];
923
930
  super(
924
931
  heapProfilerModel, dataDisplayDelegate,
925
932
  ({displayName: i18nString(UIStrings.heapSnapshotDiff).toString(), columns} as DataGrid.DataGrid.Parameters));
@@ -991,7 +998,7 @@ export class AllocationDataGrid extends HeapSnapshotViewportDataGrid {
991
998
 
992
999
  constructor(
993
1000
  heapProfilerModel: SDK.HeapProfilerModel.HeapProfilerModel|null, dataDisplayDelegate: DataDisplayDelegate) {
994
- const columns = ([
1001
+ const columns: DataGrid.DataGrid.ColumnDescriptor[] = [
995
1002
  {id: 'liveCount', title: i18nString(UIStrings.liveCount), width: '75px', sortable: true, fixedWidth: true},
996
1003
  {id: 'count', title: i18nString(UIStrings.count), width: '65px', sortable: true, fixedWidth: true},
997
1004
  {id: 'liveSize', title: i18nString(UIStrings.liveSize), width: '75px', sortable: true, fixedWidth: true},
@@ -1004,7 +1011,7 @@ export class AllocationDataGrid extends HeapSnapshotViewportDataGrid {
1004
1011
  sort: DataGrid.DataGrid.Order.Descending,
1005
1012
  },
1006
1013
  {id: 'name', title: i18nString(UIStrings.function), disclosure: true, sortable: true},
1007
- ] as DataGrid.DataGrid.ColumnDescriptor[]);
1014
+ ];
1008
1015
  super(
1009
1016
  heapProfilerModel, dataDisplayDelegate,
1010
1017
  ({displayName: i18nString(UIStrings.allocation).toString(), columns} as DataGrid.DataGrid.Parameters));
@@ -1120,7 +1120,7 @@ export class HeapSnapshotConstructorNode extends HeapSnapshotGridNode {
1120
1120
 
1121
1121
  constructor(
1122
1122
  dataGrid: HeapSnapshotConstructorsDataGrid, classKey: string,
1123
- aggregate: HeapSnapshotModel.HeapSnapshotModel.Aggregate,
1123
+ aggregate: HeapSnapshotModel.HeapSnapshotModel.AggregatedInfo,
1124
1124
  nodeFilter: HeapSnapshotModel.HeapSnapshotModel.NodeFilter) {
1125
1125
  super(dataGrid, aggregate.count > 0);
1126
1126
  this.nameInternal = aggregate.name;
@@ -290,7 +290,7 @@ export class HeapSnapshotProxy extends HeapSnapshotProxyObject {
290
290
  }
291
291
 
292
292
  aggregatesWithFilter(filter: HeapSnapshotModel.HeapSnapshotModel.NodeFilter):
293
- Promise<Record<string, HeapSnapshotModel.HeapSnapshotModel.Aggregate>> {
293
+ Promise<Record<string, HeapSnapshotModel.HeapSnapshotModel.AggregatedInfo>> {
294
294
  return this.callMethodPromise('aggregatesWithFilter', filter);
295
295
  }
296
296