chrome-devtools-frontend 1.0.1534717 → 1.0.1536371

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 (95) hide show
  1. package/docs/contributing/images/issues-nearestslo.png +0 -0
  2. package/docs/contributing/issues.md +32 -58
  3. package/eslint.config.mjs +1 -0
  4. package/front_end/core/common/Console.ts +1 -8
  5. package/front_end/core/common/ParsedURL.ts +10 -20
  6. package/front_end/core/common/SegmentedRange.ts +1 -2
  7. package/front_end/core/common/StringOutputStream.ts +1 -4
  8. package/front_end/core/host/InspectorFrontendHost.ts +6 -0
  9. package/front_end/core/host/UserMetrics.ts +5 -1
  10. package/front_end/core/i18n/i18nImpl.ts +0 -24
  11. package/front_end/core/protocol_client/CDPConnection.ts +53 -5
  12. package/front_end/core/protocol_client/protocol_client.ts +2 -0
  13. package/front_end/core/sdk/AnimationModel.ts +1 -2
  14. package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
  15. package/front_end/core/sdk/CSSModel.ts +1 -1
  16. package/front_end/core/sdk/CSSProperty.ts +3 -6
  17. package/front_end/core/sdk/CSSStyleDeclaration.ts +4 -4
  18. package/front_end/core/sdk/DebuggerModel.ts +1 -2
  19. package/front_end/core/sdk/EnhancedTracesParser.ts +4 -0
  20. package/front_end/core/sdk/SourceMap.ts +2 -3
  21. package/front_end/devtools_compatibility.js +32 -24
  22. package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +2 -1
  23. package/front_end/generated/InspectorBackendCommands.js +1 -2
  24. package/front_end/generated/SupportedCSSProperties.js +57 -0
  25. package/front_end/generated/protocol.ts +0 -27
  26. package/front_end/panels/accessibility/AccessibilityNodeView.ts +18 -17
  27. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +9 -12
  28. package/front_end/panels/ai_assistance/PatchWidget.ts +39 -40
  29. package/front_end/panels/ai_assistance/components/ChatView.ts +5 -4
  30. package/front_end/panels/ai_assistance/components/ExploreWidget.ts +0 -2
  31. package/front_end/panels/application/AppManifestView.ts +7 -6
  32. package/front_end/panels/application/ApplicationPanelSidebar.ts +4 -4
  33. package/front_end/panels/application/OpenedWindowDetailsView.ts +6 -6
  34. package/front_end/panels/application/StorageView.ts +9 -8
  35. package/front_end/panels/application/components/BackForwardCacheView.ts +333 -314
  36. package/front_end/panels/application/components/ProtocolHandlersView.ts +3 -2
  37. package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -1
  38. package/front_end/panels/autofill/AutofillView.ts +2 -3
  39. package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +8 -8
  40. package/front_end/panels/changes/CombinedDiffView.ts +13 -14
  41. package/front_end/panels/common/BadgeNotification.ts +2 -1
  42. package/front_end/panels/common/GdpSignUpDialog.ts +2 -1
  43. package/front_end/panels/console/ConsoleInsightTeaser.ts +13 -2
  44. package/front_end/panels/console/ConsolePinPane.ts +12 -7
  45. package/front_end/panels/console/ConsoleView.ts +1 -0
  46. package/front_end/panels/console/consoleView.css +0 -1
  47. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +9 -9
  48. package/front_end/panels/elements/ComputedStyleWidget.ts +7 -7
  49. package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
  50. package/front_end/panels/elements/EventListenersWidget.ts +9 -9
  51. package/front_end/panels/elements/NodeStackTraceWidget.ts +6 -6
  52. package/front_end/panels/elements/PlatformFontsWidget.ts +5 -5
  53. package/front_end/panels/elements/PropertiesWidget.ts +8 -8
  54. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -1
  55. package/front_end/panels/layer_viewer/PaintProfilerView.ts +3 -3
  56. package/front_end/panels/network/RequestCookiesView.ts +2 -1
  57. package/front_end/panels/network/RequestTimingView.ts +2 -1
  58. package/front_end/panels/network/components/DirectSocketConnectionView.ts +4 -6
  59. package/front_end/panels/recorder/RecorderController.ts +34 -23
  60. package/front_end/panels/recorder/components/CreateRecordingView.ts +249 -240
  61. package/front_end/panels/security/CookieControlsView.ts +74 -67
  62. package/front_end/panels/security/CookieReportView.ts +18 -16
  63. package/front_end/panels/security/IPProtectionView.ts +1 -2
  64. package/front_end/panels/security/SecurityPanel.ts +19 -19
  65. package/front_end/panels/settings/AISettingsTab.ts +2 -1
  66. package/front_end/panels/settings/KeybindsSettingsTab.ts +6 -0
  67. package/front_end/panels/settings/components/SyncSection.ts +2 -1
  68. package/front_end/panels/sources/DebuggerPausedMessage.ts +4 -3
  69. package/front_end/panels/sources/ResourceOriginPlugin.ts +3 -2
  70. package/front_end/panels/sources/SourcesNavigator.ts +2 -1
  71. package/front_end/panels/sources/TabbedEditorContainer.ts +3 -2
  72. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +9 -9
  73. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +36 -36
  74. package/front_end/panels/timeline/TimelineUIUtils.ts +3 -2
  75. package/front_end/panels/timeline/components/DetailsView.ts +5 -4
  76. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +2 -1
  77. package/front_end/panels/timeline/components/LiveMetricsView.ts +5 -4
  78. package/front_end/panels/timeline/components/MetricCompareStrings.ts +25 -24
  79. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +1 -2
  80. package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +2 -1
  81. package/front_end/third_party/chromium/README.chromium +1 -1
  82. package/front_end/ui/components/docs/tooltip/basic.ts +1 -1
  83. package/front_end/ui/components/tooltips/Tooltip.ts +32 -17
  84. package/front_end/ui/i18n/i18n.ts +31 -0
  85. package/front_end/ui/legacy/SoftDropDown.ts +1 -12
  86. package/front_end/ui/legacy/ViewManager.ts +2 -4
  87. package/front_end/ui/legacy/Widget.ts +33 -17
  88. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -1
  89. package/front_end/ui/legacy/legacy.ts +0 -2
  90. package/front_end/ui/visual_logging/KnownContextValues.ts +5 -0
  91. package/mcp/mcp.ts +1 -0
  92. package/package.json +1 -1
  93. package/front_end/ui/components/docs/recorder_create_recording_view/basic.html +0 -20
  94. package/front_end/ui/components/docs/recorder_create_recording_view/basic.ts +0 -27
  95. package/front_end/ui/legacy/ThrottledWidget.ts +0 -48
