chrome-devtools-frontend 1.0.1537268 → 1.0.1537860

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 (76) hide show
  1. package/.env.template +9 -0
  2. package/docs/get_the_code.md +27 -0
  3. package/front_end/core/common/SettingRegistration.ts +10 -7
  4. package/front_end/core/common/Settings.ts +3 -0
  5. package/front_end/core/sdk/sdk-meta.ts +8 -2
  6. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +4 -3
  7. package/front_end/generated/SupportedCSSProperties.js +1 -0
  8. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +23 -7
  9. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +110 -5
  10. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +50 -45
  11. package/front_end/models/cpu_profile/ProfileTreeModel.ts +7 -7
  12. package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +1 -1
  13. package/front_end/panels/application/StorageView.ts +3 -2
  14. package/front_end/panels/application/components/BackForwardCacheView.ts +34 -51
  15. package/front_end/panels/application/components/OriginTrialTreeView.ts +83 -80
  16. package/front_end/panels/application/components/backForwardCacheView.css +4 -0
  17. package/front_end/panels/application/components/badge.css +8 -0
  18. package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -2
  19. package/front_end/panels/application/preloading/components/PreloadingString.ts +27 -0
  20. package/front_end/panels/autofill/AutofillView.ts +1 -1
  21. package/front_end/panels/console/ConsoleView.ts +11 -9
  22. package/front_end/panels/coverage/CoverageView.ts +1 -2
  23. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
  24. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
  25. package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
  26. package/front_end/panels/elements/EventListenersWidget.ts +1 -2
  27. package/front_end/panels/elements/PropertiesWidget.ts +1 -1
  28. package/front_end/panels/network/NetworkConfigView.ts +2 -1
  29. package/front_end/panels/network/NetworkPanel.ts +5 -4
  30. package/front_end/panels/network/RequestCookiesView.ts +2 -1
  31. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -2
  32. package/front_end/panels/sensors/SensorsView.ts +4 -3
  33. package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +8 -6
  34. package/front_end/panels/settings/KeybindsSettingsTab.ts +3 -2
  35. package/front_end/panels/settings/SettingsScreen.ts +2 -1
  36. package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
  37. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -1
  38. package/front_end/panels/sources/SourcesPanel.ts +2 -1
  39. package/front_end/panels/sources/sources-meta.ts +8 -1
  40. package/front_end/panels/timeline/TimelinePanel.ts +4 -3
  41. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -20
  42. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -0
  43. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +2 -0
  44. package/front_end/third_party/chromium/README.chromium +1 -1
  45. package/front_end/ui/components/adorners/Adorner.ts +2 -1
  46. package/front_end/ui/components/buttons/Button.docs.ts +195 -0
  47. package/front_end/ui/components/settings/SettingCheckbox.ts +49 -14
  48. package/front_end/ui/components/settings/settingCheckbox.css +6 -1
  49. package/front_end/ui/components/spinners/Spinners.docs.ts +13 -0
  50. package/front_end/ui/components/tooltips/Tooltip.docs.ts +76 -0
  51. package/front_end/ui/legacy/FilterBar.ts +1 -2
  52. package/front_end/ui/legacy/RadioButton.docs.ts +41 -0
  53. package/front_end/ui/legacy/SelectMenu.docs.ts +98 -0
  54. package/front_end/ui/legacy/Toolbar.ts +4 -6
  55. package/front_end/ui/legacy/UIUtils.ts +114 -1
  56. package/front_end/ui/legacy/Widget.ts +62 -34
  57. package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +125 -0
  58. package/front_end/ui/legacy/components/settings_ui/settings_ui.ts +8 -0
  59. package/front_end/ui/legacy/legacy.ts +0 -2
  60. package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
  61. package/package.json +1 -1
  62. package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +0 -62
  63. package/front_end/models/trace/lantern/testing/testing.ts +0 -5
  64. package/front_end/ui/components/docs/button/basic.html +0 -44
  65. package/front_end/ui/components/docs/button/basic.ts +0 -175
  66. package/front_end/ui/components/docs/radio_button/basic.html +0 -23
  67. package/front_end/ui/components/docs/radio_button/basic.ts +0 -50
  68. package/front_end/ui/components/docs/select_menu/basic.html +0 -19
  69. package/front_end/ui/components/docs/select_menu/basic.ts +0 -95
  70. package/front_end/ui/components/docs/select_menu/wide-option.html +0 -38
  71. package/front_end/ui/components/docs/select_menu/wide-option.ts +0 -43
  72. package/front_end/ui/components/docs/spinners/basic.html +0 -17
  73. package/front_end/ui/components/docs/spinners/basic.ts +0 -22
  74. package/front_end/ui/components/docs/tooltip/basic.html +0 -20
  75. package/front_end/ui/components/docs/tooltip/basic.ts +0 -82
  76. package/front_end/ui/legacy/SettingsUI.ts +0 -240
