chrome-devtools-frontend 1.0.1601661 → 1.0.1602543

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 (119) hide show
  1. package/.agents/skills/version-control/SKILL.md +71 -0
  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/host/InspectorFrontendHostStub.ts +0 -5
  7. package/front_end/core/platform/HostRuntime.ts +9 -3
  8. package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
  9. package/front_end/core/root/Runtime.ts +5 -8
  10. package/front_end/core/sdk/DOMModel.ts +5 -4
  11. package/front_end/core/sdk/Target.ts +5 -0
  12. package/front_end/core/sdk/WebMCPModel.ts +98 -0
  13. package/front_end/core/sdk/sdk.ts +2 -0
  14. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +13 -19
  15. package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
  16. package/front_end/entrypoints/main/GlobalAiButton.ts +1 -1
  17. package/front_end/generated/InspectorBackendCommands.ts +6 -5
  18. package/front_end/generated/protocol.ts +36 -3
  19. package/front_end/models/ai_assistance/AiConversation.ts +3 -3
  20. package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +217 -9
  21. package/front_end/models/ai_assistance/agents/AiAgent.ts +14 -1
  22. package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +19 -4
  23. package/front_end/models/ai_assistance/agents/NetworkAgent.ts +7 -1
  24. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +14 -2
  25. package/front_end/models/ai_assistance/agents/StylingAgent.ts +0 -23
  26. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +7 -7
  27. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  28. package/front_end/models/lighthouse/RunTypes.ts +3 -1
  29. package/front_end/models/live-metrics/LiveMetrics.ts +51 -31
  30. package/front_end/panels/accessibility/ARIAAttributesView.ts +2 -2
  31. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +9 -2
  32. package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
  33. package/front_end/panels/ai_assistance/components/ChatMessage.ts +84 -27
  34. package/front_end/panels/ai_assistance/components/chatMessage.css +31 -2
  35. package/front_end/panels/application/AppManifestView.ts +2 -2
  36. package/front_end/panels/application/BackgroundServiceView.ts +9 -9
  37. package/front_end/panels/application/FrameDetailsView.ts +4 -13
  38. package/front_end/panels/application/IndexedDBViews.ts +1 -1
  39. package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -4
  40. package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -3
  41. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
  42. package/front_end/panels/application/components/permissionsPolicySection.css +54 -52
  43. package/front_end/panels/application/frameDetailsReportView.css +13 -1
  44. package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -1
  45. package/front_end/panels/console_counters/WarningErrorCounter.ts +7 -14
  46. package/front_end/panels/elements/CSSValueTraceView.ts +9 -1
  47. package/front_end/panels/elements/NodeStackTraceWidget.ts +2 -1
  48. package/front_end/panels/elements/PropertiesWidget.ts +14 -13
  49. package/front_end/panels/elements/PropertyRenderer.ts +10 -9
  50. package/front_end/panels/elements/StandaloneStylesContainer.ts +15 -2
  51. package/front_end/panels/elements/StylePropertyTreeElement.ts +22 -1
  52. package/front_end/panels/elements/StylesSidebarPane.ts +34 -25
  53. package/front_end/panels/elements/stylePropertiesTreeOutline.css +5 -0
  54. package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +2 -2
  55. package/front_end/panels/lighthouse/LighthouseController.ts +4 -1
  56. package/front_end/panels/media/EventDisplayTable.ts +3 -2
  57. package/front_end/panels/network/EventSourceMessagesView.ts +2 -2
  58. package/front_end/panels/network/RequestPayloadView.ts +2 -2
  59. package/front_end/panels/network/ResourceChunkView.ts +1 -1
  60. package/front_end/panels/profiler/HeapDetachedElementsView.ts +9 -4
  61. package/front_end/panels/profiler/HeapProfileView.ts +8 -4
  62. package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +40 -33
  63. package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +1 -1
  64. package/front_end/panels/profiler/HeapSnapshotProxy.ts +1 -1
  65. package/front_end/panels/profiler/HeapSnapshotView.ts +12 -18
  66. package/front_end/panels/profiler/LiveHeapProfileView.ts +3 -4
  67. package/front_end/panels/profiler/ProfileHeader.ts +5 -11
  68. package/front_end/panels/profiler/ProfileView.ts +1 -1
  69. package/front_end/panels/recorder/RecorderController.ts +4 -3
  70. package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -1
  71. package/front_end/panels/recorder/components/RecordingView.ts +2 -2
  72. package/front_end/panels/recorder/models/RecordingPlayer.ts +3 -0
  73. package/front_end/panels/security/SecurityPanel.ts +3 -3
  74. package/front_end/panels/sensors/SensorsView.ts +149 -125
  75. package/front_end/panels/timeline/EventsTimelineTreeView.ts +2 -2
  76. package/front_end/panels/timeline/TimelineDetailsView.ts +6 -37
  77. package/front_end/panels/timeline/TimelineTreeView.ts +19 -17
  78. package/front_end/panels/timeline/TimelineUIUtils.ts +0 -118
  79. package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
  80. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +2 -2
  81. package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +162 -9
  82. package/front_end/panels/timeline/components/timelineRangeSummaryView.css +22 -8
  83. package/front_end/panels/webauthn/WebauthnPane.ts +52 -0
  84. package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -10
  85. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  86. package/front_end/third_party/chromium/README.chromium +1 -1
  87. package/front_end/third_party/puppeteer/README.chromium +2 -2
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +4 -0
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  92. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  93. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
  94. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +3 -3
  97. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +4 -0
  99. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  101. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  102. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  105. package/front_end/third_party/puppeteer/package/package.json +1 -1
  106. package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +8 -0
  107. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  108. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  109. package/front_end/ui/legacy/Toolbar.ts +25 -3
  110. package/front_end/ui/legacy/Treeoutline.ts +7 -3
  111. package/front_end/ui/legacy/UIUtils.ts +13 -11
  112. package/front_end/ui/legacy/Widget.ts +40 -40
  113. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  114. package/front_end/ui/legacy/components/data_grid/SortableDataGrid.ts +2 -2
  115. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +39 -23
  116. package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +20 -4
  117. package/front_end/ui/legacy/treeoutline.css +4 -0
  118. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  119. package/package.json +1 -1
