chrome-devtools-frontend 1.0.1690116 → 1.0.1690531

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 (146) hide show
  1. package/.gitmodules +4 -0
  2. package/front_end/core/root/Runtime.ts +1 -0
  3. package/front_end/core/sdk/NetworkRequest.ts +50 -4
  4. package/front_end/core/sdk/NetworkRequestAccess.ts +172 -0
  5. package/front_end/core/sdk/SecurityOrigin.ts +25 -0
  6. package/front_end/core/sdk/sdk.ts +2 -0
  7. package/front_end/generated/SupportedCSSProperties.ts +1 -1
  8. package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
  9. package/front_end/models/ai_assistance/AiConversation.ts +29 -18
  10. package/front_end/panels/ai_assistance/components/chatMessage.css +3 -1
  11. package/front_end/panels/application/components/BackForwardCacheView.ts +1 -1
  12. package/front_end/panels/application/components/EndpointsGrid.ts +2 -1
  13. package/front_end/panels/application/components/PermissionsPolicySection.ts +1 -1
  14. package/front_end/panels/application/components/ServiceWorkerRouterView.ts +1 -1
  15. package/front_end/panels/application/components/TrustTokensView.ts +1 -1
  16. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
  17. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -1
  18. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
  19. package/front_end/panels/common/CPUThrottlingOption.ts +12 -6
  20. package/front_end/panels/common/DOMLinkifier.ts +1 -1
  21. package/front_end/panels/common/ExtensionView.ts +2 -1
  22. package/front_end/panels/console/ConsolePinPane.ts +4 -2
  23. package/front_end/panels/console/ConsoleSidebar.ts +6 -2
  24. package/front_end/panels/console/PromptBuilder.ts +1 -1
  25. package/front_end/panels/coverage/CoverageListView.ts +1 -1
  26. package/front_end/panels/coverage/CoverageModel.ts +6 -4
  27. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +9 -9
  28. package/front_end/panels/css_overview/CSSOverviewPanel.ts +3 -3
  29. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
  30. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +3 -3
  31. package/front_end/panels/css_overview/CSSOverviewStartView.ts +3 -3
  32. package/front_end/panels/developer_resources/DeveloperResourcesListView.ts +1 -1
  33. package/front_end/panels/elements/ComputedStyleWidget.ts +1 -1
  34. package/front_end/panels/elements/ElementsTreeElement.ts +4 -3
  35. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  36. package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
  37. package/front_end/panels/elements/PropertyNameCategories.ts +1 -1
  38. package/front_end/panels/elements/ShortcutTreeElement.ts +2 -1
  39. package/front_end/panels/elements/StandaloneStylesContainer.ts +1 -1
  40. package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
  41. package/front_end/panels/elements/StylesSidebarPane.ts +3 -2
  42. package/front_end/panels/elements/components/StylePropertyEditor.ts +160 -148
  43. package/front_end/panels/emulation/MediaQueryInspector.ts +2 -1
  44. package/front_end/panels/issues/AffectedLazyLoadImagesView.ts +1 -1
  45. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +2 -2
  46. package/front_end/panels/linear_memory_inspector/components/linearMemoryNavigator.css +1 -1
  47. package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +5 -5
  48. package/front_end/panels/linear_memory_inspector/components/linearMemoryViewer.css +6 -6
  49. package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +6 -6
  50. package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +2 -2
  51. package/front_end/panels/network/NetworkDataGridNode.ts +11 -9
  52. package/front_end/panels/network/NetworkLogView.ts +4 -1
  53. package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
  54. package/front_end/panels/network/RequestHeadersView.ts +1 -1
  55. package/front_end/panels/network/RequestPayloadView.ts +1 -1
  56. package/front_end/panels/network/RequestResponseView.ts +1 -1
  57. package/front_end/panels/network/RequestTimingView.ts +1 -1
  58. package/front_end/panels/network/ShowMoreDetailsWidget.ts +1 -1
  59. package/front_end/panels/network/components/ResponseHeaderSection.ts +1 -1
  60. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
  61. package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
  62. package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -6
  63. package/front_end/panels/sources/ProfilePlugin.ts +2 -1
  64. package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
  65. package/front_end/panels/timeline/IsolateSelector.ts +1 -1
  66. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +1 -1
  67. package/front_end/panels/timeline/NetworkTrackAppender.ts +1 -1
  68. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
  69. package/front_end/panels/timeline/TimelineHistoryManager.ts +1 -1
  70. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +7 -3
  71. package/front_end/panels/timeline/TimelinePanel.ts +3 -3
  72. package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
  73. package/front_end/panels/timeline/TimelineUIUtils.ts +4 -4
  74. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +4 -3
  75. package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
  76. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +25 -24
  77. package/front_end/panels/timeline/components/RelatedInsightChips.ts +4 -3
  78. package/front_end/panels/timeline/components/Sidebar.ts +1 -1
  79. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +4 -3
  80. package/front_end/panels/timeline/utils/Helpers.ts +1 -1
  81. package/front_end/panels/timeline/utils/ImageCache.ts +5 -3
  82. package/front_end/panels/web_audio/WebAudioView.ts +3 -3
  83. package/front_end/panels/webauthn/WebauthnPane.ts +5 -11
  84. package/front_end/third_party/acorn/acorn.ts +3 -3
  85. package/front_end/third_party/chromium/README.chromium +1 -1
  86. package/front_end/third_party/chromium/ahem/ahem.d.ts +1 -0
  87. package/front_end/third_party/csp_evaluator/package/csp.ts +4 -4
  88. package/front_end/third_party/csp_evaluator/package/parser.ts +3 -1
  89. package/front_end/third_party/csp_evaluator/package/utils.ts +1 -1
  90. package/front_end/third_party/diff/diff_match_patch.d.ts +10 -0
  91. package/front_end/third_party/json5/json5.ts +2 -2
  92. package/front_end/ui/components/buttons/floatingButton.css +25 -0
  93. package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
  94. package/front_end/ui/components/suggestion_input/SuggestionInput.ts +45 -25
  95. package/front_end/ui/legacy/ContextMenu.ts +2 -2
  96. package/front_end/ui/legacy/DropTarget.ts +6 -1
  97. package/front_end/ui/legacy/EmptyWidget.ts +1 -1
  98. package/front_end/ui/legacy/GlassPane.ts +1 -1
  99. package/front_end/ui/legacy/ShortcutRegistry.ts +2 -2
  100. package/front_end/ui/legacy/SplitWidget.ts +2 -1
  101. package/front_end/ui/legacy/StackedPane.ts +1 -1
  102. package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -1
  103. package/front_end/ui/legacy/TextPrompt.ts +2 -1
  104. package/front_end/ui/legacy/Toolbar.ts +1 -1
  105. package/front_end/ui/legacy/Treeoutline.ts +13 -37
  106. package/front_end/ui/legacy/UIUtils.ts +6 -3
  107. package/front_end/ui/legacy/ViewManager.ts +1 -1
  108. package/front_end/ui/legacy/Widget.ts +1 -1
  109. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +7 -1
  110. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
  111. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +3 -2
  112. package/front_end/ui/legacy/components/inline_editor/AnimationTimingModel.ts +1 -1
  113. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +48 -44
  114. package/front_end/ui/legacy/components/inline_editor/CSSAngleUtils.ts +1 -1
  115. package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +141 -106
  116. package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +1 -1
  117. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -10
  118. package/front_end/ui/legacy/components/perf_ui/pieChart.css +7 -5
  119. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +8 -5
  120. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +1 -1
  121. package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -5
  122. package/front_end/ui/legacy/inspectorCommon.css +11 -0
  123. package/front_end/ui/visual_logging/Debugging.ts +2 -1
  124. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -1
  125. package/front_end/ui/visual_logging/LoggingDriver.ts +3 -3
  126. package/front_end/ui/visual_logging/LoggingEvents.ts +5 -5
  127. package/front_end/ui/visual_logging/LoggingState.ts +1 -1
  128. package/front_end/ui/visual_logging/visual_logging.ts +67 -56
  129. package/package.json +2 -1
  130. package/front_end/third_party/acorn/acorn-tsconfig.json +0 -12
  131. package/front_end/third_party/acorn/estree-tsconfig.json +0 -8
  132. package/front_end/third_party/chromium/client-variations/client-variations-tsconfig.json +0 -8
  133. package/front_end/third_party/codemirror/codemirror-legacy-types-tsconfig.json +0 -8
  134. package/front_end/third_party/codemirror/codemirror-tsconfig.json +0 -15
  135. package/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
  136. package/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
  137. package/front_end/third_party/json5/json5-tsconfig.json +0 -8
  138. package/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
  139. package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +0 -11
  140. package/front_end/third_party/lighthouse/report/bundle-tsconfig.json +0 -8
  141. package/front_end/third_party/lit/lit-tsconfig.json +0 -15
  142. package/front_end/third_party/marked/marked-tsconfig.json +0 -8
  143. package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +0 -191
  144. package/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
  145. package/front_end/third_party/wasmparser/wasmparser-tsconfig.json +0 -9
  146. package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +0 -47