@@ -5,7 +5,7 @@
5
5
  import '../../../ui/components/chrome_link/chrome_link.js';
6
6
  import '../../../ui/components/expandable_list/expandable_list.js';
7
7
  import '../../../ui/components/report_view/report_view.js';
8
- import '../../../ui/components/tree_outline/tree_outline.js';
8
+ import '../../../ui/legacy/legacy.js';
9
9
 
10
10
  import * as Common from '../../../core/common/common.js';
11
11
  import * as i18n from '../../../core/i18n/i18n.js';
@@ -15,7 +15,6 @@ import * as Protocol from '../../../generated/protocol.js';
15
15
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
16
16
  import type * as ExpandableList from '../../../ui/components/expandable_list/expandable_list.js';
17
17
  import type * as ReportView from '../../../ui/components/report_view/report_view.js';
18
- import type * as TreeOutline from '../../../ui/components/tree_outline/tree_outline.js';
19
18
  import * as Components from '../../../ui/legacy/components/utils/utils.js';
20
19
  import * as UI from '../../../ui/legacy/legacy.js';
21
20
  import {html, type LitTemplate, nothing, render, type TemplateResult} from '../../../ui/lit/lit.js';
@@ -213,22 +212,23 @@ function maybeRenderFrameTree(
213
212
  return nothing;
214
213
  }
215
214
 
216
- function treeNodeRenderer(node: TreeOutline.TreeOutlineUtils.TreeNode<FrameTreeNodeData>): TemplateResult {
215
+ function renderFrameTreeNode(node: FrameTreeNodeData): TemplateResult {
217
216
  // clang-format off
218
217
  return html`
219
- <div class="text-ellipsis">
220
- ${node.treeNodeData.iconName ? html`
221
- <devtools-icon class="inline-icon extra-large" .name=${node.treeNodeData.iconName} style="margin-bottom: -3px;">
218
+ <li role="treeitem" class="text-ellipsis">
219
+ ${node.iconName ? html`
220
+ <devtools-icon class="inline-icon extra-large" .name=${node.iconName} style="margin-bottom: -3px;">
222
221
  </devtools-icon>
223
222
  ` : nothing}
224
- ${node.treeNodeData.text}
225
- </div>`;
223
+ ${node.text}
224
+ ${node.children?.length ? html`
225
+ <ul role="group" hidden>
226
+ ${node.children.map(child => renderFrameTreeNode(child))}
227
+ </ul>` : nothing}
228
+ </li>`;
226
229
  // clang-format on
227
230
  }
228
231
 
229
- const frameTreeNode = buildFrameTree(frameTreeData.node);
230
- // Override the icon for the outermost frame.
231
- frameTreeNode.treeNodeData.iconName = 'frame';
232
232
  let title = '';
233
233
  // The translation pipeline does not support nested plurals. We avoid this
234
234
  // here by pulling out the logic for one of the plurals into code instead.
@@ -237,49 +237,31 @@ function maybeRenderFrameTree(
237
237
  } else {
238
238
  title = i18nString(UIStrings.issuesInMultipleFrames, {n: frameTreeData.issueCount, m: frameTreeData.frameCount});
239
239
  }
240
- const root: TreeOutline.TreeOutlineUtils.TreeNode<FrameTreeNodeData> = {
241
- treeNodeData: {
242
- text: title,
243
- },
244
- id: 'root',
245
- children: () => Promise.resolve([frameTreeNode]),
246
- };
247
-
248
240
  // clang-format off
249
241
  return html`
250
242
  <devtools-report-key jslog=${VisualLogging.section('frames')}>${i18nString(UIStrings.framesTitle)}</devtools-report-key>
251
243
  <devtools-report-value>
252
- <devtools-tree-outline .data=${{
253
- tree: [root],
254
- defaultRenderer: treeNodeRenderer,
255
- compact: true,
256
- } as TreeOutline.TreeOutline.TreeOutlineData<FrameTreeNodeData>}>
257
- </devtools-tree-outline>
244
+ <devtools-tree .template=${html`
245
+ <ul role="tree">
246
+ <li role="treeitem" class="text-ellipsis">
247
+ ${title}
248
+ <ul role="group">
249
+ ${renderFrameTreeNode(frameTreeData.node)}
250
+ </ul>
251
+ </li>
252
+ </ul>
253
+ `}>
254
+ </devtools-tree>
258
255
  </devtools-report-value>`;
259
256
  // clang-format on
260
257
  }
261
258
 