@@ -128,6 +128,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
128
128
  expandPercentagesInShorthands: boolean,
129
129
  shorthandPositionOffset: number,
130
130
  focus: boolean,
131
+ signal?: AbortSignal,
131
132
  ): Promise<void> {
132
133
  const matchedResult = subexpression === null ?
133
134
  property.parseValue(matchedStyles, computedStyles) :
@@ -136,7 +137,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
136
137
  return undefined;
137
138
  }
138
139
  return await this.#showTrace(
139
- property, matchedResult, renderers, expandPercentagesInShorthands, shorthandPositionOffset, focus);
140
+ property, matchedResult, renderers, expandPercentagesInShorthands, shorthandPositionOffset, focus, signal);
140
141
  }
141
142
 
142
143
  async #showTrace(
@@ -146,6 +147,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
146
147
  expandPercentagesInShorthands: boolean,
147
148
  shorthandPositionOffset: number,
148
149
  focus: boolean,
150
+ signal?: AbortSignal,
149
151
  ): Promise<void> {
150
152
  this.#highlighting = new Highlighting();
151
153
  const rendererMap = new Map(renderers.map(r => [r.matchType, r]));
@@ -165,6 +167,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
165
167
  /* cssControls */ undefined,
166
168
  /* options */ {},
167
169
  tracing,
170
+ signal,
168
171
  );
169
172
  substitutions.push(Renderer.render(matchedResult.ast.tree, context).nodes);
170
173
  }
@@ -180,6 +183,7 @@ export class CSSValueTraceView extends UI.Widget.VBox {
180
183
  /* cssControls */ undefined,
181
184
  /* options */ {},
182
185
  tracing,
186
+ signal,
183
187
  );
184
188
  evaluations.push(Renderer.render(matchedResult.ast.tree, context).nodes);
185
189
  asyncCallbackResults.push(tracing.runAsyncEvaluations());
@@ -199,6 +203,10 @@ export class CSSValueTraceView extends UI.Widget.VBox {
199
203
  property,
200
204
  rendererMap,
201
205
  matchedResult,
206
+ undefined,
207
+ {},
208
+ undefined,
209
+ signal,
202
210
  );
203
211
  this.#evaluations.push(Renderer.render(matchedResult.ast.tree, context).nodes);
204
212
  }