@@ -59,7 +59,7 @@ export const enum SidebarTabs {
59
59
  INSIGHTS = 'insights',
60
60
  ANNOTATIONS = 'annotations',
61
61
  }
62
- export const DEFAULT_SIDEBAR_TAB = SidebarTabs.INSIGHTS;
62
+ export const DEFAULT_SIDEBAR_TAB: SidebarTabs = SidebarTabs.INSIGHTS;
63
63
 
64
64
  export const DEFAULT_SIDEBAR_WIDTH_PX = 240;
65
65
  const MIN_SIDEBAR_WIDTH_PX = 170;
@@ -100,6 +100,7 @@ export interface SidebarAnnotationsTabViewInput {
100
100
  onAnnotationHoverOut: () => void;
101
101
  onAnnotationDelete: (annotation: Trace.Types.File.Annotation) => void;
102
102
  }
103
+ export type View = (input: SidebarAnnotationsTabViewInput, output: object, target: HTMLElement) => void;
103
104
 
104
105
  export class SidebarAnnotationsTab extends UI.Widget.Widget {
105
106
  #annotations: Trace.Types.File.Annotation[] = [];
@@ -108,9 +109,9 @@ export class SidebarAnnotationsTab extends UI.Widget.Widget {
108
109
  #annotationEntryToColorMap = new Map<Trace.Types.Events.Event|Trace.Types.Events.LegacyTimelineFrame, string>();
109
110
 
110
111
  readonly #annotationsHiddenSetting: Common.Settings.Setting<boolean>;
111
- #view: typeof DEFAULT_VIEW;
112
+ #view: View;
112
113
 
113
- constructor(view = DEFAULT_VIEW) {
114
+ constructor(view: View = DEFAULT_VIEW) {
114
115
  super();
115
116
  this.#view = view;
116
117
  this.#annotationsHiddenSetting = Common.Settings.Settings.instance().moduleSetting('annotations-hidden');
@@ -406,7 +407,7 @@ function renderTutorial(): Lit.LitTemplate {
406
407
  // clang-format on
407
408
  }
408
409
 
409
- export const DEFAULT_VIEW: (input: SidebarAnnotationsTabViewInput, output: object, target: HTMLElement) => void =
410
+ export const DEFAULT_VIEW: View =
410
411
  (input, _output, target) => {
411
412
  // clang-format off
412
413
  render(html`
@@ -138,6 +138,6 @@ export class RevealableTimeRange {
138
138
  }
139
139
 
140
140
  export class RevealableBottomUpProfile {
141
- constructor(public bounds: Trace.Types.Timing.TraceWindowMicro, public node?: Trace.Extras.TraceTree.Node) {
141
+ constructor(public bounds: Trace.Types.Timing.TraceWindowMicro, public node?: Trace.Extras.TraceTree.Node|undefined) {
142
142
  }
143
143
  }
@@ -6,7 +6,7 @@ import * as Trace from '../../../models/trace/trace.js';
6
6
 
7
7
  const imageCache =
8
8
  new WeakMap<Trace.Types.Events.LegacySyntheticScreenshot|Trace.Types.Events.Screenshot, HTMLImageElement|null>();
9
- export const emitter = new EventTarget();
9
+ export const emitter: EventTarget = new EventTarget();
10
10
 
11
11
  /**
12
12
  * Synchronously returns an image, or return `null` while queuing up an async load of that image.
@@ -55,5 +55,7 @@ export function preload(screenshots: Array<Trace.Types.Events.LegacySyntheticScr
55
55
  return Promise.all(promises);
56
56
  }
57
57
 
58
- export const cacheForTesting = imageCache;
59
- export const loadImageForTesting = loadImage;
58
+ export const cacheForTesting:
59
+ WeakMap<Trace.Types.Events.LegacySyntheticScreenshot|Trace.Types.Events.Screenshot, HTMLImageElement|null> =
60
+ imageCache;
61
+ export const loadImageForTesting: typeof loadImage = loadImage;
@@ -76,14 +76,14 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
76
76
  const WEBAUDIO_EXPLANATION_URL =
77
77
  'https://developer.chrome.com/docs/devtools/webaudio' as Platform.DevToolsPath.UrlString;
78
78
 
79
- interface ViewInput {
79
+ export interface ViewInput {
80
80
  contexts: Protocol.WebAudio.BaseAudioContext[];
81
81
  selectedContextIndex: number;
82
82
  onContextSelectorSelectionChanged: (contextId: string) => void;
83
83
  contextRealtimeData: Protocol.WebAudio.ContextRealtimeData|null;
84
84
  }
85
85
 
86
- type View = (input: ViewInput, output: object, target: HTMLElement|DocumentFragment) => void;
86
+ export type View = (input: ViewInput, output: object, target: HTMLElement|DocumentFragment) => void;
87
87
 
88
88
  export const DEFAULT_VIEW: View = (input, _output, target) => {
89
89
  const {
@@ -189,7 +189,7 @@ export class WebAudioView extends UI.Widget.VBox<ShadowRoot> implements
189
189
  private selectedContextIndex = -1;
190
190
  private readonly pollRealtimeDataThrottler: Common.Throttler.Throttler;
191
191
 
192
- constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
192
+ constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
193
193
  super({useShadowDom: 'pure'});
194
194
  this.view = view;
195
195
 
@@ -240,19 +240,13 @@ const PROTOCOL_AUTHENTICATOR_VALUES: Protocol.EnumerableEnum<typeof Protocol.Web
240
240
  U2f: Protocol.WebAuthn.AuthenticatorProtocol.U2f,
241
241
  };
242
242
 
243
- interface Authenticator {
243
+ export interface Authenticator {
244
244
  name: string;
245
245
  options: Protocol.WebAuthn.VirtualAuthenticatorOptions;
246
246
  credentials: Protocol.WebAuthn.Credential[];
247
247
  }
248
248
 
249
- interface Authenticator {
250
- name: string;
251
- options: Protocol.WebAuthn.VirtualAuthenticatorOptions;
252
- credentials: Protocol.WebAuthn.Credential[];
253
- }
254
-
255
- interface ViewInput {
249
+ export interface ViewInput {
256
250
  enabled: boolean;
257
251
  onToggleEnabled: () => void;
258
252
  authenticators: Map<Protocol.WebAuthn.AuthenticatorId, Authenticator>;
@@ -270,11 +264,11 @@ interface ViewInput {
270
264
  onRemoveCredential: (id: Protocol.WebAuthn.AuthenticatorId, credentialId: string) => void;
271
265
  }
272
266
 
273
- interface ViewOutput {
267
+ export interface ViewOutput {
274
268
  revealSection: Map<string, () => void>;
275
269
  }
276
270
 
277
- type ViewFunction = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
271
+ export type ViewFunction = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
278
272
 
279
273
  function renderToolbar(enabled: boolean, onToggle: () => void): Lit.TemplateResult {
280
274
  const enableCheckboxTitle = i18nString(UIStrings.enableVirtualAuthenticator);
@@ -629,7 +623,7 @@ export class WebauthnPaneImpl extends UI.Panel.Panel implements
629
623
  revealSection: new Map(),
630
624
  };
631
625
 
632
- constructor(view = DEFAULT_VIEW) {
626
+ constructor(view: ViewFunction = DEFAULT_VIEW) {
633
627
  super('webauthn');
634
628
 
635
629
  this.#view = view;
@@ -9,6 +9,6 @@ export {ESTree};
9
9
 
10
10
  export { type Comment, defaultOptions, getLineInfo, Node, SourceLocation, Token, tokTypes} from './package/dist/acorn.mjs';
11
11
 
12
- export const Parser = acorn.Parser;
13
- export const tokenizer = acorn.Parser.tokenizer.bind(acorn.Parser);
14
- export const parse = acorn.Parser.parse.bind(acorn.Parser);
12
+ export const Parser: typeof acorn.Parser = acorn.Parser;
13
+ export const tokenizer: typeof acorn.Parser.tokenizer = acorn.Parser.tokenizer.bind(acorn.Parser);
14
+ export const parse: typeof acorn.Parser.parse = acorn.Parser.parse.bind(acorn.Parser);
@@ -1,7 +1,7 @@
1
1
  Name: Dependencies sourced from the upstream `chromium` repository
2
2
  URL: Internal
3
3
  Version: N/A
4
- Revision: c7a932d772cd4948f6199ee2b70c5e149ef4b357
4
+ Revision: e8d7f556806fab69401893b125dee4b6e6ded695
5
5
  Update Mechanism: Manual (https://crbug.com/428069060)
6
6
  License: BSD-3-Clause
7
7
  License File: LICENSE
@@ -0,0 +1 @@
1
+ export {};
@@ -343,12 +343,12 @@ export function isUrlScheme(urlScheme: string): boolean {
343
343
  /**
344
344
  * A regex pattern to check nonce prefix and Base64 formatting of a nonce value.
345
345
  */
346
- export const STRICT_NONCE_PATTERN =
346
+ export const STRICT_NONCE_PATTERN: RegExp =
347
347
  new RegExp('^\'nonce-[a-zA-Z0-9+/_-]+[=]{0,2}\'$');
348
348
 
349
349
 
350
350
  /** A regex pattern for checking if nonce prefix. */
351
- export const NONCE_PATTERN = new RegExp('^\'nonce-(.+)\'$');
351
+ export const NONCE_PATTERN: RegExp = new RegExp('^\'nonce-(.+)\'$');
352
352
 
353
353
 
354
354
  /**
@@ -367,12 +367,12 @@ export function isNonce(nonce: string, strictCheck?: boolean): boolean {
367
367
  /**
368
368
  * A regex pattern to check hash prefix and Base64 formatting of a hash value.
369
369
  */
370
- export const STRICT_HASH_PATTERN =
370
+ export const STRICT_HASH_PATTERN: RegExp =
371
371
  new RegExp('^\'(sha256|sha384|sha512)-[a-zA-Z0-9+/]+[=]{0,2}\'$');
372
372
 
373
373
 
374
374
  /** A regex pattern to check hash prefix. */
375
- export const HASH_PATTERN = new RegExp('^\'(sha256|sha384|sha512)-(.+)\'$');
375
+ export const HASH_PATTERN: RegExp = new RegExp('^\'(sha256|sha384|sha512)-(.+)\'$');
376
376
 
377
377
 
378
378
  /**
@@ -97,4 +97,6 @@ function normalizeDirectiveValue(directiveValue: string): string {
97
97
  return directiveValue;
98
98
  }
99
99
 
100
- export const TEST_ONLY = {normalizeDirectiveValue};
100
+ export const TEST_ONLY: {
101
+ normalizeDirectiveValue: typeof normalizeDirectiveValue,
102
+ } = {normalizeDirectiveValue};
@@ -136,7 +136,7 @@ export function matchWildcardUrls(
136
136
  export function applyCheckFunktionToDirectives(
137
137
  parsedCsp: csp.Csp,
138
138
  check: (directive: string, directiveValues: string[]) => void,
139
- ) {
139
+ ): void {
140
140
  const directiveNames = Object.keys(parsedCsp.directives);
141
141
 
142
142
  for (const directive of directiveNames) {
@@ -0,0 +1,10 @@
1
+ // Copyright 2026 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ /* eslint-disable @typescript-eslint/naming-convention */
6
+ declare class diff_match_patch {
7
+ diff_main(text1: string, text2: string): Array<{0: number, 1: string}>;
8
+ diff_cleanupSemantic(diff: Array<{0: number, 1: string}>): void;
9
+ }
10
+ /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,4 +1,4 @@
1
1
  import JSON5 from './lib/index.js';
2
2
 
3
- export const parse = JSON5.parse;
4
- export const stringify = JSON5.stringify;
3
+ export const parse: typeof JSON5.parse = JSON5.parse;
4
+ export const stringify: typeof JSON5.stringify = JSON5.stringify;
@@ -116,3 +116,28 @@ button {
116
116
  color: var(--ref-palette-neutral100) !important; /* stylelint-disable-line declaration-no-important */
117
117
  }
118
118
  }
119
+
120
+ @media (forced-colors: active) {
121
+ button {
122
+ forced-color-adjust: none;
123
+ box-shadow: 0 0 0 var(--sys-size-1) ButtonText;
124
+
125
+ :host-context(:not(.theme-with-dark-background)) &,
126
+ :host-context(.theme-with-dark-background) &:not(:disabled) {
127
+ background-color: ButtonFace;
128
+ }
129
+
130
+ :host-context(:not(.theme-with-dark-background)) &:not(:disabled) > devtools-icon,
131
+ :host-context(.theme-with-dark-background) &:not(:disabled) > devtools-icon {
132
+ color: ButtonText;
133
+ }
134
+
135
+ &:focus-visible {
136
+ outline-color: ButtonText;
137
+ }
138
+
139
+ &:disabled > devtools-icon {
140
+ color: GrayText;
141
+ }
142
+ }
143
+ }
@@ -9,7 +9,7 @@ import {html, render} from '../../../ui/lit/lit.js';
9
9
 
10
10
  import srgbOverlayStyles from './srgbOverlay.css.js';
11
11
 
12
- interface SrgbOverlayProps {
12
+ export interface SrgbOverlayProps {
13
13
  // [0 - 1] corresponding to HSV hue
14
14
  hue: number;
15
15
  width: number;
@@ -22,8 +22,7 @@ function assert<T>(
22
22
  }
23
23
  }
24
24
 
25
- const {html, Decorators, Directives, LitElement} = Lit;
26
- const {customElement, property, state} = Decorators;
25
+ const {html, Directives} = Lit;
27
26
  const {classMap} = Directives;
28
27
 
29
28
  declare global {
@@ -41,7 +40,6 @@ const jsonPropertyOptions = {
41
40
  attribute: false,
42
41
  };
43
42
 
44
- @customElement('devtools-editable-content')
45
43
  class EditableContent extends HTMLElement {
46
44
  static get observedAttributes(): string[] {
47
45
  return ['disabled', 'placeholder'];
@@ -127,7 +125,7 @@ class SuggestionInitEvent extends Event {
127
125
  }
128
126
  }
129
127
 
130
- type SuggestionFilter = (option: string, query: string) => boolean;
128
+ export type SuggestionFilter = (option: string, query: string) => boolean;
131
129
 
132
130
  const defaultSuggestionFilter = (option: string, query: string): boolean =>
133
131
  option.toLowerCase().startsWith(query.toLowerCase());
@@ -136,13 +134,19 @@ const defaultSuggestionFilter = (option: string, query: string): boolean =>
136
134
  * @fires SuggestionInitEvent#suggestioninit
137
135
  * @fires SuggestEvent#suggest
138
136
  */
139
- @customElement('devtools-suggestion-box')
140
- class SuggestionBox extends LitElement {
141
- @property(jsonPropertyOptions) declare options: readonly string[];
142
- @property() declare expression: string;
143
- @property() declare suggestionFilter?: SuggestionFilter;
137
+ class SuggestionBox extends Lit.LitElement {
138
+ static override properties: typeof Lit.LitElement.properties = {
139
+ options: jsonPropertyOptions,
140
+ expression: {type: String},
141
+ suggestionFilter: {attribute: false},
142
+ cursor: {state: true},
143
+ };
144
+
145
+ declare options: readonly string[];
146
+ declare expression: string;
147
+ declare suggestionFilter?: SuggestionFilter;
144
148
 
145
- @state() private declare cursor: number;
149
+ private declare cursor: number;
146
150
 
147
151
  #suggestions: string[] = [];
148
152
 
@@ -229,30 +233,42 @@ class SuggestionBox extends LitElement {
229
233
  }
230
234
  }
231
235
 
232
- @customElement('devtools-suggestion-input')
233
- export class SuggestionInput extends LitElement {
234
- static override shadowRootOptions = {
235
- ...LitElement.shadowRootOptions,
236
+ export class SuggestionInput extends Lit.LitElement {
237
+ static override shadowRootOptions: ShadowRootInit = {
238
+ ...Lit.LitElement.shadowRootOptions,
236
239
  delegatesFocus: true,
237
- } as const;
240
+ };
241
+
242
+ static override properties: typeof Lit.LitElement.properties = {
243
+ options: jsonPropertyOptions,
244
+ autocomplete: {type: Boolean},
245
+ suggestionFilter: {attribute: false},
246
+ expression: {state: true},
247
+ placeholder: {type: String},
248
+ value: {type: String},
249
+ disabled: {type: Boolean},
250
+ strikethrough: {type: Boolean},
251
+ mimeType: {type: String},
252
+ jslogContext: {type: String},
253
+ };
238
254
 
239
255
  /**
240
256
  * State passed to devtools-suggestion-box.
241
257
  */
242
- @property(jsonPropertyOptions) declare options: readonly string[];
243
- @property({type: Boolean}) declare autocomplete?: boolean;
244
- @property() declare suggestionFilter?: SuggestionFilter;
245
- @state() declare expression: string;
258
+ declare options: readonly string[];
259
+ declare autocomplete?: boolean;
260
+ declare suggestionFilter?: SuggestionFilter;
261
+ declare expression: string;
246
262
 
247
263
  /**
248
264
  * State passed to devtools-editable-content.
249
265
  */
250
- @property() declare placeholder: string;
251
- @property() declare value: string;
252
- @property({type: Boolean}) declare disabled: boolean;
253
- @property({type: Boolean}) declare strikethrough: boolean;
254
- @property() declare mimeType: string;
255
- @property() declare jslogContext?: string;
266
+ declare placeholder: string;
267
+ declare value: string;
268
+ declare disabled: boolean;
269
+ declare strikethrough: boolean;
270
+ declare mimeType: string;
271
+ declare jslogContext?: string;
256
272
 
257
273
  constructor() {
258
274
  super();
@@ -364,3 +380,7 @@ export class SuggestionInput extends LitElement {
364
380
  // clang-format on
365
381
  }
366
382
  }
383
+
384
+ customElements.define('devtools-editable-content', EditableContent);
385
+ customElements.define('devtools-suggestion-box', SuggestionBox);
386
+ customElements.define('devtools-suggestion-input', SuggestionInput);
@@ -946,7 +946,7 @@ export class ContextMenu extends SubMenu {
946
946
 
947
947
  private static pendingMenu: ContextMenu|null = null;
948
948
  private static useSoftMenu = false;
949
- static readonly groupWeights = [
949
+ static readonly groupWeights: string[] = [
950
950
  'header',
951
951
  'new',
952
952
  'reveal',
@@ -978,7 +978,7 @@ export class ContextMenu extends SubMenu {
978
978
  *
979
979
  */
980
980
  export class MenuButton extends HTMLElement {
981
- static readonly observedAttributes = ['icon-name', 'disabled'];
981
+ static readonly observedAttributes: string[] = ['icon-name', 'disabled'];
982
982
  readonly #shadow = this.attachShadow({mode: 'open'});
983
983
  #triggerTimeoutId?: number;
984
984
  #populateMenuCall?: (arg0: ContextMenu) => void;
@@ -97,7 +97,12 @@ export class DropTarget {
97
97
  }
98
98
  }
99
99
 
100
- export const Type = {
100
+ export interface DropTargetType {
101
+ kind: string;
102
+ type: RegExp;
103
+ }
104
+
105
+ export const Type: Record<'URI'|'Folder'|'File'|'WebFile'|'ImageFile', DropTargetType> = {
101
106
  URI: {kind: 'string', type: /text\/uri-list/},
102
107
  Folder: {kind: 'file', type: /$^/},
103
108
  File: {kind: 'file', type: /.*/},
@@ -52,7 +52,7 @@ export class EmptyWidget extends VBox {
52
52
  #link: Platform.DevToolsPath.UrlString|undefined|null;
53
53
  #view: View;
54
54
 
55
- constructor(headerOrElement: string|HTMLElement, text = '', element?: HTMLElement, view = DEFAULT_VIEW) {
55
+ constructor(headerOrElement: string|HTMLElement, text = '', element?: HTMLElement, view: View = DEFAULT_VIEW) {
56
56
  const header = typeof headerOrElement === 'string' ? headerOrElement : '';
57
57
  if (!element && headerOrElement instanceof HTMLElement) {
58
58
  element = headerOrElement;
@@ -372,4 +372,4 @@ const containers = new Map<Document, Element>();
372
372
  const panes = new Set<GlassPane>();
373
373
 
374
374
  /** Exported for layout tests. **/
375
- export const GlassPanePanes = panes;
375
+ export const GlassPanePanes: Set<GlassPane> = panes;
@@ -514,10 +514,10 @@ export class ShortcutTreeNode {
514
514
  }
515
515
 
516
516
  export class ForwardedShortcut {
517
- static instance = new ForwardedShortcut();
517
+ static instance: ForwardedShortcut = new ForwardedShortcut();
518
518
  }
519
519
 
520
- export const ForwardedActions = new Set<string>([
520
+ export const ForwardedActions: Set<string> = new Set<string>([
521
521
  'main.toggle-dock',
522
522
  'debugger.toggle-breakpoints-active',
523
523
  'debugger.toggle-pause',
@@ -888,7 +888,8 @@ export class SplitWidget extends SplitWidgetBase {
888
888
  }
889
889
 
890
890
  export class SplitWidgetElement extends WidgetElement<SplitWidget> {
891
- static readonly observedAttributes = ['direction', 'sidebar-position', 'sidebar-initial-size', 'sidebar-visibility'];
891
+ static readonly observedAttributes: string[] =
892
+ ['direction', 'sidebar-position', 'sidebar-initial-size', 'sidebar-visibility'];
892
893
 
893
894
  constructor() {
894
895
  super();
@@ -157,7 +157,7 @@ export class ExpandableContainerWidget extends VBox {
157
157
  const expandableContainerForView = new WeakMap<View, ExpandableContainerWidget>();
158
158
 
159
159
  export class StackedPane extends VBox {
160
- readonly expandableContainers = new Map<string, ExpandableContainerWidget>();
160
+ readonly expandableContainers: Map<string, ExpandableContainerWidget> = new Map<string, ExpandableContainerWidget>();
161
161
  constructor(
162
162
  private readonly createToolbar: CreateToolbarFn,
163
163
  private readonly setWidgetForView: SetWidgetForViewFn,
@@ -35,7 +35,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
35
35
 
36
36
  export class TargetCrashedScreen extends VBox {
37
37
  private readonly hideCallback: () => void;
38
- constructor(hideCallback: () => void, view = DEFAULT_VIEW) {
38
+ constructor(hideCallback: () => void, view: View = DEFAULT_VIEW) {
39
39
  super({useShadowDom: true});
40
40
  view({}, {}, this.contentElement);
41
41
  this.hideCallback = hideCallback;
@@ -68,7 +68,8 @@ import {cloneCustomElement, ElementFocusRestorer} from './UIUtils.js';
68
68
  * @attribute value Sets the initial text value that's edited when editing starts. If not provided, the slot's inner text is used.
69
69
  */
70
70
  export class TextPromptElement extends HTMLElement {
71
- static readonly observedAttributes = ['editing', 'completions', 'placeholder', 'cancel-on-blur', 'render-as-block'];
71
+ static readonly observedAttributes: string[] =
72
+ ['editing', 'completions', 'placeholder', 'cancel-on-blur', 'render-as-block'];
72
73
  static formAssociated = true;
73
74
  readonly #shadow = this.attachShadow({mode: 'open'});
74
75
  readonly #internals = this.attachInternals();
@@ -886,7 +886,7 @@ export class ToolbarFilter extends ToolbarInput {
886
886
  }
887
887
 
888
888
  export class ToolbarInputElement extends HTMLElement {
889
- static observedAttributes = ['value', 'disabled', 'regex'];
889
+ static observedAttributes: string[] = ['value', 'disabled', 'regex'];
890
890
 
891
891
  item?: ToolbarInput;
892
892
  datalist: HTMLDataListElement|null = null;
@@ -467,7 +467,7 @@ export class TreeOutlineInShadow extends TreeOutline {
467
467
  }
468
468
  }
469
469
 
470
- export const treeElementBylistItemNode = new WeakMap<Node, TreeElement>();
470
+ export const treeElementBylistItemNode: WeakMap<Node, TreeElement> = new WeakMap<Node, TreeElement>();
471
471
  export class TreeElement {
472
472
  treeOutline: TreeOutline|null;
473
473
  parent: TreeElement|null;
@@ -1594,8 +1594,6 @@ class TreeViewTreeElement extends TreeElement {
1594
1594
  static readonly CLONED_ATTRIBUTES = SDK.DOMModel.ARIA_ATTRIBUTES.union(new Set(['jslog', 'draggable']));
1595
1595
  #clonedAttributes = new Set<string>();
1596
1596
  #clonedClasses = new Set<string>();
1597
- #userExpanded = false;
1598
- #isProcessingAttribute = false;
1599
1597
  #previousOpenAttributeValue?: string|null;
1600
1598
  #refreshScheduled = false;
1601
1599
 
@@ -1609,39 +1607,16 @@ class TreeViewTreeElement extends TreeElement {
1609
1607
  this.refresh();
1610
1608
  }
1611
1609
 
1612
- override onexpand(): void {
1613
- if (!this.#isProcessingAttribute) {
1614
- this.#userExpanded = true;
1615
- }
1616
- }
1617
-
1618
- override oncollapse(): void {
1619
- if (!this.#isProcessingAttribute) {
1620
- this.#userExpanded = false;
1621
- }
1622
- }
1623
-
1624
1610
  updateExpansionFromAttribute(): void {
1625
- this.#isProcessingAttribute = true;
1626
- try {
1627
- const openAttr = this.configElement.getAttribute('open');
1628
- if (openAttr === this.#previousOpenAttributeValue) {
1629
- return;
1630
- }
1631
- this.#previousOpenAttributeValue = openAttr;
1632
- if (openAttr === null) {
1633
- if (this.#userExpanded) {
1634
- this.expand();
1635
- } else {
1636
- this.collapse();
1637
- }
1638
- } else if (openAttr === 'false') {
1639
- this.collapse();
1640
- } else {
1641
- this.expand();
1642
- }
1643
- } finally {
1644
- this.#isProcessingAttribute = false;
1611
+ const openAttr = this.configElement.getAttribute('open');
1612
+ if (openAttr === this.#previousOpenAttributeValue) {
1613
+ return;
1614
+ }
1615
+ this.#previousOpenAttributeValue = openAttr;
1616
+ if (openAttr !== null && openAttr !== 'false') {
1617
+ this.expand();
1618
+ } else {
1619
+ this.collapse();
1645
1620
  }
1646
1621
  }
1647
1622
 
@@ -1828,7 +1803,7 @@ function removeNode(node: TreeElement, preserveParentExpandable = false): void {
1828
1803
  * @attribute hide-overflow
1829
1804
  */
1830
1805
  export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
1831
- static readonly observedAttributes =
1806
+ static readonly observedAttributes: string[] =
1832
1807
  ['navigation-variant', 'hide-overflow', 'dense', 'show-selection-on-keyboard-focus'];
1833
1808
  readonly #treeOutline = new TreeOutlineInShadow(undefined, this, true);
1834
1809
 
@@ -2104,7 +2079,8 @@ class IfExpandedDirective extends Lit.Directive.Directive {
2104
2079
  return node.expanded;
2105
2080
  }
2106
2081
  }
2107
- export const ifExpanded = Lit.Directive.directive(IfExpandedDirective);
2082
+ export const ifExpanded: (content: Lit.LitTemplate|Iterable<Lit.LitTemplate>) =>
2083
+ Lit.DirectiveResult<typeof IfExpandedDirective> = Lit.Directive.directive(IfExpandedDirective);
2108
2084
 
2109
2085
  export class TreeElementWrapper extends HTMLElement {
2110
2086
  #treeElement?: TreeElement;
@@ -71,7 +71,8 @@ declare global {
71
71
  'dt-small-bubble': DevToolsSmallBubble;
72
72
  }
73
73
  }
74
- const {Directives, render} = Lit;
74
+ const Directives: typeof Lit.Directives = Lit.Directives;
75
+ const render: typeof Lit.render = Lit.render;
75
76
 
76
77
  const UIStrings = {
77
78
  /**
@@ -753,7 +754,8 @@ class AnimateOnDirective extends Lit.Directive.Directive {
753
754
  }
754
755
  }
755
756
 
756
- export const animateOn = Lit.Directive.directive(AnimateOnDirective);
757
+ export const animateOn: (_condition: boolean, _className: string) => Lit.DirectiveResult<typeof AnimateOnDirective> =
758
+ Lit.Directive.directive(AnimateOnDirective);
757
759
 
758
760
  export function measurePreferredSize(element: Element, containerElement?: Element|null): Geometry.Size {
759
761
  const oldParent = element.parentElement;
@@ -1195,7 +1197,8 @@ export function setTitle(element: HTMLElement, title: string): void {
1195
1197
  }
1196
1198
 
1197
1199
  export class CheckboxLabel extends HTMLElement {
1198
- static readonly observedAttributes = ['checked', 'disabled', 'indeterminate', 'name', 'title', 'aria-label', 'small'];
1200
+ static readonly observedAttributes: string[] =
1201
+ ['checked', 'disabled', 'indeterminate', 'name', 'title', 'aria-label', 'small'];
1199
1202
 
1200
1203
  readonly #shadowRoot!: DocumentFragment;
1201
1204
  #checkboxElement!: HTMLInputElement;
@@ -173,7 +173,7 @@ export interface EventTypes {
173
173
  }
174
174
 
175
175
  export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
176
- readonly views = new Map<string, View>();
176
+ readonly views: Map<string, View> = new Map<string, View>();
177
177
  private readonly locationNameByViewId = new Map<string, string>();
178
178
  private readonly locationOverrideSetting: Common.Settings.Setting<Record<string, string>>;
179
179
 
@@ -212,7 +212,7 @@ function runNextUpdate(): void {
212
212
  }
213
213
 
214
214
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
215
- export const widgetConfigs = new WeakMap<HTMLElement, WidgetConfig<any>>();
215
+ export const widgetConfigs: WeakMap<HTMLElement, WidgetConfig<any>> = new WeakMap<HTMLElement, WidgetConfig<any>>();
216
216
 
217
217
  export function registerWidgetConfig<WidgetT extends AnyWidget>(element: HTMLElement,
218
218
  config: WidgetConfig<WidgetT>): void {