262
- let nextNodeId = 0;
263
-
264
- function buildFrameTree(data: FrameTreeNodeData): TreeOutline.TreeOutlineUtils.TreeNode<FrameTreeNodeData> {
265
- const children = data.children;
266
- const node = {
267
- treeNodeData: {
268
- text: data.text,
269
- ...(data.iconName ? {iconName: data.iconName} : {}),
270
- },
271
- ...(children?.length ? {children: () => Promise.resolve(children.map(child => buildFrameTree(child)))} : {}),
272
- id: String(nextNodeId++),
273
- };
274
- return node;
275
- }
276
-
277
259
  function renderBackForwardCacheStatus(status: boolean|undefined): TemplateResult {
278
260
  switch (status) {
279
261
  case true:
280
262
  // clang-format off
281
263
  return html`
282
- <devtools-report-section class="cache-status-section" tabindex="-1">
264
+ <devtools-report-section autofocus tabindex="-1">
283
265
  <div class="status extra-large">
284
266
  <devtools-icon class="inline-icon extra-large" name="check-circle" style="color: var(--icon-checkmark-green);">
285
267
  </devtools-icon>
@@ -290,7 +272,7 @@ function renderBackForwardCacheStatus(status: boolean|undefined): TemplateResult
290
272
  case false:
291
273
  // clang-format off
292
274
  return html`
293
- <devtools-report-section class="cache-status-section" tabindex="-1">
275
+ <devtools-report-section autofocus tabindex="-1">
294
276
  <div class="status">
295
277
  <devtools-icon class="inline-icon extra-large" name="clear">
296
278
  </devtools-icon>
@@ -301,7 +283,7 @@ function renderBackForwardCacheStatus(status: boolean|undefined): TemplateResult
301
283
  }
302
284
  // clang-format off
303
285
  return html`
304
- <devtools-report-section class="cache-status-section" tabindex="-1">
286
+ <devtools-report-section autofocus tabindex="-1">
305
287
  ${i18nString(UIStrings.unknown)}
306
288
  </devtools-report-section>`;
307
289
  // clang-format on
@@ -477,7 +459,7 @@ export class BackForwardCacheView extends UI.Widget.Widget {
477
459
  #view: View;
478
460
 
479
461
  constructor(view = DEFAULT_VIEW) {
480
- super({useShadowDom: true});
462
+ super({useShadowDom: true, delegatesFocus: true});
481
463
  this.#view = view;
482
464
  this.#getMainResourceTreeModel()?.addEventListener(
483
465
  SDK.ResourceTreeModel.Events.PrimaryPageChanged, this.requestUpdate, this);
@@ -497,13 +479,17 @@ export class BackForwardCacheView extends UI.Widget.Widget {
497
479
 
498
480
  override async performUpdate(): Promise<void> {
499
481
  const reasonToFramesMap = new Map<Protocol.Page.BackForwardCacheNotRestoredReason, string[]>();
500
- const explanationTree = this.#getMainFrame()?.backForwardCacheDetails?.explanationsTree;
482
+ const frame = this.#getMainFrame();
483
+ const explanationTree = frame?.backForwardCacheDetails?.explanationsTree;
501
484
  if (explanationTree) {
502
485
  this.#buildReasonToFramesMap(explanationTree, {blankCount: 1}, reasonToFramesMap);
503
486
  }
487
+ const frameTreeData = this.#buildFrameTreeDataRecursive(explanationTree, {blankCount: 1});
488
+ // Override the icon for the outermost frame.
489
+ frameTreeData.node.iconName = 'frame';
504
490
  const viewInput: ViewInput = {
505
- frame: this.#getMainFrame(),
506
- frameTreeData: this.#buildFrameTreeDataRecursive(explanationTree, {blankCount: 1}),
491
+ frame,
492
+ frameTreeData,
507
493
  reasonToFramesMap,
508
494
  screenStatus: this.#screenStatus,
509
495
  navigateAwayAndBack: this.#navigateAwayAndBack.bind(this),
@@ -519,10 +505,7 @@ export class BackForwardCacheView extends UI.Widget.Widget {
519
505
  this.requestUpdate();
520
506
  void this.updateComplete.then(() => {
521
507
  UI.ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.testCompleted));
522
- const resultsSection = this.contentElement?.querySelector('.cache-status-section') as HTMLElement;
523
- if (resultsSection) {
524
- resultsSection.focus();
525
- }
508
+ this.contentElement.focus();
526
509
  });
527
510
  }
528
511
 
@@ -5,7 +5,7 @@
5
5
  /* eslint-disable @devtools/no-lit-render-outside-of-view */
6
6
 
7
7
  import '../../../ui/components/icon_button/icon_button.js';
8
- import '../../../ui/components/tree_outline/tree_outline.js';
8
+ import '../../../ui/legacy/legacy.js';
9
9
 
10
10
  import * as i18n from '../../../core/i18n/i18n.js';
11
11
  import * as Protocol from '../../../generated/protocol.js';
@@ -78,6 +78,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
78
78
  export interface BadgeData {
79
79
  badgeContent: string;
80
80
  style: 'error'|'success'|'secondary';
81
+ additionalClass?: string;
81
82
  }
82
83
 
83
84
  function createBadge(data: BadgeData): Adorners.Adorner.Adorner {
@@ -89,6 +90,9 @@ function createBadge(data: BadgeData): Adorners.Adorner.Adorner {
89
90
  content: adornerContent,
90
91
  };
91
92
  adorner.classList.add(`badge-${data.style}`);
93
+ if (data.additionalClass) {
94
+ adorner.classList.add(data.additionalClass);
95
+ }
92
96
  return adorner;
93
97
  }
94
98
 
@@ -103,48 +107,46 @@ type TreeNode<DataType> = TreeOutline.TreeOutlineUtils.TreeNode<DataType>;
103
107
  **/
104
108
  export type OriginTrialTreeNodeData = Protocol.Page.OriginTrial|Protocol.Page.OriginTrialTokenWithStatus|string;
105
109
 
106
- function constructOriginTrialTree(originTrial: Protocol.Page.OriginTrial): TreeNode<OriginTrialTreeNodeData> {
107
- return {
108
- treeNodeData: originTrial,
109
- id: 'OriginTrialTreeNode#' + originTrial.trialName,
110
- children: async () => originTrial.tokensWithStatus.length > 1 ?
111
- originTrial.tokensWithStatus.map(constructTokenNode) :
112
- constructTokenDetailsNodes(originTrial.tokensWithStatus[0]),
113
- renderer: (node: TreeNode<OriginTrialTreeNodeData>) => {
114
- const trial = node.treeNodeData as Protocol.Page.OriginTrial;
115
- const tokenCountBadge = createBadge({
116
- badgeContent: i18nString(UIStrings.tokens, {PH1: trial.tokensWithStatus.length}),
117
- style: 'secondary',
118
- });
110
+ function constructOriginTrialTree(originTrial: Protocol.Page.OriginTrial): Lit.LitTemplate {
111
+ const tokenCountBadge = createBadge({
112
+ badgeContent: i18nString(UIStrings.tokens, {PH1: originTrial.tokensWithStatus.length}),
113
+ style: 'secondary',
114
+ });
119
115
 
120
- return html`
121
- ${trial.trialName}
122
- <style>${badgeStyles}</style>
123
- ${createBadge({
124
- badgeContent: trial.status,
125
- style: trial.status === Protocol.Page.OriginTrialStatus.Enabled ? 'success' : 'error',
116
+ // clang-format off
117
+ return html`
118
+ <li role="treeitem">
119
+ ${originTrial.trialName}
120
+ <style>${badgeStyles}</style>
121
+ ${createBadge({
122
+ badgeContent: originTrial.status,
123
+ style: originTrial.status === Protocol.Page.OriginTrialStatus.Enabled ? 'success' : 'error',
126
124
  })}
127
- ${trial.tokensWithStatus.length > 1 ? tokenCountBadge : Lit.nothing}
128
- `;
129
- },
130
- };
125
+ ${originTrial.tokensWithStatus.length > 1 ? tokenCountBadge : Lit.nothing}
126
+ <ul role="group" hidden>
127
+ ${originTrial.tokensWithStatus.length > 1 ?
128
+ originTrial.tokensWithStatus.map(constructTokenNode) :
129
+ constructTokenDetailsNodes(originTrial.tokensWithStatus[0])}
130
+ </ul>
131
+ </li>`;
132
+ // clang-format on
131
133
  }
132
134
 
133
- function constructTokenNode(token: Protocol.Page.OriginTrialTokenWithStatus): TreeNode<OriginTrialTreeNodeData> {
134
- return {
135
- treeNodeData: token.status,
136
- id: 'TokenNode#' + token.rawTokenText,
137
- children: async () => constructTokenDetailsNodes(token),
138
- renderer: (node: TreeNode<OriginTrialTreeNodeData>, state: {isExpanded: boolean}) => {
139
- const tokenStatus = node.treeNodeData as string;
140
- const statusBadge = createBadge({
141
- badgeContent: tokenStatus,
142
- style: tokenStatus === Protocol.Page.OriginTrialTokenStatus.Success ? 'success' : 'error',
143
- });
144
- // Only display token status for convenience when the node is not expanded.
145
- return html`${i18nString(UIStrings.token)} ${state.isExpanded ? Lit.nothing : statusBadge}`;
146
- },
147
- };
135
+ function constructTokenNode(token: Protocol.Page.OriginTrialTokenWithStatus): Lit.LitTemplate {
136
+ const statusBadge = createBadge({
137
+ badgeContent: token.status,
138
+ style: token.status === Protocol.Page.OriginTrialTokenStatus.Success ? 'success' : 'error',
139
+ additionalClass: 'token-status-badge',
140
+ });
141
+ // Only display token status for convenience when the node is not expanded.
142
+ // clang-format off
143
+ return html`
144
+ <li role="treeitem">
145
+ ${i18nString(UIStrings.token)} ${statusBadge}
146
+ <ul role="group" hidden>
147
+ ${constructTokenDetailsNodes(token)}
148
+ </ul>
149
+ </li>`;
148
150
  }
149
151
 
150
152
  interface TokenField {
@@ -152,46 +154,38 @@ interface TokenField {
152
154
  value: Lit.TemplateResult;
153
155
  }
154
156
 
155
- function renderTokenDetails(node: TreeNode<OriginTrialTreeNodeData>): Lit.TemplateResult {
157
+ function renderTokenDetails(token: Protocol.Page.OriginTrialTokenWithStatus): Lit.TemplateResult {
156
158
  return html`
157
- <devtools-resources-origin-trial-token-rows .data=${{node} as OriginTrialTokenRowsData}>
158
- </devtools-resources-origin-trial-token-rows>
159
- `;
159
+ <li role="treeitem">
160
+ <devtools-resources-origin-trial-token-rows .data=${token}>
161
+ </devtools-resources-origin-trial-token-rows>
162
+ </li>`;
160
163
  }
161
164
 
162
165
  function constructTokenDetailsNodes(token: Protocol.Page.OriginTrialTokenWithStatus):
163
- Array<TreeNode<OriginTrialTreeNodeData>> {
164
- return [
165
- {
166
- treeNodeData: token,
167
- id: 'TokenDetailsNode#' + token.rawTokenText,
168
- renderer: renderTokenDetails,
169
- },
170
- constructRawTokenTextNode(token.rawTokenText),
171
- ];
172
- }
173
-
174
- function constructRawTokenTextNode(tokenText: string): TreeNode<OriginTrialTreeNodeData> {
175
- return {
176
- treeNodeData: i18nString(UIStrings.rawTokenText),
177
- id: 'TokenRawTextContainerNode#' + tokenText,
178
- children: async () => [{
179
- treeNodeData: tokenText,
180
- id: 'TokenRawTextNode#' + tokenText,
181
- renderer: (data: TreeNode<OriginTrialTreeNodeData>) => {
182
- const tokenText = data.treeNodeData as string;
183
- return html`
184
- <div style="overflow-wrap: break-word;">
185
- ${tokenText}
186
- </div>
187
- `;
188
- },
189
- }],
190
- };
166
+ Lit.LitTemplate {
167
+ // clang-format off
168
+ return html`
169
+ ${renderTokenDetails(token)}
170
+ ${constructRawTokenTextNode(token.rawTokenText)}
171
+ `;
172
+ // clang-format on
191
173
  }
192
174
 
193
- function defaultRenderer(node: TreeNode<OriginTrialTreeNodeData>): Lit.TemplateResult {
194
- return html`${String(node.treeNodeData)}`;
175
+ function constructRawTokenTextNode(tokenText: string): Lit.LitTemplate {
176
+ // clang-format off
177
+ return html`
178
+ <li role="treeitem">
179
+ ${i18nString(UIStrings.rawTokenText)}
180
+ <ul role="group" hidden>
181
+ <li role="treeitem">
182
+ <div style="overflow-wrap: break-word;">
183
+ ${tokenText}
184
+ </div>
185
+ </li>
186
+ </ul>
187
+ </li>`;
188
+ // clang-format on
195
189
  }
196
190
 
197
191
  export interface OriginTrialTokenRowsData {
@@ -207,8 +201,8 @@ export class OriginTrialTokenRows extends HTMLElement {
207
201
  {dateStyle: 'long', timeStyle: 'long'},
208
202
  );
209
203
 
210
- set data(data: OriginTrialTokenRowsData) {
211
- this.#tokenWithStatus = data.node.treeNodeData as Protocol.Page.OriginTrialTokenWithStatus;
204
+ set data(data: Protocol.Page.OriginTrialTokenWithStatus) {
205
+ this.#tokenWithStatus = data;
212
206
  this.#setTokenFields();
213
207
  }
214
208
 
@@ -216,6 +210,14 @@ export class OriginTrialTokenRows extends HTMLElement {
216
210
  this.#render();
217
211
  }
218
212
 
213
+ override cloneNode(): HTMLElement {
214
+ const clone = UI.UIUtils.cloneCustomElement(this);
215
+ if (this.#tokenWithStatus) {
216
+ clone.data = this.#tokenWithStatus;
217
+ }
218
+ return clone;
219
+ }
220
+
219
221
  #renderTokenField = (fieldValue: string, hasError?: boolean): Lit.TemplateResult => html`
220
222
  <div class=${ifDefined(hasError ? 'error-text' : undefined)}>
221
223
  ${fieldValue}
@@ -327,11 +329,12 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
327
329
  <style>
328
330
  ${originTrialTreeViewStyles}
329
331
  </style>
330
- <devtools-tree-outline .data=${{
331
- tree: input.trials.map(constructOriginTrialTree),
332
- defaultRenderer,
333
- } as TreeOutline.TreeOutline.TreeOutlineData < OriginTrialTreeNodeData >}>
334
- </devtools-tree-outline>
332
+ <devtools-tree .template=${html`
333
+ <ul role="tree">
334
+ ${input.trials.map(constructOriginTrialTree)}
335
+ </ul>
336
+ `}>
337
+ </devtools-tree>
335
338
  `, target);
336
339
  // clang-format on
337
340
  };
@@ -4,6 +4,10 @@
4
4
  * found in the LICENSE file.
5
5
  */
6
6
 
7
+ devtools-report-value {
8
+ overflow: hidden;
9
+ }
10
+
7
11
  .inline-icon {
8
12
  vertical-align: sub;
9
13
  }
@@ -23,3 +23,11 @@
23
23
  :host devtools-adorner {
24
24
  font-family: var(--source-code-font-family);
25
25
  }
26
+
27
+ .token-status-badge {
28
+ display: none;
29
+ }
30
+
31
+ [aria-expanded='false'] .token-status-badge {
32
+ display: inline-flex;
33
+ }
@@ -16,7 +16,7 @@ import type * as UI from '../../../../ui/legacy/legacy.js';
16
16
  import * as Lit from '../../../../ui/lit/lit.js';
17
17
 
18
18
  import preloadingGridStyles from './preloadingGrid.css.js';
19
- import {capitalizedAction, composedStatus, ruleSetTagOrLocationShort} from './PreloadingString.js';
19
+ import {capitalizedAction, composedStatus, ruleSetTagOrLocationShort, sortOrder} from './PreloadingString.js';
20
20
 
21
21
  const {PreloadingStatus} = SDK.PreloadingModel;
22
22
 
@@ -100,7 +100,7 @@ export class PreloadingGrid extends LegacyWrapper.LegacyWrapper.WrappableCompone
100
100
  <td title=${attempt.key.url}>${this.#urlShort(row, securityOrigin)}</td>
101
101
  <td>${capitalizedAction(attempt.action)}</td>
102
102
  <td>${row.ruleSets.length === 0 ? '' : ruleSetTagOrLocationShort(row.ruleSets[0], pageURL)}</td>
103
- <td>
103
+ <td data-value=${sortOrder(attempt)}>
104
104
  <div style=${styleMap({color: hasWarning ? 'var(--sys-color-orange-bright)'
105
105
  : hasError ? 'var(--sys-color-error)'
106
106
  : 'var(--sys-color-on-surface)'})}>
@@ -741,6 +741,33 @@ export function capitalizedAction(action: Protocol.Preload.SpeculationAction): C
741
741
  }
742
742
  }
743
743
 
744
+ export function sortOrder(attempt: SDK.PreloadingModel.PreloadingAttempt): number {
745
+ switch (attempt.status) {
746
+ case SDK.PreloadingModel.PreloadingStatus.NOT_TRIGGERED:
747
+ return 0;
748
+ case SDK.PreloadingModel.PreloadingStatus.NOT_SUPPORTED:
749
+ return 1;
750
+ case SDK.PreloadingModel.PreloadingStatus.PENDING:
751
+ return 2;
752
+ case SDK.PreloadingModel.PreloadingStatus.RUNNING:
753
+ return 3;
754
+ case SDK.PreloadingModel.PreloadingStatus.READY:
755
+ return 4;
756
+ case SDK.PreloadingModel.PreloadingStatus.SUCCESS:
757
+ return 5;
758
+ case SDK.PreloadingModel.PreloadingStatus.FAILURE: {
759
+ switch (attempt.action) {
760
+ case Protocol.Preload.SpeculationAction.Prefetch:
761
+ return 6;
762
+ case Protocol.Preload.SpeculationAction.Prerender:
763
+ return 7;
764
+ case Protocol.Preload.SpeculationAction.PrerenderUntilScript:
765
+ return 8;
766
+ }
767
+ }
768
+ }
769
+ }
770
+
744
771
  export function status(status: SDK.PreloadingModel.PreloadingStatus): string {
745
772
  // See content/public/browser/preloading.h PreloadingAttemptOutcome.
746
773
  switch (status) {
@@ -20,7 +20,7 @@ import autofillViewStyles from './autofillView.css.js';
20
20
 
21
21
  const {html, render, Directives: {styleMap}} = Lit;
22
22
  const {FillingStrategy} = Protocol.Autofill;
23
- const {bindToSetting} = UI.SettingsUI;
23
+ const {bindToSetting} = UI.UIUtils;
24
24
 
25
25
  const UIStrings = {
26
26
  /**
@@ -51,6 +51,7 @@ import * as IconButton from '../../ui/components/icon_button/icon_button.js';
51
51
  import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
52
52
  // eslint-disable-next-line @devtools/es-modules-import
53
53
  import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
54
+ import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
54
55
  import * as Components from '../../ui/legacy/components/utils/utils.js';
55
56
  import * as UI from '../../ui/legacy/legacy.js';
56
57
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -470,29 +471,30 @@ export class ConsoleView extends UI.Widget.VBox implements
470
471
  const preserveConsoleLogSetting = Common.Settings.Settings.instance().moduleSetting('preserve-console-log');
471
472
  const userActivationEvalSetting = Common.Settings.Settings.instance().moduleSetting('console-user-activation-eval');
472
473
  settingsPane.append(
473
- UI.SettingsUI.createSettingCheckbox(
474
+ SettingsUI.SettingsUI.createSettingCheckbox(
474
475
  i18nString(UIStrings.hideNetwork), this.filter.hideNetworkMessagesSetting,
475
476
  this.filter.hideNetworkMessagesSetting.title()),
476
- UI.SettingsUI.createSettingCheckbox(i18nString(UIStrings.logXMLHttpRequests), monitoringXHREnabledSetting),
477
- UI.SettingsUI.createSettingCheckbox(
477
+ SettingsUI.SettingsUI.createSettingCheckbox(
478
+ i18nString(UIStrings.logXMLHttpRequests), monitoringXHREnabledSetting),
479
+ SettingsUI.SettingsUI.createSettingCheckbox(
478
480
  i18nString(UIStrings.preserveLog), preserveConsoleLogSetting,
479
481
  i18nString(UIStrings.doNotClearLogOnPageReload)),
480
- UI.SettingsUI.createSettingCheckbox(
482
+ SettingsUI.SettingsUI.createSettingCheckbox(
481
483
  consoleEagerEvalSetting.title(), consoleEagerEvalSetting,
482
484
  i18nString(UIStrings.eagerlyEvaluateTextInThePrompt)),
483
- UI.SettingsUI.createSettingCheckbox(
485
+ SettingsUI.SettingsUI.createSettingCheckbox(
484
486
  i18nString(UIStrings.selectedContextOnly), this.filter.filterByExecutionContextSetting,
485
487
  i18nString(UIStrings.onlyShowMessagesFromTheCurrentContext)),
486
- UI.SettingsUI.createSettingCheckbox(
488
+ SettingsUI.SettingsUI.createSettingCheckbox(
487
489
  this.consoleHistoryAutocompleteSetting.title(), this.consoleHistoryAutocompleteSetting,
488
490
  i18nString(UIStrings.autocompleteFromHistory)),
489
- UI.SettingsUI.createSettingCheckbox(
491
+ SettingsUI.SettingsUI.createSettingCheckbox(
490
492
  this.groupSimilarSetting.title(), this.groupSimilarSetting,
491
493
  i18nString(UIStrings.groupSimilarMessagesInConsole)),
492
- UI.SettingsUI.createSettingCheckbox(
494
+ SettingsUI.SettingsUI.createSettingCheckbox(
493
495
  userActivationEvalSetting.title(), userActivationEvalSetting,
494
496
  i18nString(UIStrings.treatEvaluationAsUserActivation)),
495
- UI.SettingsUI.createSettingCheckbox(
497
+ SettingsUI.SettingsUI.createSettingCheckbox(
496
498
  this.showCorsErrorsSetting.title(), this.showCorsErrorsSetting,
497
499
  i18nString(UIStrings.showCorsErrorsInConsole)),
498
500
  );
@@ -126,8 +126,7 @@ const str_ = i18n.i18n.registerUIStrings('panels/coverage/CoverageView.ts', UISt
126
126
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
127
127
  const i18nTemplate = unboundI18nTemplate.bind(undefined, str_);
128
128
  const {ref} = Directives;
129
- const {bindToAction} = UI.UIUtils;
130
- const {bindToSetting} = UI.SettingsUI;
129
+ const {bindToAction, bindToSetting} = UI.UIUtils;
131
130
  const {widgetConfig} = UI.Widget;
132
131
 
133
132
  let coverageViewInstance: CoverageView|undefined;
@@ -129,7 +129,7 @@ export class CSSOverviewSidebarPanel extends UI.Widget.VBox {
129
129
  this.requestUpdate();
130
130
  }
131
131
 
132
- #select(id: string, shouldFocus = false): Promise<boolean> {
132
+ #select(id: string, shouldFocus = false): Promise<void> {
133
133
  this.#selectedId = id;
134
134
  this.requestUpdate();
135
135
  this.#onItemSelected(id, shouldFocus);
@@ -17,7 +17,7 @@ import {DeveloperResourcesListView} from './DeveloperResourcesListView.js';
17
17
  import developerResourcesViewStyles from './developerResourcesView.css.js';
18
18
 
19
19
  const {widgetConfig} = UI.Widget;
20
- const {bindToSetting} = UI.SettingsUI;
20
+ const {bindToSetting} = UI.UIUtils;
21
21
 
22
22
  const UIStrings = {
23
23
  /**
@@ -12,7 +12,7 @@ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
12
12
  import {ElementsPanel} from './ElementsPanel.js';
13
13
  import elementStatePaneWidgetStyles from './elementStatePaneWidget.css.js';
14
14
 
15
- const {bindToSetting} = UI.SettingsUI;
15
+ const {bindToSetting} = UI.UIUtils;
16
16
 
17
17
  const UIStrings = {
18
18
  /**
@@ -39,8 +39,7 @@ import {html, render} from '../../ui/lit/lit.js';
39
39
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
40
40
  import * as EventListeners from '../event_listeners/event_listeners.js';
41
41
 
42
- const {bindToSetting} = UI.SettingsUI;
43
- const {bindToAction} = UI.UIUtils;
42
+ const {bindToAction, bindToSetting} = UI.UIUtils;
44
43
 
45
44
  const UIStrings = {
46
45
  /**
@@ -47,7 +47,7 @@ import propertiesWidgetStyles from './propertiesWidget.css.js';
47
47
 
48
48
  const OBJECT_GROUP_NAME = 'properties-sidebar-pane';
49
49
 
50
- const {bindToSetting} = UI.SettingsUI;
50
+ const {bindToSetting} = UI.UIUtils;
51
51
 
52
52
  const UIStrings = {
53
53
  /**
@@ -8,6 +8,7 @@ import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Platform from '../../core/platform/platform.js';
9
9
  import * as SDK from '../../core/sdk/sdk.js';
10
10
  import * as Protocol from '../../generated/protocol.js';
11
+ import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
11
12
  import * as UI from '../../ui/legacy/legacy.js';
12
13
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
13
14
  import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
@@ -208,7 +209,7 @@ export class NetworkConfigView extends UI.Widget.VBox {
208
209
 
209
210
  private createCacheSection(): void {
210
211
  const section = this.createSection(i18nString(UIStrings.caching), 'network-config-disable-cache');
211
- section.appendChild(UI.SettingsUI.createSettingCheckbox(
212
+ section.appendChild(SettingsUI.SettingsUI.createSettingCheckbox(
212
213
  i18nString(UIStrings.disableCache), Common.Settings.Settings.instance().moduleSetting('cache-disabled')));
213
214
  }
214
215
 
@@ -48,6 +48,7 @@ import type * as PanelCommon from '../../panels/common/common.js';
48
48
  import * as NetworkForward from '../../panels/network/forward/forward.js';
49
49
  import * as Tracing from '../../services/tracing/tracing.js';
50
50
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
51
+ import * as SettingsUI from '../../ui/legacy/components/settings_ui/settings_ui.js';
51
52
  import * as UI from '../../ui/legacy/legacy.js';
52
53
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
53
54
  import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
@@ -259,17 +260,17 @@ export class NetworkPanel extends UI.Panel.Panel implements
259
260
 
260
261
  const settingsPane = panel.contentElement.createChild('div', 'network-settings-pane');
261
262
  settingsPane.append(
262
- UI.SettingsUI.createSettingCheckbox(
263
+ SettingsUI.SettingsUI.createSettingCheckbox(
263
264
  i18nString(UIStrings.useLargeRequestRows), this.networkLogLargeRowsSetting,
264
265
  i18nString(UIStrings.showMoreInformationInRequestRows)),
265
- UI.SettingsUI.createSettingCheckbox(
266
+ SettingsUI.SettingsUI.createSettingCheckbox(
266
267
  i18nString(UIStrings.groupByFrame),
267
268
  Common.Settings.Settings.instance().moduleSetting('network.group-by-frame'),
268
269
  i18nString(UIStrings.groupRequestsByTopLevelRequest)),
269
- UI.SettingsUI.createSettingCheckbox(
270
+ SettingsUI.SettingsUI.createSettingCheckbox(
270
271
  i18nString(UIStrings.showOverview), this.networkLogShowOverviewSetting,
271
272
  i18nString(UIStrings.showOverviewOfNetworkRequests)),
272
- UI.SettingsUI.createSettingCheckbox(
273
+ SettingsUI.SettingsUI.createSettingCheckbox(
273
274
  i18nString(UIStrings.captureScreenshots), this.networkRecordFilmStripSetting,
274
275
  i18nString(UIStrings.captureScreenshotsWhenLoadingA)),
275
276