@@ -20,6 +20,7 @@ const UIStrings = {
20
20
  } as const;
21
21
  const str_ = i18n.i18n.registerUIStrings('panels/elements/NodeStackTraceWidget.ts', UIStrings);
22
22
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
23
+ const {widget} = UI.Widget;
23
24
 
24
25
  interface ViewInput {
25
26
  stackTrace?: StackTrace.StackTrace.StackTrace;
@@ -35,7 +36,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
35
36
  ${target && stackTrace ?
36
37
  html`<devtools-widget
37
38
  class="stack-trace"
38
- .widgetConfig=${UI.Widget.widgetConfig(Components.JSPresentationUtils.StackTracePreviewContent, {stackTrace})}>
39
+ ${widget(Components.JSPresentationUtils.StackTracePreviewContent, {stackTrace})}>
39
40
  </devtools-widget>` :
40
41
  html`<div class="gray-info-message">${i18nString(UIStrings.noStackTraceAvailable)}</div>`}`,
41
42
  target);
@@ -40,7 +40,7 @@ import * as Platform from '../../core/platform/platform.js';
40
40
  import * as SDK from '../../core/sdk/sdk.js';
41
41
  import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
42
42
  import * as UI from '../../ui/legacy/legacy.js';
43
- import {html, nothing, render} from '../../ui/lit/lit.js';
43
+ import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
44
44
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
45
45
 
46
46
  import propertiesWidgetStyles from './propertiesWidget.css.js';
@@ -48,6 +48,7 @@ import propertiesWidgetStyles from './propertiesWidget.css.js';
48
48
  const OBJECT_GROUP_NAME = 'properties-sidebar-pane';
49
49
 
50
50
  const {bindToSetting} = UI.UIUtils;
51
+ const {repeat} = Directives;
51
52
 
52
53
  const UIStrings = {
53
54
  /**
@@ -75,7 +76,6 @@ interface PropertiesWidgetInput {
75
76
  onFilterChanged: (e: CustomEvent<string>) => void;
76
77
  onRegexToggled: () => void;
77
78
  isRegex: boolean;
78
- treeOutline: ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline;
79
79
  objectTree: ObjectUI.ObjectPropertiesSection.ObjectTree|null;
80
80
  allChildrenFiltered: boolean;
81
81
  }
@@ -103,7 +103,17 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
103
103
  ${input.objectTree && input.allChildrenFiltered ? html`
104
104
  <div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>
105
105
  ` : nothing}
106
- ${input.treeOutline.element}
106
+ <devtools-tree .template=${html`
107
+ <ul role=tree class="source-code object-properties-section">
108
+ <style>${ObjectUI.ObjectPropertiesSection.objectValueStyles}</style>;
109
+ <style>${ObjectUI.ObjectPropertiesSection.objectPropertiesSectionStyles}</style>;
110
+ ${repeat(ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.createPropertyNodes(
111
+ input.objectTree?.children ?? {},
112
+ true /* skipProto */,
113
+ true /* skipGettersAndSetters */),
114
+ node => html`<devtools-tree-wrapper .treeElement=${node}></devtools-tree-wrapper>`)}
115
+ </ul>
116
+ `}></devtools-tree>
107
117
  </div>`, target);
108
118
  // clang-format on
109
119
  };