@@ -10,6 +10,7 @@ import * as i18n from '../../../core/i18n/i18n.js';
10
10
  import * as Platform from '../../../core/platform/platform.js';
11
11
  import * as Buttons from '../../../ui/components/buttons/buttons.js';
12
12
  import * as Input from '../../../ui/components/input/input.js';
13
+ import * as uiI18n from '../../../ui/i18n/i18n.js';
13
14
  import * as UI from '../../../ui/legacy/legacy.js';
14
15
  import * as Lit from '../../../ui/lit/lit.js';
15
16
  import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
@@ -116,7 +117,7 @@ export class ProtocolHandlersView extends HTMLElement {
116
117
  <devtools-icon class="inline-icon"
117
118
  name=${this.#protocolHandlers.length > 0 ? 'check-circle' : 'info'}>
118
119
  </devtools-icon>
119
- ${i18n.i18n.getFormatLocalizedString(str_, statusString, {
120
+ ${uiI18n.getFormatLocalizedString(str_, statusString, {
120
121
  PH1: manifestInTextLink,
121
122
  })}
122
123
  </div>
@@ -175,7 +176,7 @@ export class ProtocolHandlersView extends HTMLElement {
175
176
  <style>${Input.textInputStyles}</style>
176
177
  ${this.#renderStatusMessage()}
177
178
  <div class="protocol-handlers-row">
178
- ${i18n.i18n.getFormatLocalizedString(str_, UIStrings.needHelpReadOur, {PH1: protocolDocLink})}
179
+ ${uiI18n.getFormatLocalizedString(str_, UIStrings.needHelpReadOur, {PH1: protocolDocLink})}
179
180
  </div>
180
181
  ${this.#renderProtocolTest()}
181
182
  `, this.#shadow, {host: this});
@@ -13,6 +13,7 @@ import * as ChromeLink from '../../../../ui/components/chrome_link/chrome_link.j
13
13
  import * as Dialogs from '../../../../ui/components/dialogs/dialogs.js';
14
14
  import * as LegacyWrapper from '../../../../ui/components/legacy_wrapper/legacy_wrapper.js';
15
15
  import * as RenderCoordinator from '../../../../ui/components/render_coordinator/render_coordinator.js';
16
+ import * as uiI18n from '../../../../ui/i18n/i18n.js';
16
17
  import * as UI from '../../../../ui/legacy/legacy.js';
17
18
  import * as Lit from '../../../../ui/lit/lit.js';
18
19
  import * as VisualLogging from '../../../../ui/visual_logging/visual_logging.js';
@@ -214,7 +215,7 @@ export class PreloadingDisabledInfobar extends LegacyWrapper.LegacyWrapper.Wrapp
214
215
  const extensionsSettingLink = new ChromeLink.ChromeLink.ChromeLink();
215
216
  extensionsSettingLink.href = 'chrome://extensions' as Platform.DevToolsPath.UrlString;
216
217
  extensionsSettingLink.textContent = i18nString(UIStrings.extensionsSettings);
217
- const description = i18n.i18n.getFormatLocalizedString(
218
+ const description = uiI18n.getFormatLocalizedString(
218
219
  str_, UIStrings.descriptionDisabledByPreference, {PH1: preloadingSettingLink, PH2: extensionsSettingLink});
219
220
  return this.#maybeKeyValue(
220
221
  this.#data.disabledByPreference, i18nString(UIStrings.headerDisabledByPreference), description);
@@ -1,7 +1,6 @@
1
1
  // Copyright 2023 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
4
 
6
5
  import '../../ui/components/adorners/adorners.js';
7
6
  import '../../ui/legacy/components/data_grid/data_grid.js';
@@ -250,7 +249,7 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: ViewOutput, target: HTMLE
250
249
  </div>
251
250
  </div>
252
251
  </main>
253
- `, target, {host: this});
252
+ `, target);
254
253
  // clang-format on
255
254
  return;
256
255
  }
@@ -287,7 +286,7 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: ViewOutput, target: HTMLE
287
286
  ${renderFilledFields()}
288
287
  </div>
289
288
  </main>
290
- `, target, {host: this});
289
+ `, target);
291
290
  // clang-format on
292
291
  };
293
292
 
@@ -9,8 +9,7 @@ import * as UI from '../../ui/legacy/legacy.js';
9
9
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
10
10
  import * as EventListeners from '../event_listeners/event_listeners.js';
11
11
 
12
- export class ObjectEventListenersSidebarPane extends UI.ThrottledWidget.ThrottledWidget implements
13
- UI.Toolbar.ItemsProvider {
12
+ export class ObjectEventListenersSidebarPane extends UI.Widget.VBox implements UI.Toolbar.ItemsProvider {
14
13
  #lastRequestedContext?: SDK.RuntimeModel.ExecutionContext;
15
14
 
16
15
  // TODO(bmeurer): This is only public for web tests.
@@ -21,11 +20,11 @@ export class ObjectEventListenersSidebarPane extends UI.ThrottledWidget.Throttle
21
20
  this.contentElement.setAttribute('jslog', `${VisualLogging.section('sources.global-listeners')}`);
22
21
 
23
22
  this.eventListenersView = new EventListeners.EventListenersView.EventListenersView();
24
- this.eventListenersView.changeCallback = this.update.bind(this);
23
+ this.eventListenersView.changeCallback = this.requestUpdate.bind(this);
25
24
  this.eventListenersView.enableDefaultTreeFocus = true;
26
25
  this.eventListenersView.show(this.element);
27
26
  this.setDefaultFocusedChild(this.eventListenersView);
28
- this.update();
27
+ this.requestUpdate();
29
28
  }
30
29
 
31
30
  toolbarItems(): UI.Toolbar.ToolbarItem[] {
@@ -34,7 +33,7 @@ export class ObjectEventListenersSidebarPane extends UI.ThrottledWidget.Throttle
34
33
  return [refreshButton];
35
34
  }
36
35
 
37
- protected override async doUpdate(): Promise<void> {
36
+ override async performUpdate(): Promise<void> {
38
37
  if (this.#lastRequestedContext) {
39
38
  this.#lastRequestedContext.runtimeModel.releaseObjectGroup(objectGroupName);
40
39
  this.#lastRequestedContext = undefined;
@@ -64,13 +63,14 @@ export class ObjectEventListenersSidebarPane extends UI.ThrottledWidget.Throttle
64
63
 
65
64
  override wasShown(): void {
66
65
  super.wasShown();
67
- UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.update, this);
66
+ UI.Context.Context.instance().addFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.requestUpdate, this);
68
67
  UI.Context.Context.instance().setFlavor(ObjectEventListenersSidebarPane, this);
69
68
  }
70
69
 
71
70
  override willHide(): void {
72
71
  UI.Context.Context.instance().setFlavor(ObjectEventListenersSidebarPane, null);
73
- UI.Context.Context.instance().removeFlavorChangeListener(SDK.RuntimeModel.ExecutionContext, this.update, this);
72
+ UI.Context.Context.instance().removeFlavorChangeListener(
73
+ SDK.RuntimeModel.ExecutionContext, this.requestUpdate, this);
74
74
  super.willHide();
75
75
  if (this.#lastRequestedContext) {
76
76
  this.#lastRequestedContext.runtimeModel.releaseObjectGroup(objectGroupName);
@@ -85,7 +85,7 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
85
85
  case 'browser-debugger.refresh-global-event-listeners': {
86
86
  const eventListenersSidebarPane = context.flavor(ObjectEventListenersSidebarPane);
87
87
  if (eventListenersSidebarPane) {
88
- eventListenersSidebarPane.update();
88
+ eventListenersSidebarPane.requestUpdate();
89
89
  return true;
90
90
  }
91
91
  return false;
@@ -1,7 +1,6 @@
1
1
  // Copyright 2025 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-lit-render-outside-of-view */
5
4
 
6
5
  import * as Common from '../../core/common/common.js';
7
6
  import * as i18n from '../../core/i18n/i18n.js';
@@ -101,6 +100,18 @@ function renderSingleDiffView(singleDiffViewInput: SingleDiffViewInput): Lit.Tem
101
100
  // clang-format on
102
101
  }
103
102
 
103
+ const DEFAULT_VIEW: View = (input, output, target) => {
104
+ // clang-format off
105
+ Lit.render(
106
+ html`
107
+ <div class="combined-diff-view">
108
+ ${input.singleDiffViewInputs.map(singleDiffViewInput => renderSingleDiffView(singleDiffViewInput))}
109
+ </div>
110
+ `,
111
+ target);
112
+ // clang-format on
113
+ };
114
+
104
115
  export class CombinedDiffView extends UI.Widget.Widget {
105
116
  /**
106
117
  * Ignores urls that start with any in the list
@@ -113,19 +124,7 @@ export class CombinedDiffView extends UI.Widget.Widget {
113
124
  #copiedFiles: Record<string, boolean> = {};
114
125
  #view: View;
115
126
  #viewOutput: ViewOutput = {};
116
- constructor(element?: HTMLElement, view: View = (input, output, target) => {
117
- output.scrollToSelectedDiff = () => {
118
- target.querySelector('details.selected')?.scrollIntoView();
119
- };
120
-
121
- Lit.render(
122
- html`
123
- <div class="combined-diff-view">
124
- ${input.singleDiffViewInputs.map(singleDiffViewInput => renderSingleDiffView(singleDiffViewInput))}
125
- </div>
126
- `,
127
- target, {host: target});
128
- }) {
127
+ constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
129
128
  super(element);
130
129
  this.registerRequiredCSS(combinedDiffViewStyles);
131
130
  this.#view = view;
@@ -7,6 +7,7 @@ import * as Host from '../../core/host/host.js';
7
7
  import * as i18n from '../../core/i18n/i18n.js';
8
8
  import * as Badges from '../../models/badges/badges.js';
9
9
  import * as Buttons from '../../ui/components/buttons/buttons.js';
10
+ import * as uiI18n from '../../ui/i18n/i18n.js';
10
11
  import * as UI from '../../ui/legacy/legacy.js';
11
12
  import * as Lit from '../../ui/lit/lit.js';
12
13
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -63,7 +64,7 @@ const UIStrings = {
63
64
 
64
65
  const str_ = i18n.i18n.registerUIStrings('panels/common/BadgeNotification.ts', UIStrings);
65
66
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
66
- const i18nFormatString = i18n.i18n.getFormatLocalizedString.bind(undefined, str_);
67
+ const i18nFormatString = uiI18n.getFormatLocalizedString.bind(undefined, str_);
67
68
  const lockedString = i18n.i18n.lockedString;
68
69
 
69
70
  const LEFT_OFFSET = 5;
@@ -12,6 +12,7 @@ import * as Geometry from '../../models/geometry/geometry.js';
12
12
  import * as Buttons from '../../ui/components/buttons/buttons.js';
13
13
  import * as Snackbars from '../../ui/components/snackbars/snackbars.js';
14
14
  import type * as Switch from '../../ui/components/switch/switch.js';
15
+ import * as uiI18n from '../../ui/i18n/i18n.js';
15
16
  import * as UI from '../../ui/legacy/legacy.js';
16
17
  import {html, render} from '../../ui/lit/lit.js';
17
18
 
@@ -150,7 +151,7 @@ export const DEFAULT_VIEW: View = (input, _output, target): void => {
150
151
  <h2 class="section-title">${i18nString(UIStrings.tailorProfile)}</h2>
151
152
  <div class="section-text">
152
153
  <div>${i18nString(UIStrings.tailorProfileBody)}</div><br/>
153
- <div>${i18n.i18n.getFormatLocalizedString(str_, UIStrings.tailorProfileBodyDisclaimer, {
154
+ <div>${uiI18n.getFormatLocalizedString(str_, UIStrings.tailorProfileBodyDisclaimer, {
154
155
  PH1: UI.XLink.XLink.create(CONTENT_POLICY_URL, i18nString(UIStrings.contentPolicy), 'link', undefined, 'content-policy'),
155
156
  PH2: UI.XLink.XLink.create(TERMS_OF_SERVICE_URL, i18nString(UIStrings.termsOfService), 'link',
156
157
  undefined, 'terms-of-service'),
@@ -124,6 +124,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
124
124
  variant="rich"
125
125
  vertical-distance-increase=-6
126
126
  prefer-span-left
127
+ jslogContext="console-insight-teaser"
127
128
  >
128
129
  <div class="teaser-tooltip-container">
129
130
  ${input.isError ? html`
@@ -163,7 +164,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
163
164
  ${input.hasTellMeMoreButton ? html`
164
165
  <devtools-button
165
166
  title=${lockedString(UIStringsNotTranslate.tellMeMore)}
166
- .jslogContext=${'insights-teaser-tell-me-more'},
167
+ .jslogContext=${'insights-teaser-tell-me-more'}
167
168
  .variant=${Buttons.Button.Variant.PRIMARY}
168
169
  @click=${input.onTellMeMoreClick}
169
170
  >
@@ -177,7 +178,13 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
177
178
  aria-details=${'teaser-info-tooltip-' + input.uuid}
178
179
  .accessibleLabel=${lockedString(UIStringsNotTranslate.learnDataUsage)}
179
180
  ></devtools-button>
180
- <devtools-tooltip id=${'teaser-info-tooltip-' + input.uuid} variant="rich">
181
+ <devtools-tooltip
182
+ id=${'teaser-info-tooltip-' + input.uuid}
183
+ variant="rich"
184
+ jslogContext="teaser-info-tooltip"
185
+ trigger="both"
186
+ hover-delay=500
187
+ >
181
188
  <div class="info-tooltip-text">${lockedString(UIStringsNotTranslate.infoTooltipText)}</div>
182
189
  <div class="learn-more">
183
190
  <x-link
@@ -322,6 +329,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
322
329
  }
323
330
  if (this.#isGenerating) {
324
331
  this.#mainText = '';
332
+ Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationAborted);
325
333
  }
326
334
  this.#isGenerating = false;
327
335
  if (this.#timeoutId) {
@@ -345,6 +353,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
345
353
  async #generateTeaserText(): Promise<void> {
346
354
  this.#headerText = this.#consoleViewMessage.toMessageTextString().substring(0, 70);
347
355
  this.#isGenerating = true;
356
+ Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationStarted);
348
357
  this.#timeoutId = setTimeout(this.#setSlow.bind(this), SLOW_GENERATION_CUTOFF_MILLISECONDS);
349
358
  const startTime = performance.now();
350
359
  let teaserText = '';
@@ -359,6 +368,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
359
368
  if (err.name !== 'AbortError') {
360
369
  console.error(err.name, err.message);
361
370
  this.#isError = true;
371
+ Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationErrored);
362
372
  }
363
373
  this.#isGenerating = false;
364
374
  clearTimeout(this.#timeoutId);
@@ -370,6 +380,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
370
380
  Host.userMetrics.consoleInsightTeaserGenerated(performance.now() - startTime);
371
381
  this.#isGenerating = false;
372
382
  this.#mainText = teaserText;
383
+ Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserGenerationCompleted);
373
384
  this.requestUpdate();
374
385
  }
375
386
 
@@ -58,11 +58,13 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
58
58
 
59
59
  const elementToConsolePin = new WeakMap<Element, ConsolePin>();
60
60
 
61
- export class ConsolePinPane extends UI.ThrottledWidget.ThrottledWidget {
61
+ export class ConsolePinPane extends UI.Widget.VBox {
62
62
  private pins: Set<ConsolePin>;
63
63
  private readonly pinsSetting: Common.Settings.Setting<string[]>;
64
+ private readonly throttler: Common.Throttler.Throttler;
64
65
  constructor(private readonly liveExpressionButton: UI.Toolbar.ToolbarButton, private readonly focusOut: () => void) {
65
- super(true, 250);
66
+ super({useShadowDom: true});
67
+ this.throttler = new Common.Throttler.Throttler(250);
66
68
  this.registerRequiredCSS(consolePinPaneStyles, objectValueStyles);
67
69
  this.contentElement.classList.add('console-pins', 'monospace');
68
70
  this.contentElement.addEventListener('contextmenu', this.contextMenuEventFired.bind(this), false);
@@ -134,7 +136,7 @@ export class ConsolePinPane extends UI.ThrottledWidget.ThrottledWidget {
134
136
  if (userGesture) {
135
137
  void pin.focus();
136
138
  }
137
- this.update();
139
+ this.requestUpdate();
138
140
  }
139
141
 
140
142
  private focusedPinAfterDeletion(deletedPin: ConsolePin): ConsolePin|null {
@@ -153,16 +155,19 @@ export class ConsolePinPane extends UI.ThrottledWidget.ThrottledWidget {
153
155
  return null;
154
156
  }
155
157
 
156
- override async doUpdate(): Promise<void> {
158
+ override wasShown(): void {
159
+ super.wasShown();
160
+ void this.throttler.schedule(this.requestUpdate.bind(this));
161
+ }
162
+
163
+ override async performUpdate(): Promise<void> {
157
164
  if (!this.pins.size || !this.isShowing()) {
158
165
  return;
159
166
  }
160
- if (this.isShowing()) {
161
- this.update();
162
- }
163
167
  const updatePromises = Array.from(this.pins, pin => pin.updatePreview());
164
168
  await Promise.all(updatePromises);
165
169
  this.updatedForTest();
170
+ void this.throttler.schedule(this.requestUpdate.bind(this));
166
171
  }
167
172
 
168
173
  private updatedForTest(): void {
@@ -505,6 +505,7 @@ export class ConsoleView extends UI.Widget.VBox implements
505
505
 
506
506
  this.pinPane = new ConsolePinPane(liveExpressionButton, () => this.prompt.focus());
507
507
  this.pinPane.element.classList.add('console-view-pinpane');
508
+ this.pinPane.element.classList.remove('flex-auto');
508
509
  this.pinPane.show(this.contentsElement);
509
510
 
510
511
  this.viewport = new ConsoleViewport(this);
@@ -527,7 +527,6 @@
527
527
  }
528
528
 
529
529
  .console-view-pinpane {
530
- flex: none;
531
530
  max-height: 50%;
532
531
  }
533
532
 
@@ -117,22 +117,22 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
117
117
  // clang-format on
118
118
  };
119
119
 
120
- export class DeveloperResourcesView extends UI.ThrottledWidget.ThrottledWidget {
120
+ export class DeveloperResourcesView extends UI.Widget.VBox {
121
121
  readonly #loader: SDK.PageResourceLoader.PageResourceLoader;
122
122
  readonly #view: View;
123
123
  #selectedItem: SDK.PageResourceLoader.PageResource|null = null;
124
124
  #filters: TextUtils.TextUtils.ParsedFilter[] = [];
125
125
 
126
126
  constructor(view: View = DEFAULT_VIEW) {
127
- super(true);
127
+ super({useShadowDom: true});
128
128
  this.#view = view;
129
129
 
130
130
  this.#loader = SDK.PageResourceLoader.PageResourceLoader.instance();
131
- this.#loader.addEventListener(SDK.PageResourceLoader.Events.UPDATE, this.update, this);
132
- this.update();
131
+ this.#loader.addEventListener(SDK.PageResourceLoader.Events.UPDATE, this.requestUpdate, this);
132
+ this.requestUpdate();
133
133
  }
134
134
 
135
- override async doUpdate(): Promise<void> {
135
+ override async performUpdate(): Promise<void> {
136
136
  const {loading, resources} = this.#loader.getScopedNumberOfResources();
137
137
  const input = {
138
138
  onFilterChanged: (e: CustomEvent<string>) => {
@@ -152,13 +152,13 @@ export class DeveloperResourcesView extends UI.ThrottledWidget.ThrottledWidget {
152
152
  }
153
153
 
154
154
  async select(resource: SDK.PageResourceLoader.PageResource): Promise<void> {
155
- await this.lastUpdatePromise;
155
+ await this.updateComplete;
156
156
  this.#selectedItem = resource;
157
- this.update();
157
+ this.requestUpdate();
158
158
  }
159
159
 
160
160
  async selectedItem(): Promise<SDK.PageResourceLoader.PageResource|null> {
161
- await this.lastUpdatePromise;
161
+ await this.updateComplete;
162
162
  return this.#selectedItem;
163
163
  }
164
164
 
@@ -171,6 +171,6 @@ export class DeveloperResourcesView extends UI.ThrottledWidget.ThrottledWidget {
171
171
  } else {
172
172
  this.#filters = [];
173
173
  }
174
- this.update();
174
+ this.requestUpdate();
175
175
  }
176
176
  }
@@ -255,7 +255,7 @@ type ComputedStyleData = {
255
255
  name: string,
256
256
  };
257
257
 
258
- export class ComputedStyleWidget extends UI.ThrottledWidget.ThrottledWidget {
258
+ export class ComputedStyleWidget extends UI.Widget.VBox {
259
259
  private computedStyleModel: ComputedStyleModel;
260
260
  private readonly showInheritedComputedStylePropertiesSetting: Common.Settings.Setting<boolean>;
261
261
  private readonly groupComputedStylesSetting: Common.Settings.Setting<boolean>;
@@ -269,22 +269,22 @@ export class ComputedStyleWidget extends UI.ThrottledWidget.ThrottledWidget {
269
269
  #treeData?: TreeOutline.TreeOutline.TreeOutlineData<ComputedStyleData>;
270
270
 
271
271
  constructor(computedStyleModel: ComputedStyleModel) {
272
- super(true);
272
+ super({useShadowDom: true});
273
273
  this.registerRequiredCSS(computedStyleSidebarPaneStyles);
274
274
 
275
275
  this.contentElement.classList.add('styles-sidebar-computed-style-widget');
276
276
 
277
277
  this.computedStyleModel = computedStyleModel;
278
- this.computedStyleModel.addEventListener(Events.CSS_MODEL_CHANGED, this.update, this);
279
- this.computedStyleModel.addEventListener(Events.COMPUTED_STYLE_CHANGED, this.update, this);
278
+ this.computedStyleModel.addEventListener(Events.CSS_MODEL_CHANGED, this.requestUpdate, this);
279
+ this.computedStyleModel.addEventListener(Events.COMPUTED_STYLE_CHANGED, this.requestUpdate, this);
280
280
 
281
281
  this.showInheritedComputedStylePropertiesSetting =
282
282
  Common.Settings.Settings.instance().createSetting('show-inherited-computed-style-properties', false);
283
- this.showInheritedComputedStylePropertiesSetting.addChangeListener(this.update.bind(this));
283
+ this.showInheritedComputedStylePropertiesSetting.addChangeListener(this.requestUpdate.bind(this));
284
284
 
285
285
  this.groupComputedStylesSetting = Common.Settings.Settings.instance().createSetting('group-computed-styles', false);
286
286
  this.groupComputedStylesSetting.addChangeListener(() => {
287
- this.update();
287
+ this.requestUpdate();
288
288
  });
289
289
 
290
290
  const hbox = this.contentElement.createChild('div', 'hbox styles-sidebar-pane-toolbar');
@@ -334,7 +334,7 @@ export class ComputedStyleWidget extends UI.ThrottledWidget.ThrottledWidget {
334
334
  UI.Context.Context.instance().setFlavor(ComputedStyleWidget, null);
335
335
  }
336
336
 
337
- override async doUpdate(): Promise<void> {
337
+ override async performUpdate(): Promise<void> {
338
338
  const [nodeStyles, matchedStyles] =
339
339
  await Promise.all([this.computedStyleModel.fetchComputedStyle(), this.fetchMatchedCascade()]);
340
340
  if (!nodeStyles || !matchedStyles) {
@@ -422,7 +422,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
422
422
  if (domModel.parentModel()) {
423
423
  continue;
424
424
  }
425
- if (!this.rootDOMNode) {
425
+ if (!this.rootDOMNode || this.rootDOMNode.domModel() !== domModel) {
426
426
  if (domModel.existingDocument()) {
427
427
  this.rootDOMNode = domModel.existingDocument();
428
428
  this.onDocumentUpdated(domModel);
@@ -135,7 +135,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
135
135
  // clang-format on
136
136
  };
137
137
 
138
- export class EventListenersWidget extends UI.ThrottledWidget.ThrottledWidget {
138
+ export class EventListenersWidget extends UI.Widget.VBox {
139
139
  private showForAncestorsSetting: Common.Settings.Setting<boolean>;
140
140
  private readonly dispatchFilterBySetting: Common.Settings.Setting<string>;
141
141
  private readonly showFrameworkListenersSetting: Common.Settings.Setting<boolean>;
@@ -147,19 +147,19 @@ export class EventListenersWidget extends UI.ThrottledWidget.ThrottledWidget {
147
147
  this.#view = view;
148
148
  this.showForAncestorsSetting =
149
149
  Common.Settings.Settings.instance().moduleSetting('show-event-listeners-for-ancestors');
150
- this.showForAncestorsSetting.addChangeListener(this.update.bind(this));
150
+ this.showForAncestorsSetting.addChangeListener(this.requestUpdate.bind(this));
151
151
 
152
152
  this.dispatchFilterBySetting =
153
153
  Common.Settings.Settings.instance().createSetting('event-listener-dispatch-filter-type', DispatchFilterBy.All);
154
- this.dispatchFilterBySetting.addChangeListener(this.update.bind(this));
154
+ this.dispatchFilterBySetting.addChangeListener(this.requestUpdate.bind(this));
155
155
 
156
156
  this.showFrameworkListenersSetting =
157
157
  Common.Settings.Settings.instance().createSetting('show-frameowkr-listeners', true);
158
158
  this.showFrameworkListenersSetting.setTitle(i18nString(UIStrings.frameworkListeners));
159
- this.showFrameworkListenersSetting.addChangeListener(this.update.bind(this));
159
+ this.showFrameworkListenersSetting.addChangeListener(this.requestUpdate.bind(this));
160
160
 
161
- UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, this.update, this);
162
- this.update();
161
+ UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, this.requestUpdate.bind(this));
162
+ this.requestUpdate();
163
163
  }
164
164
 
165
165
  static instance(opts: {
@@ -173,7 +173,7 @@ export class EventListenersWidget extends UI.ThrottledWidget.ThrottledWidget {
173
173
  return eventListenersWidgetInstance;
174
174
  }
175
175
 
176
- override async doUpdate(): Promise<void> {
176
+ override async performUpdate(): Promise<void> {
177
177
  const dispatchFilter = this.dispatchFilterBySetting.get();
178
178
  const showPassive = dispatchFilter === DispatchFilterBy.All || dispatchFilter === DispatchFilterBy.Passive;
179
179
  const showBlocking = dispatchFilter === DispatchFilterBy.All || dispatchFilter === DispatchFilterBy.Blocking;
@@ -186,7 +186,7 @@ export class EventListenersWidget extends UI.ThrottledWidget.ThrottledWidget {
186
186
  onDispatchFilterTypeChange: (value: string) => {
187
187
  this.dispatchFilterBySetting.set(value);
188
188
  },
189
- onEventListenersViewChange: this.update.bind(this),
189
+ onEventListenersViewChange: this.requestUpdate.bind(this),
190
190
  dispatchFilters: [
191
191
  {name: i18nString(UIStrings.all), value: DispatchFilterBy.All},
192
192
  {name: i18nString(UIStrings.passive), value: DispatchFilterBy.Passive},
@@ -279,7 +279,7 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
279
279
  handleAction(_context: UI.Context.Context, actionId: string): boolean {
280
280
  switch (actionId) {
281
281
  case 'elements.refresh-event-listeners': {
282
- EventListenersWidget.instance().update();
282
+ EventListenersWidget.instance().requestUpdate();
283
283
  return true;
284
284
  }
285
285
  }
@@ -42,27 +42,27 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
42
42
  // clang-format on
43
43
  };
44
44
 
45
- export class NodeStackTraceWidget extends UI.ThrottledWidget.ThrottledWidget {
45
+ export class NodeStackTraceWidget extends UI.Widget.VBox {
46
46
  readonly #linkifier = new Components.Linkifier.Linkifier(MaxLengthForLinks);
47
47
  readonly #view: View;
48
48
 
49
49
  constructor(view = DEFAULT_VIEW) {
50
- super(true /* isWebComponent */);
50
+ super({useShadowDom: true});
51
51
  this.#view = view;
52
52
  }
53
53
 
54
54
  override wasShown(): void {
55
55
  super.wasShown();
56
- UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, this.update, this);
57
- this.update();
56
+ UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, this.requestUpdate, this);
57
+ this.requestUpdate();
58
58
  }
59
59
 
60
60
  override willHide(): void {
61
61
  super.willHide();
62
- UI.Context.Context.instance().removeFlavorChangeListener(SDK.DOMModel.DOMNode, this.update, this);
62
+ UI.Context.Context.instance().removeFlavorChangeListener(SDK.DOMModel.DOMNode, this.requestUpdate, this);
63
63
  }
64
64
 
65
- override async doUpdate(): Promise<void> {
65
+ override async performUpdate(): Promise<void> {
66
66
  const node = UI.Context.Context.instance().flavor(SDK.DOMModel.DOMNode);
67
67
 
68
68
  const stackTrace = await node?.creationStackTrace() ?? undefined;
@@ -77,21 +77,21 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
77
77
  // clang-format on
78
78
  };
79
79
 
80
- export class PlatformFontsWidget extends UI.ThrottledWidget.ThrottledWidget {
80
+ export class PlatformFontsWidget extends UI.Widget.VBox {
81
81
  private readonly sharedModel: ComputedStyleModel;
82
82
  readonly #view: View;
83
83
 
84
84
  constructor(sharedModel: ComputedStyleModel, view: View = DEFAULT_VIEW) {
85
- super(true);
85
+ super({useShadowDom: true});
86
86
  this.#view = view;
87
87
  this.registerRequiredCSS(platformFontsWidgetStyles);
88
88
 
89
89
  this.sharedModel = sharedModel;
90
- this.sharedModel.addEventListener(ComputedStyleModelEvents.CSS_MODEL_CHANGED, this.update, this);
91
- this.sharedModel.addEventListener(ComputedStyleModelEvents.COMPUTED_STYLE_CHANGED, this.update, this);
90
+ this.sharedModel.addEventListener(ComputedStyleModelEvents.CSS_MODEL_CHANGED, this.requestUpdate, this);
91
+ this.sharedModel.addEventListener(ComputedStyleModelEvents.COMPUTED_STYLE_CHANGED, this.requestUpdate, this);
92
92
  }
93
93
 
94
- override async doUpdate(): Promise<void> {
94
+ override async performUpdate(): Promise<void> {
95
95
  const cssModel = this.sharedModel.cssModel();
96
96
  const node = this.sharedModel.node();
97
97
  if (!node || !cssModel) {
@@ -103,7 +103,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
103
103
  const getShowAllPropertiesSetting = (): Common.Settings.Setting<boolean> =>
104
104
  Common.Settings.Settings.instance().createSetting('show-all-properties', /* defaultValue */ false);
105
105
 
106
- export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
106
+ export class PropertiesWidget extends UI.Widget.VBox {
107
107
  private node: SDK.DOMModel.DOMNode|null;
108
108
  private readonly showAllPropertiesSetting: Common.Settings.Setting<boolean>;
109
109
  private filterRegex: RegExp|null = null;
@@ -112,8 +112,8 @@ export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
112
112
  readonly #view: View;
113
113
  #displayNoMatchingPropertyMessage = false;
114
114
 
115
- constructor(throttlingTimeout?: number, view: View = DEFAULT_VIEW) {
116
- super(true /* isWebComponent */, throttlingTimeout);
115
+ constructor(view: View = DEFAULT_VIEW) {
116
+ super({useShadowDom: true});
117
117
  this.registerRequiredCSS(propertiesWidgetStyles);
118
118
 
119
119
  this.showAllPropertiesSetting = getShowAllPropertiesSetting();
@@ -138,7 +138,7 @@ export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
138
138
  Host.userMetrics.actionTaken(Host.UserMetrics.Action.DOMPropertiesExpanded);
139
139
  });
140
140
 
141
- void this.doUpdate();
141
+ void this.performUpdate();
142
142
  }
143
143
 
144
144
  private onFilterChanged(event: CustomEvent<string>): void {
@@ -150,7 +150,7 @@ export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
150
150
  const previousDisplay = this.#displayNoMatchingPropertyMessage;
151
151
  this.internalFilterProperties();
152
152
  if (previousDisplay !== this.#displayNoMatchingPropertyMessage) {
153
- this.update();
153
+ this.requestUpdate();
154
154
  }
155
155
  }
156
156
 
@@ -169,10 +169,10 @@ export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
169
169
 
170
170
  private setNode(event: Common.EventTarget.EventTargetEvent<SDK.DOMModel.DOMNode|null>): void {
171
171
  this.node = event.data;
172
- this.update();
172
+ this.requestUpdate();
173
173
  }
174
174
 
175
- override async doUpdate(): Promise<void> {
175
+ override async performUpdate(): Promise<void> {
176
176
  if (this.lastRequestedNode) {
177
177
  this.lastRequestedNode.domModel().runtimeModel().releaseObjectGroup(OBJECT_GROUP_NAME);
178
178
  delete this.lastRequestedNode;
@@ -218,6 +218,6 @@ export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
218
218
  if (this.node !== node) {
219
219
  return;
220
220
  }
221
- this.update();
221
+ this.requestUpdate();
222
222
  }
223
223
  }
@@ -10,6 +10,7 @@ import * as Platform from '../../core/platform/platform.js';
10
10
  import type * as SDK from '../../core/sdk/sdk.js';
11
11
  import type * as Protocol from '../../generated/protocol.js';
12
12
  import * as Geometry from '../../models/geometry/geometry.js';
13
+ import * as uiI18n from '../../ui/i18n/i18n.js';
13
14
  import * as UI from '../../ui/legacy/legacy.js';
14
15
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
15
16
 
@@ -772,7 +773,7 @@ export class Layers3DView extends Common.ObjectWrapper.eventMixin<EventTypes, ty
772
773
  private webglDisabledBanner(): UI.EmptyWidget.EmptyWidget {
773
774
  const emptyWidget = new UI.EmptyWidget.EmptyWidget(
774
775
  i18nString(UIStrings.cantDisplayLayers), i18nString(UIStrings.webglSupportIsDisabledInYour));
775
- emptyWidget.contentElement.appendChild(i18n.i18n.getFormatLocalizedString(
776
+ emptyWidget.contentElement.appendChild(uiI18n.getFormatLocalizedString(
776
777
  str_, UIStrings.checkSForPossibleReasons,
777
778
  {PH1: UI.XLink.XLink.create('about:gpu', undefined, undefined, undefined, 'about-gpu')}));
778
779
  return emptyWidget;