@@ -218,15 +228,7 @@ export class PropertiesWidget extends UI.Widget.VBox {
218
228
 
219
229
  override async performUpdate(): Promise<void> {
220
230
  await this.#updateNodeIfRequired();
221
- if (!this.#objectTree) {
222
- this.treeOutline.removeChildren();
223
- } else {
224
- const treeElement = this.treeOutline.rootElement();
225
- treeElement.removeChildren();
226
- ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.populateWithProperties(
227
- treeElement, await this.#objectTree.populateChildrenIfNeeded(), true /* skipProto */,
228
- true /* skipGettersAndSetters */);
229
- }
231
+ await this.#objectTree?.populateChildrenIfNeeded();
230
232
  const allChildrenFiltered =
231
233
  !(this.#objectTree?.children?.accessors?.some(c => !c.isFiltered) ||
232
234
  this.#objectTree?.children?.arrayRanges?.some(() => true) ||
@@ -237,7 +239,6 @@ export class PropertiesWidget extends UI.Widget.VBox {
237
239
  onFilterChanged: this.onFilterChanged.bind(this),
238
240
  onRegexToggled: this.onRegexToggled.bind(this),
239
241
  isRegex: this.#isRegex,
240
- treeOutline: this.treeOutline,
241
242
  allChildrenFiltered,
242
243
  objectTree: this.#objectTree,
243
244
  },
@@ -354,7 +354,7 @@ export class RenderingContext {
354
354
  MatchRenderer<SDK.CSSPropertyParser.Match>>,
355
355
  readonly matchedResult: SDK.CSSPropertyParser.BottomUpTreeMatching,
356
356
  readonly cssControls?: SDK.CSSPropertyParser.CSSControlMap, readonly options: {readonly?: boolean} = {},
357
- readonly tracing?: TracingContext) {
357
+ readonly tracing?: TracingContext, readonly signal?: AbortSignal) {
358
358
  }
359
359
 
360
360
  addControl(cssType: string, control: HTMLElement): void {
@@ -414,11 +414,12 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
414
414
  readonly?: boolean,
415
415
  },
416
416
  tracing: TracingContext|undefined,
417
+ signal: AbortSignal|undefined,
417
418
  ) {
418
419
  super(ast);
419
420
  this.#matchedResult = matchedResult;
420
421
  this.#context =
421
- new RenderingContext(this.ast, property, renderers, this.#matchedResult, cssControls, options, tracing);
422
+ new RenderingContext(this.ast, property, renderers, this.#matchedResult, cssControls, options, tracing, signal);
422
423
  }
423
424
 
424
425
  static render(nodeOrNodes: CodeMirror.SyntaxNode|CodeMirror.SyntaxNode[], context: RenderingContext):
@@ -430,7 +431,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
430
431
  const renderers = nodeOrNodes.map(
431
432
  node => this.walkExcludingSuccessors(
432
433
  context.ast.subtree(node), context.property, context.renderers, context.matchedResult, cssControls,
433
- context.options, context.tracing));
434
+ context.options, context.tracing, context.signal));
434
435
  const nodes = renderers.map(node => node.#output).reduce(mergeWithSpacing, []);
435
436
  return {nodes, cssControls};
436
437
  }
@@ -491,8 +492,8 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
491
492
  static renderValueElement(
492
493
  property: SDK.CSSProperty.CSSProperty|{name: string, value: string},
493
494
  matchedResult: SDK.CSSPropertyParser.BottomUpTreeMatching|null,
494
- renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>,
495
- tracing?: TracingContext): {valueElement: HTMLElement, cssControls: SDK.CSSPropertyParser.CSSControlMap} {
495
+ renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>, tracing?: TracingContext,
496
+ signal?: AbortSignal): {valueElement: HTMLElement, cssControls: SDK.CSSPropertyParser.CSSControlMap} {
496
497
  const valueElement = document.createElement('span');
497
498
  valueElement.setAttribute(
498
499
  'jslog', `${VisualLogging.value().track({
@@ -502,7 +503,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
502
503
  UI.ARIAUtils.setLabel(valueElement, i18nString(UIStrings.cssPropertyValue, {PH1: property.value}));
503
504
  valueElement.className = 'value';
504
505
  valueElement.tabIndex = -1;
505
- const {nodes, cssControls} = this.renderValueNodes(property, matchedResult, renderers, tracing);
506
+ const {nodes, cssControls} = this.renderValueNodes(property, matchedResult, renderers, tracing, signal);
506
507
  nodes.forEach(node => valueElement.appendChild(node));
507
508
  valueElement.normalize();
508
509
  return {valueElement, cssControls};
@@ -511,8 +512,8 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
511
512
  static renderValueNodes(
512
513
  property: SDK.CSSProperty.CSSProperty|{name: string, value: string},
513
514
  matchedResult: SDK.CSSPropertyParser.BottomUpTreeMatching|null,
514
- renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>,
515
- tracing?: TracingContext): {nodes: Node[], cssControls: SDK.CSSPropertyParser.CSSControlMap} {
515
+ renderers: Array<MatchRenderer<SDK.CSSPropertyParser.Match>>, tracing?: TracingContext,
516
+ signal?: AbortSignal): {nodes: Node[], cssControls: SDK.CSSPropertyParser.CSSControlMap} {
516
517
  if (!matchedResult) {
517
518
  return {nodes: [document.createTextNode(property.value)], cssControls: new Map()};
518
519
  }
@@ -524,7 +525,7 @@ export class Renderer extends SDK.CSSPropertyParser.TreeWalker {
524
525
 
525
526
  const context = new RenderingContext(
526
527
  matchedResult.ast, property instanceof SDK.CSSProperty.CSSProperty ? property : null, rendererMap,
527
- matchedResult, undefined, {}, tracing);
528
+ matchedResult, undefined, {}, tracing, signal);
528
529
  return Renderer.render([matchedResult.ast.tree, ...matchedResult.ast.trailingNodes], context);
529
530
  }
530
531
  }
@@ -114,7 +114,7 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
114
114
  return this.#webCustomData;
115
115
  }
116
116
 
117
- async #updateSections(): Promise<void> {
117
+ async #updateSections(signal?: AbortSignal): Promise<void> {
118
118
  for (const section of this.#sections) {
119
119
  section.dispose();
120
120
  }
@@ -126,6 +126,10 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
126
126
 
127
127
  const cssModel = node.domModel().cssModel();
128
128
  const matchedStyles = await cssModel.cachedMatchedCascadeForNode(node);
129
+ if (signal?.aborted) {
130
+ return;
131
+ }
132
+
129
133
  const parentNodeId = matchedStyles?.getParentLayoutNodeId();
130
134
 
131
135
  const [parentStyles, computedStyles, extraStyles] = await Promise.all([
@@ -133,6 +137,10 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
133
137
  cssModel.getComputedStyleExtraFields(node.id)
134
138
  ]);
135
139
 
140
+ if (signal?.aborted) {
141
+ return;
142
+ }
143
+
136
144
  if (!matchedStyles) {
137
145
  return;
138
146
  }
@@ -142,6 +150,7 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
142
150
  for (const style of matchedStyles.nodeStyles()) {
143
151
  const section = new StylePropertiesSection(
144
152
  this, matchedStyles, style, sectionIdx++, computedStyles, parentStyles, extraStyles);
153
+ section.update(true);
145
154
  newSections.push(section);
146
155
  this.sectionByElement.set(section.element, section);
147
156
  }
@@ -150,7 +159,10 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
150
159
  this.swatchPopoverHelper().reposition();
151
160
  }
152
161
 
153
- override async performUpdate(): Promise<void> {
162
+ override async performUpdate(signal?: AbortSignal): Promise<void> {
163
+ await this.#updateSections(signal);
164
+ signal?.throwIfAborted();
165
+
154
166
  const viewInput: ViewInput = {
155
167
  sections: this.#sections.filter(section => !section.isHidden()),
156
168
  };
@@ -178,6 +190,7 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
178
190
  return;
179
191
  }
180
192
  this.#computedStyleModelInternal.node = node;
193
+ this.forceUpdate();
181
194
  }
182
195
 
183
196
  set filter(regex: RegExp|null) {
@@ -55,6 +55,7 @@ const ASTUtils = SDK.CSSPropertyParser.ASTUtils;
55
55
  const FlexboxEditor = ElementsComponents.StylePropertyEditor.FlexboxEditor;
56
56
  const GridEditor = ElementsComponents.StylePropertyEditor.GridEditor;
57
57
  const GridLanesEditor = ElementsComponents.StylePropertyEditor.GridLanesEditor;
58
+ const {widget} = UI.Widget;
58
59
 
59
60
  const UIStrings = {
60
61
  /**
@@ -830,6 +831,9 @@ export class LightDarkColorRenderer extends rendererBase(SDK.CSSPropertyParserMa
830
831
  lightControls: SDK.CSSPropertyParser.CSSControlMap,
831
832
  darkControls: SDK.CSSPropertyParser.CSSControlMap): Promise<void> {
832
833
  const activeColor = await this.#activeColor(match);
834
+ if (context.signal?.aborted) {
835
+ return;
836
+ }
833
837
  if (!activeColor) {
834
838
  return;
835
839
  }
@@ -966,6 +970,9 @@ export class ColorMixRenderer extends rendererBase(SDK.CSSPropertyParserMatchers
966
970
  context.addControl('color', swatch);
967
971
  const asyncEvalCallback = async(): Promise<boolean> => {
968
972
  const results = await this.#stylesContainer.cssModel()?.resolveValues(undefined, nodeId, colorMixText);
973
+ if (context.signal?.aborted) {
974
+ return false;
975
+ }
969
976
  if (results) {
970
977
  const color = Common.Color.parse(results[0]);
971
978
  if (color) {
@@ -1701,6 +1708,10 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1701
1708
  valueElement: HTMLElement, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<boolean> {
1702
1709
  const pixelValue = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text);
1703
1710
 
1711
+ if (context.signal?.aborted) {
1712
+ return false;
1713
+ }
1714
+
1704
1715
  if (pixelValue?.[0] && pixelValue?.[0] !== match.text) {
1705
1716
  valueElement.textContent = pixelValue[0];
1706
1717
  return true;
@@ -1725,6 +1736,9 @@ export class LengthRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.L
1725
1736
  async getTooltipValue(
1726
1737
  tooltip: Tooltips.Tooltip.Tooltip, match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<void> {
1727
1738
  const pixelValue = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text);
1739
+ if (context.signal?.aborted) {
1740
+ return;
1741
+ }
1728
1742
  if (!pixelValue) {
1729
1743
  return;
1730
1744
  }
@@ -1798,6 +1812,9 @@ export class BaseFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatc
1798
1812
  return null;
1799
1813
  });
1800
1814
  const evaled = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, value);
1815
+ if (context.signal?.aborted) {
1816
+ return false;
1817
+ }
1801
1818
  if (!evaled?.[0] || evaled[0] === value) {
1802
1819
  return false;
1803
1820
  }
@@ -1814,6 +1831,9 @@ export class BaseFunctionRenderer extends rendererBase(SDK.CSSPropertyParserMatc
1814
1831
  const values = match.args.map(arg => context.matchedResult.getComputedTextRange(arg[0], arg[arg.length - 1]));
1815
1832
  values.unshift(context.matchedResult.getComputedText(match.node));
1816
1833
  const evaledArgs = await resolveValues(this.#stylesContainer, this.#propertyName, match, context, ...values);
1834
+ if (context.signal?.aborted) {
1835
+ return;
1836
+ }
1817
1837
  if (!evaledArgs) {
1818
1838
  return;
1819
1839
  }
@@ -2688,7 +2708,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
2688
2708
  e.consume(true);
2689
2709
  }
2690
2710
  }}
2691
- .widgetConfig=${UI.Widget.widgetConfig(CSSValueTraceView)}>
2711
+ ${widget(CSSValueTraceView)}>
2692
2712
  </devtools-widget>
2693
2713
  </devtools-tooltip>`;
2694
2714
  // clang-format on
@@ -3494,6 +3514,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
3494
3514
  if (this.prompt) {
3495
3515
  this.prompt.detach();
3496
3516
  this.prompt = null;
3517
+ this.#clearGhostTextInValue();
3497
3518
  }
3498
3519
  }
3499
3520
 
@@ -211,7 +211,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
211
211
  #webCustomData?: WebCustomData;
212
212
 
213
213
  activeCSSAngle: InlineEditor.CSSAngle.CSSAngle|null = null;
214
- #updateAbortController?: AbortController;
215
214
 
216
215
  constructor(computedStyleModel: ComputedStyle.ComputedStyleModel.ComputedStyleModel) {
217
216
  super(computedStyleModel, {delegatesFocus: true});
@@ -318,7 +317,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
318
317
  forceUpdate(): void {
319
318
  this.needsForceUpdate = true;
320
319
  this.#swatchPopoverHelper.hide();
321
- this.#updateAbortController?.abort();
322
320
  this.resetCache();
323
321
  this.requestUpdate();
324
322
  }
@@ -507,10 +505,8 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
507
505
  this.nodeStylesUpdatedForTest(node, false);
508
506
  }
509
507
 
510
- override async performUpdate(): Promise<void> {
511
- this.#updateAbortController?.abort();
512
- this.#updateAbortController = new AbortController();
513
- await this.#innerDoUpdate(this.#updateAbortController.signal);
508
+ override async performUpdate(signal?: AbortSignal): Promise<void> {
509
+ await this.#innerDoUpdate(signal);
514
510
 
515
511
  // Hide all popovers when scrolling.
516
512
  // Styles and Computed panels both have popover (e.g. imagePreviewPopover),
@@ -526,10 +522,10 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
526
522
  }
527
523
  }
528
524
 
529
- async #innerDoUpdate(signal: AbortSignal): Promise<void> {
525
+ async #innerDoUpdate(signal?: AbortSignal): Promise<void> {
530
526
  if (!this.initialUpdateCompleted) {
531
527
  window.setTimeout(() => {
532
- if (signal.aborted) {
528
+ if (signal?.aborted) {
533
529
  return;
534
530
  }
535
531
  if (!this.initialUpdateCompleted) {
@@ -541,9 +537,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
541
537
 
542
538
  const matchedStyles = await this.fetchMatchedCascade();
543
539
 
544
- if (signal.aborted) {
545
- return;
546
- }
540
+ signal?.throwIfAborted();
547
541
 
548
542
  this.matchedStyles = matchedStyles;
549
543
  const nodeId = this.node()?.id;
@@ -554,16 +548,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
554
548
  this.fetchComputedStyleExtraFieldsFor(nodeId)
555
549
  ]);
556
550
 
557
- if (signal.aborted) {
558
- return;
559
- }
551
+ signal?.throwIfAborted();
560
552
 
561
553
  await this.innerRebuildUpdate(
562
554
  signal, this.matchedStyles, computedStyles, parentsComputedStyles, computedStyleExtraFields);
563
555
 
564
- if (signal.aborted) {
565
- return;
566
- }
556
+ signal?.throwIfAborted();
567
557
 
568
558
  if (!this.initialUpdateCompleted) {
569
559
  this.initialUpdateCompleted = true;
@@ -897,7 +887,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
897
887
  }
898
888
 
899
889
  private async innerRebuildUpdate(
900
- signal: AbortSignal, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null,
890
+ signal: AbortSignal|undefined, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles|null,
901
891
  computedStyles: Map<string, string>|null, parentsComputedStyles: Map<string, string>|null,
902
892
  computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): Promise<void> {
903
893
  // ElementsSidebarPane's throttler schedules this method. Usually,
@@ -928,12 +918,10 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
928
918
  }
929
919
 
930
920
  const blocks = await this.rebuildSectionsForMatchedStyleRules(
931
- (matchedStyles as SDK.CSSMatchedStyles.CSSMatchedStyles), computedStyles, parentsComputedStyles,
921
+ signal, (matchedStyles as SDK.CSSMatchedStyles.CSSMatchedStyles), computedStyles, parentsComputedStyles,
932
922
  computedStyleExtraFields);
933
923
 
934
- if (signal.aborted) {
935
- return;
936
- }
924
+ signal?.throwIfAborted();
937
925
 
938
926
  this.sectionBlocks = blocks;
939
927
 
@@ -1015,12 +1003,12 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1015
1003
  parentsComputedStyles: Map<string, string>|null,
1016
1004
  computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): Promise<SectionBlock[]> {
1017
1005
  return this.rebuildSectionsForMatchedStyleRules(
1018
- matchedStyles, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1006
+ undefined, matchedStyles, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1019
1007
  }
1020
1008
 
1021
1009
  private async rebuildSectionsForMatchedStyleRules(
1022
- matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string>|null,
1023
- parentsComputedStyles: Map<string, string>|null,
1010
+ signal: AbortSignal|undefined, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
1011
+ computedStyles: Map<string, string>|null, parentsComputedStyles: Map<string, string>|null,
1024
1012
  computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null): Promise<SectionBlock[]> {
1025
1013
  if (this.idleCallbackManager) {
1026
1014
  this.idleCallbackManager.discard();
@@ -1074,6 +1062,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1074
1062
  const lastBlock = blocks[blocks.length - 1];
1075
1063
  if (lastBlock && (!isTransitionOrAnimationStyle || style.allProperties().length > 0)) {
1076
1064
  this.idleCallbackManager.schedule(() => {
1065
+ if (signal?.aborted) {
1066
+ return;
1067
+ }
1077
1068
  const section = new StylePropertiesSection(
1078
1069
  this, matchedStyles, style, sectionIdx, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1079
1070
  sectionIdx++;
@@ -1147,6 +1138,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1147
1138
  addLayerSeparator(style);
1148
1139
  const lastBlock = blocks[blocks.length - 1];
1149
1140
  this.idleCallbackManager.schedule(() => {
1141
+ if (signal?.aborted) {
1142
+ return;
1143
+ }
1150
1144
  const section = new HighlightPseudoStylePropertiesSection(
1151
1145
  this, matchedStyles, style, sectionIdx, computedStyles, parentsComputedStyles, computedStyleExtraFields);
1152
1146
  sectionIdx++;
@@ -1159,6 +1153,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1159
1153
  const block = SectionBlock.createKeyframesBlock(keyframesRule.name().text);
1160
1154
  for (const keyframe of keyframesRule.keyframes()) {
1161
1155
  this.idleCallbackManager.schedule(() => {
1156
+ if (signal?.aborted) {
1157
+ return;
1158
+ }
1162
1159
  block.sections.push(new KeyframePropertiesSection(this, matchedStyles, keyframe.style, sectionIdx));
1163
1160
  sectionIdx++;
1164
1161
  });
@@ -1172,6 +1169,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1172
1169
  const block = SectionBlock.createAtRuleBlock(expandedByDefault);
1173
1170
  for (const atRule of atRules) {
1174
1171
  this.idleCallbackManager.schedule(() => {
1172
+ if (signal?.aborted) {
1173
+ return;
1174
+ }
1175
1175
  block.sections.push(new AtRuleSection(this, matchedStyles, atRule.style, sectionIdx, expandedByDefault));
1176
1176
  sectionIdx++;
1177
1177
  });
@@ -1182,6 +1182,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1182
1182
  for (const positionTryRule of matchedStyles.positionTryRules()) {
1183
1183
  const block = SectionBlock.createPositionTryBlock(positionTryRule.name().text);
1184
1184
  this.idleCallbackManager.schedule(() => {
1185
+ if (signal?.aborted) {
1186
+ return;
1187
+ }
1185
1188
  block.sections.push(new PositionTryRuleSection(
1186
1189
  this, matchedStyles, positionTryRule.style, sectionIdx, positionTryRule.active()));
1187
1190
  sectionIdx++;
@@ -1194,6 +1197,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1194
1197
  const block = SectionBlock.createRegisteredPropertiesBlock(expandedByDefault);
1195
1198
  for (const propertyRule of matchedStyles.registeredProperties()) {
1196
1199
  this.idleCallbackManager.schedule(() => {
1200
+ if (signal?.aborted) {
1201
+ return;
1202
+ }
1197
1203
  block.sections.push(new RegisteredPropertiesSection(
1198
1204
  this, matchedStyles, propertyRule.style(), sectionIdx, propertyRule.propertyName(), expandedByDefault));
1199
1205
  sectionIdx++;
@@ -1207,6 +1213,9 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
1207
1213
  const block = SectionBlock.createFunctionBlock(expandedByDefault);
1208
1214
  for (const functionRule of matchedStyles.functionRules()) {
1209
1215
  this.idleCallbackManager.schedule(() => {
1216
+ if (signal?.aborted) {
1217
+ return;
1218
+ }
1210
1219
  block.sections.push(new FunctionRuleSection(
1211
1220
  this, matchedStyles, functionRule.style, functionRule.children(), sectionIdx,
1212
1221
  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
  }
@@ -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),
@@ -51,7 +51,7 @@ import requestPayloadViewStyles from './requestPayloadView.css.js';
51
51
  import {ShowMoreDetailsWidget} from './ShowMoreDetailsWidget.js';
52
52
 
53
53
  const {classMap} = Directives;
54
- const {widgetConfig} = UI.Widget;
54
+ const {widget} = UI.Widget;
55
55
  const {ifExpanded} = UI.TreeOutline;
56
56
  const UIStrings = {
57
57
  /**
@@ -146,7 +146,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
146
146
 
147
147
  const createSourceText = (text: string): TemplateResult => html`<li role=treeitem
148
148
  @contextmenu=${copyValueContextmenu(i18nString(UIStrings.copyPayload), () => text, 'copy-payload')}>
149
- <devtools-widget class='payload-value source-code' .widgetConfig=${widgetConfig(ShowMoreDetailsWidget, {text})}>
149
+ <devtools-widget class='payload-value source-code' ${widget(ShowMoreDetailsWidget, {text})}>
150
150
  </devtools-widget>
151
151
  </li>`;
152
152
 
@@ -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
  }