chrome-devtools-frontend 1.0.1514545 → 1.0.1515446

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 (77) hide show
  1. package/AUTHORS +1 -0
  2. package/docs/committers_policy.md +1 -1
  3. package/docs/contributing/infrastructure.md +101 -5
  4. package/front_end/Images/gdp-logo-dark.png +0 -0
  5. package/front_end/Images/gdp-logo-light.png +0 -0
  6. package/front_end/core/common/Settings.ts +11 -32
  7. package/front_end/global_typings/global_defs.d.ts +15 -1
  8. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +22 -23
  9. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +6 -7
  10. package/front_end/models/ai_assistance/ai_assistance.ts +3 -0
  11. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +77 -2
  12. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +76 -10
  13. package/front_end/models/cpu_profile/ProfileTreeModel.ts +1 -1
  14. package/front_end/models/extensions/ExtensionPanel.ts +4 -0
  15. package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +5 -1
  16. package/front_end/models/trace/helpers/Trace.ts +1 -1
  17. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +6 -7
  18. package/front_end/panels/ai_assistance/components/ChatView.ts +1 -2
  19. package/front_end/panels/common/GdpSignUpDialog.ts +2 -6
  20. package/front_end/panels/common/gdpSignUpDialog.css +6 -14
  21. package/front_end/panels/console/ConsoleView.ts +4 -0
  22. package/front_end/panels/elements/ElementsPanel.ts +4 -0
  23. package/front_end/panels/elements/StylePropertiesSection.ts +4 -4
  24. package/front_end/panels/network/NetworkConfigView.ts +1 -1
  25. package/front_end/panels/network/NetworkLogView.ts +2 -2
  26. package/front_end/panels/network/components/HeaderSectionRow.ts +2 -3
  27. package/front_end/panels/profiler/HeapProfileView.ts +1 -3
  28. package/front_end/panels/profiler/HeapSnapshotView.ts +5 -1
  29. package/front_end/panels/profiler/ProfileDataGrid.ts +4 -0
  30. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +7 -29
  31. package/front_end/panels/profiler/ProfileView.ts +4 -0
  32. package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -2
  33. package/front_end/panels/search/SearchView.ts +219 -205
  34. package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
  35. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  36. package/front_end/panels/settings/components/SyncSection.ts +2 -6
  37. package/front_end/panels/settings/components/syncSection.css +11 -4
  38. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -3
  39. package/front_end/panels/sources/SourcesView.ts +4 -0
  40. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -2
  41. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +6 -3
  42. package/front_end/panels/timeline/CountersGraph.ts +5 -5
  43. package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
  44. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +4 -3
  45. package/front_end/panels/timeline/TimelineFlameChartView.ts +9 -4
  46. package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
  47. package/front_end/panels/timeline/TimelinePanel.ts +4 -3
  48. package/front_end/panels/timeline/TimelineTreeView.ts +6 -2
  49. package/front_end/panels/timeline/TimelineUIUtils.ts +2 -1
  50. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -2
  51. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -6
  52. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +2 -2
  53. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -3
  54. package/front_end/panels/timeline/utils/utils.ts +0 -8
  55. package/front_end/{panels/timeline/utils → services/tracing}/FreshRecording.ts +1 -1
  56. package/front_end/services/tracing/tracing.ts +2 -0
  57. package/front_end/ui/legacy/Dialog.ts +38 -13
  58. package/front_end/ui/legacy/InspectorView.ts +7 -9
  59. package/front_end/ui/legacy/SearchableView.ts +73 -55
  60. package/front_end/ui/legacy/SettingsUI.ts +5 -5
  61. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +1 -4
  62. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +5 -5
  63. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -2
  64. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +2 -2
  65. package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +1 -4
  66. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
  67. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -2
  68. package/front_end/ui/legacy/components/source_frame/JSONView.ts +10 -10
  69. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -0
  70. package/front_end/ui/legacy/components/source_frame/XMLView.ts +4 -0
  71. package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -4
  72. package/front_end/ui/legacy/searchableView.css +0 -4
  73. package/package.json +1 -1
  74. package/front_end/Images/src/gdp-logo-standalone.svg +0 -9
  75. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AICallTree.ts +0 -0
  76. /package/front_end/{panels/timeline/utils → models/ai_assistance/performance}/AIContext.ts +0 -0
  77. /package/front_end/{panels/timeline/utils/InsightAIContext.ts → models/ai_assistance/performance/AIQueries.ts} +0 -0
@@ -21,8 +21,8 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
21
21
  private focusRestorer: WidgetFocusRestorer|null = null;
22
22
  private closeOnEscape = true;
23
23
  private targetDocument: Document|null = null;
24
- private readonly targetDocumentKeyDownHandler: (event: Event) => void;
25
- private escapeKeyCallback: ((arg0: Event) => void)|null = null;
24
+ private readonly targetDocumentKeyDownHandler: (event: KeyboardEvent) => void;
25
+ private escapeKeyCallback: ((arg0: KeyboardEvent) => void)|null = null;
26
26
 
27
27
  constructor(jslogContext?: string) {
28
28
  super();
@@ -36,6 +36,12 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
36
36
  this.widget().setDefaultFocusedElement(this.contentElement);
37
37
  this.setPointerEventsBehavior(PointerEventsBehavior.BLOCKED_BY_GLASS_PANE);
38
38
  this.setOutsideClickCallback(event => {
39
+ // If there are stacked dialogs, we only want to
40
+ // handle the outside click for the top most dialog.
41
+ if (Dialog.getInstance() !== this) {
42
+ return;
43
+ }
44
+
39
45
  this.hide();
40
46
  event.consume(true);
41
47
  });
@@ -44,22 +50,35 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
44
50
  }
45
51
 
46
52
  static hasInstance(): boolean {
47
- return Boolean(Dialog.instance);
53
+ return Dialog.dialogs.length > 0;
48
54
  }
49
55
 
56
+ /**
57
+ * If there is only one dialog, returns that.
58
+ * If there are stacked dialogs, returns the topmost one.
59
+ */
50
60
  static getInstance(): Dialog|null {
51
- return Dialog.instance;
61
+ return Dialog.dialogs[Dialog.dialogs.length - 1] || null;
52
62
  }
53
63
 
54
- override show(where?: Document|Element): void {
64
+ /**
65
+ * `stack` parameter is needed for being able to open a dialog on top
66
+ * of an existing dialog. The main reason is, Settings Tab is
67
+ * implemented as a Dialog. So, if we want to open a dialog on the
68
+ * Settings Tab, we need to stack it on top of that dialog.
69
+ *
70
+ * @param where Container element of the dialog.
71
+ * @param stack Whether to open this dialog on top of an existing dialog.
72
+ */
73
+ override show(where?: Document|Element, stack?: boolean): void {
55
74
  const document = (where instanceof Document ? where : (where || InspectorView.instance().element).ownerDocument);
56
75
  this.targetDocument = document;
57
76
  this.targetDocument.addEventListener('keydown', this.targetDocumentKeyDownHandler, true);
58
77
 
59
- if (Dialog.instance) {
60
- Dialog.instance.hide();
78
+ if (!stack && Dialog.dialogs.length) {
79
+ Dialog.dialogs.forEach(dialog => dialog.hide());
61
80
  }
62
- Dialog.instance = this;
81
+ Dialog.dialogs.push(this);
63
82
  this.disableTabIndexOnElements(document);
64
83
  super.show(document);
65
84
  this.focusRestorer = new WidgetFocusRestorer(this.widget());
@@ -76,7 +95,10 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
76
95
  }
77
96
  this.restoreTabIndexOnElements();
78
97
  this.dispatchEventToListeners(Events.HIDDEN);
79
- Dialog.instance = null;
98
+ const index = Dialog.dialogs.indexOf(this);
99
+ if (index !== -1) {
100
+ Dialog.dialogs.splice(index, 1);
101
+ }
80
102
  }
81
103
 
82
104
  setAriaLabel(label: string): void {
@@ -87,7 +109,7 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
87
109
  this.closeOnEscape = close;
88
110
  }
89
111
 
90
- setEscapeKeyCallback(callback: (arg0: Event) => void): void {
112
+ setEscapeKeyCallback(callback: (arg0: KeyboardEvent) => void): void {
91
113
  this.escapeKeyCallback = callback;
92
114
  }
93
115
 
@@ -165,8 +187,11 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
165
187
  this.tabIndexMap.clear();
166
188
  }
167
189
 
168
- private onKeyDown(event: Event): void {
169
- const keyboardEvent = (event as KeyboardEvent);
190
+ private onKeyDown(event: KeyboardEvent): void {
191
+ const keyboardEvent = event;
192
+ if (Dialog.getInstance() !== this) {
193
+ return;
194
+ }
170
195
  if (keyboardEvent.keyCode === Keys.Esc.code && KeyboardShortcut.hasNoModifiers(event)) {
171
196
  if (this.escapeKeyCallback) {
172
197
  this.escapeKeyCallback(event);
@@ -183,7 +208,7 @@ export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof G
183
208
  }
184
209
  }
185
210
 
186
- private static instance: Dialog|null = null;
211
+ private static dialogs: Dialog[] = [];
187
212
  }
188
213
 
189
214
  export const enum Events {
@@ -136,7 +136,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
136
136
  private infoBarDiv!: HTMLDivElement|null;
137
137
  private readonly tabbedLocation: TabbedViewLocation;
138
138
  readonly tabbedPane: TabbedPane;
139
- private readonly keyDownBound: (event: Event) => void;
139
+ private readonly keyDownBound: (event: KeyboardEvent) => void;
140
140
  private currentPanelLocked?: boolean;
141
141
  private focusRestorer?: WidgetFocusRestorer|null;
142
142
  private ownerSplitWidget?: SplitWidget;
@@ -476,9 +476,8 @@ export class InspectorView extends VBox implements ViewLocationResolver {
476
476
  return this.drawerSplitWidget.isVertical();
477
477
  }
478
478
 
479
- private keyDown(event: Event): void {
480
- const keyboardEvent = (event as KeyboardEvent);
481
- if (!KeyboardShortcut.eventHasCtrlEquivalentKey(keyboardEvent) || keyboardEvent.altKey || keyboardEvent.shiftKey) {
479
+ private keyDown(event: KeyboardEvent): void {
480
+ if (!KeyboardShortcut.eventHasCtrlEquivalentKey(event) || event.altKey || event.shiftKey) {
482
481
  return;
483
482
  }
484
483
 
@@ -486,12 +485,11 @@ export class InspectorView extends VBox implements ViewLocationResolver {
486
485
  const panelShortcutEnabled = Common.Settings.moduleSetting('shortcut-panel-switch').get();
487
486
  if (panelShortcutEnabled) {
488
487
  let panelIndex = -1;
489
- if (keyboardEvent.keyCode > 0x30 && keyboardEvent.keyCode < 0x3A) {
490
- panelIndex = keyboardEvent.keyCode - 0x31;
488
+ if (event.keyCode > 0x30 && event.keyCode < 0x3A) {
489
+ panelIndex = event.keyCode - 0x31;
491
490
  } else if (
492
- keyboardEvent.keyCode > 0x60 && keyboardEvent.keyCode < 0x6A &&
493
- keyboardEvent.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) {
494
- panelIndex = keyboardEvent.keyCode - 0x61;
491
+ event.keyCode > 0x60 && event.keyCode < 0x6A && event.location === KeyboardEvent.DOM_KEY_LOCATION_NUMPAD) {
492
+ panelIndex = event.keyCode - 0x61;
495
493
  }
496
494
  if (panelIndex !== -1) {
497
495
  const panelName = this.tabbedPane.tabIds()[panelIndex];
@@ -76,21 +76,17 @@ const UIStrings = {
76
76
  */
77
77
  searchNext: 'Show next result',
78
78
  /**
79
- * @description Tooltip text on a toggle to enable search by matching case of the input
79
+ * @description Tooltip text on a toggle to enable/disable search by matching the exact case.
80
80
  */
81
- enableCaseSensitive: 'Enable case sensitive search',
81
+ matchCase: 'Match case',
82
82
  /**
83
- * @description Tooltip text on a toggle to disable search by matching case of the input
83
+ * @description Tooltip text on a toggle to enable/disable search by matching the exact word.
84
84
  */
85
- disableCaseSensitive: 'Disable case sensitive search',
85
+ matchWholeWord: 'Match whole word',
86
86
  /**
87
- * @description Tooltip text on a toggle to enable searching with regular expression
87
+ * @description Tooltip text on a toggle to enable/disable searching with regular expression.
88
88
  */
89
- enableRegularExpression: 'Enable regular expressions',
90
- /**
91
- * @description Tooltip text on a toggle to disable searching with regular expression
92
- */
93
- disableRegularExpression: 'Disable regular expressions',
89
+ useRegularExpression: 'Use regular expression',
94
90
  /**
95
91
  * @description Tooltip text on a button to close the search bar
96
92
  */
@@ -158,6 +154,7 @@ export class SearchableView extends VBox {
158
154
  private searchNavigationNextElement: ToolbarButton;
159
155
  private readonly replaceInputElement: HTMLInputElement;
160
156
  private caseSensitiveButton: Buttons.Button.Button|undefined;
157
+ private wholeWordButton: Buttons.Button.Button|undefined;
161
158
  private regexButton: Buttons.Button.Button|undefined;
162
159
  private replaceButtonElement: Buttons.Button.Button;
163
160
  private replaceAllButtonElement: Buttons.Button.Button;
@@ -228,38 +225,64 @@ export class SearchableView extends VBox {
228
225
  this.searchInputElement.focus();
229
226
  });
230
227
  searchConfigButtons.appendChild(clearButton);
231
- if (this.searchProvider.supportsRegexSearch()) {
232
- const iconName = 'regular-expression';
233
- this.regexButton = new Buttons.Button.Button();
234
- this.regexButton.data = {
228
+
229
+ const saveSettingAndPerformSearch = (): void => {
230
+ this.saveSetting();
231
+ this.performSearch(false, true);
232
+ };
233
+
234
+ if (this.searchProvider.supportsCaseSensitiveSearch()) {
235
+ const iconName = 'match-case';
236
+ this.caseSensitiveButton = new Buttons.Button.Button();
237
+ this.caseSensitiveButton.data = {
235
238
  variant: Buttons.Button.Variant.ICON_TOGGLE,
236
239
  size: Buttons.Button.Size.SMALL,
237
240
  iconName,
238
241
  toggledIconName: iconName,
239
- toggleType: Buttons.Button.ToggleType.PRIMARY,
240
242
  toggled: false,
243
+ toggleType: Buttons.Button.ToggleType.PRIMARY,
244
+ title: i18nString(UIStrings.matchCase),
241
245
  jslogContext: iconName,
242
- title: i18nString(UIStrings.enableCaseSensitive),
243
246
  };
244
- this.regexButton.addEventListener('click', () => this.toggleRegexSearch());
245
- searchConfigButtons.appendChild(this.regexButton);
247
+ ARIAUtils.setLabel(this.caseSensitiveButton, i18nString(UIStrings.matchCase));
248
+ this.caseSensitiveButton.addEventListener('click', saveSettingAndPerformSearch);
249
+ searchConfigButtons.appendChild(this.caseSensitiveButton);
246
250
  }
247
251
 
248
- if (this.searchProvider.supportsCaseSensitiveSearch()) {
249
- const iconName = 'match-case';
250
- this.caseSensitiveButton = new Buttons.Button.Button();
251
- this.caseSensitiveButton.data = {
252
+ if (this.searchProvider.supportsWholeWordSearch()) {
253
+ const iconName = 'match-whole-word';
254
+ this.wholeWordButton = new Buttons.Button.Button();
255
+ this.wholeWordButton.data = {
252
256
  variant: Buttons.Button.Variant.ICON_TOGGLE,
253
257
  size: Buttons.Button.Size.SMALL,
254
258
  iconName,
255
259
  toggledIconName: iconName,
256
260
  toggled: false,
257
261
  toggleType: Buttons.Button.ToggleType.PRIMARY,
258
- title: i18nString(UIStrings.enableCaseSensitive),
262
+ title: i18nString(UIStrings.matchWholeWord),
259
263
  jslogContext: iconName,
260
264
  };
261
- this.caseSensitiveButton.addEventListener('click', () => this.toggleCaseSensitiveSearch());
262
- searchConfigButtons.appendChild(this.caseSensitiveButton);
265
+ ARIAUtils.setLabel(this.wholeWordButton, i18nString(UIStrings.matchWholeWord));
266
+ this.wholeWordButton.addEventListener('click', saveSettingAndPerformSearch);
267
+ searchConfigButtons.appendChild(this.wholeWordButton);
268
+ }
269
+
270
+ if (this.searchProvider.supportsRegexSearch()) {
271
+ const iconName = 'regular-expression';
272
+ this.regexButton = new Buttons.Button.Button();
273
+ this.regexButton.data = {
274
+ variant: Buttons.Button.Variant.ICON_TOGGLE,
275
+ size: Buttons.Button.Size.SMALL,
276
+ iconName,
277
+ toggledIconName: iconName,
278
+ toggleType: Buttons.Button.ToggleType.PRIMARY,
279
+ toggled: false,
280
+ jslogContext: iconName,
281
+ title: i18nString(UIStrings.useRegularExpression),
282
+ };
283
+ ARIAUtils.setLabel(this.regexButton, i18nString(UIStrings.useRegularExpression));
284
+ this.regexButton.addEventListener('click', saveSettingAndPerformSearch);
285
+ searchConfigButtons.appendChild(this.regexButton);
263
286
  }
264
287
 
265
288
  // Introduce a separate element for the background of the `Find` input line (instead of
@@ -336,24 +359,6 @@ export class SearchableView extends VBox {
336
359
  return view;
337
360
  }
338
361
 
339
- private toggleCaseSensitiveSearch(): void {
340
- if (this.caseSensitiveButton) {
341
- this.caseSensitiveButton.title = this.caseSensitiveButton.toggled ? i18nString(UIStrings.disableCaseSensitive) :
342
- i18nString(UIStrings.enableCaseSensitive);
343
- }
344
- this.saveSetting();
345
- this.performSearch(false, true);
346
- }
347
-
348
- private toggleRegexSearch(): void {
349
- if (this.regexButton) {
350
- this.regexButton.title = this.regexButton.toggled ? i18nString(UIStrings.disableRegularExpression) :
351
- i18nString(UIStrings.enableRegularExpression);
352
- }
353
- this.saveSetting();
354
- this.performSearch(false, true);
355
- }
356
-
357
362
  private toggleReplace(): void {
358
363
  const replaceEnabled = this.replaceToggleButton.isToggled();
359
364
  const label =
@@ -371,6 +376,9 @@ export class SearchableView extends VBox {
371
376
  if (this.caseSensitiveButton) {
372
377
  settingValue.caseSensitive = this.caseSensitiveButton.toggled;
373
378
  }
379
+ if (this.wholeWordButton) {
380
+ settingValue.wholeWord = this.wholeWordButton.toggled;
381
+ }
374
382
  if (this.regexButton) {
375
383
  settingValue.isRegex = this.regexButton.toggled;
376
384
  }
@@ -379,19 +387,14 @@ export class SearchableView extends VBox {
379
387
 
380
388
  private loadSetting(): void {
381
389
  const settingValue = this.setting ? (this.setting.get() || {}) : {};
382
- if (this.searchProvider.supportsCaseSensitiveSearch() && this.caseSensitiveButton) {
390
+ if (this.caseSensitiveButton) {
383
391
  this.caseSensitiveButton.toggled = Boolean(settingValue.caseSensitive);
384
- const label = settingValue.caseSensitive ? i18nString(UIStrings.disableCaseSensitive) :
385
- i18nString(UIStrings.enableCaseSensitive);
386
- this.caseSensitiveButton.title = label;
387
- ARIAUtils.setLabel(this.caseSensitiveButton, label);
388
392
  }
389
- if (this.searchProvider.supportsRegexSearch() && this.regexButton) {
393
+ if (this.wholeWordButton) {
394
+ this.wholeWordButton.toggled = Boolean(settingValue.wholeWord);
395
+ }
396
+ if (this.regexButton) {
390
397
  this.regexButton.toggled = Boolean(settingValue.isRegex);
391
- const label = settingValue.regular ? i18nString(UIStrings.disableRegularExpression) :
392
- i18nString(UIStrings.enableRegularExpression);
393
- this.regexButton.title = label;
394
- ARIAUtils.setLabel(this.regexButton, label);
395
398
  }
396
399
  }
397
400
 
@@ -622,8 +625,9 @@ export class SearchableView extends VBox {
622
625
  private currentSearchConfig(): SearchConfig {
623
626
  const query = this.searchInputElement.value;
624
627
  const caseSensitive = this.caseSensitiveButton ? this.caseSensitiveButton.toggled : false;
628
+ const wholeWord = this.wholeWordButton ? this.wholeWordButton.toggled : false;
625
629
  const isRegex = this.regexButton ? this.regexButton.toggled : false;
626
- return new SearchConfig(query, caseSensitive, isRegex);
630
+ return new SearchConfig(query, caseSensitive, wholeWord, isRegex);
627
631
  }
628
632
 
629
633
  private updateSecondRowVisibility(): void {
@@ -688,6 +692,7 @@ export interface Searchable {
688
692
  jumpToNextSearchResult(): void;
689
693
  jumpToPreviousSearchResult(): void;
690
694
  supportsCaseSensitiveSearch(): boolean;
695
+ supportsWholeWordSearch(): boolean;
691
696
  supportsRegexSearch(): boolean;
692
697
  }
693
698
 
@@ -704,11 +709,13 @@ export interface SearchRegexResult {
704
709
  export class SearchConfig {
705
710
  query: string;
706
711
  caseSensitive: boolean;
712
+ wholeWord: boolean;
707
713
  isRegex: boolean;
708
714
 
709
- constructor(query: string, caseSensitive: boolean, isRegex: boolean) {
715
+ constructor(query: string, caseSensitive: boolean, wholeWord: boolean, isRegex: boolean) {
710
716
  this.query = query;
711
717
  this.caseSensitive = caseSensitive;
718
+ this.wholeWord = wholeWord;
712
719
  this.isRegex = isRegex;
713
720
  }
714
721
 
@@ -739,6 +746,17 @@ export class SearchConfig {
739
746
  regex = Platform.StringUtilities.createPlainTextSearchRegex(query, modifiers);
740
747
  }
741
748
 
749
+ if (this.wholeWord) {
750
+ let {source} = regex;
751
+ if (!source.startsWith('^') && !source.startsWith('\\b')) {
752
+ source = '\\b' + source;
753
+ }
754
+ if (!source.endsWith('$') && !source.endsWith('\\b')) {
755
+ source = source + '\\b';
756
+ }
757
+ regex = new RegExp(source, regex.flags);
758
+ }
759
+
742
760
  return {
743
761
  regex,
744
762
  fromQuery,
@@ -103,18 +103,18 @@ const createSettingSelect = function(
103
103
  };
104
104
 
105
105
  export const bindToSetting =
106
- (setting: string|Common.Settings.Setting<boolean|string>|Common.Settings.RegExpSetting,
106
+ (settingOrName: string|Common.Settings.Setting<boolean|string>|Common.Settings.RegExpSetting,
107
107
  stringValidator?: (newSettingValue: string) => boolean): ReturnType<typeof Directives.ref> => {
108
- if (typeof setting === 'string') {
109
- setting = Common.Settings.Settings.instance().moduleSetting(setting);
110
- }
108
+ const setting = typeof settingOrName === 'string' ?
109
+ Common.Settings.Settings.instance().moduleSetting(settingOrName) :
110
+ settingOrName;
111
111
 
112
112
  // We can't use `setValue` as the change listener directly, otherwise we won't
113
113
  // be able to remove it again.
114
114
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
115
  let setValue: (value: any) => void;
116
116
  function settingChanged(): void {
117
- setValue((setting as Common.Settings.Setting<unknown>| Common.Settings.RegExpSetting).get());
117
+ setValue(setting.get());
118
118
  }
119
119
 
120
120
  if (setting.type() === Common.Settings.SettingType.BOOLEAN || typeof setting.defaultValue === 'boolean') {
@@ -1419,10 +1419,7 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
1419
1419
  } else if (IS_NATIVE_EYE_DROPPER_AVAILABLE && enabled) {
1420
1420
  // Use EyeDropper API, can pick up colors outside the browser window,
1421
1421
  // Note: The current EyeDropper API is not designed to pick up colors continuously.
1422
- // Wait for TypeScript to support the definition of EyeDropper API:
1423
- // https://github.com/microsoft/TypeScript/issues/48638
1424
- /* eslint-disable @typescript-eslint/no-explicit-any */
1425
- const eyeDropper = new (window as any).EyeDropper();
1422
+ const eyeDropper = new window.EyeDropper();
1426
1423
  this.eyeDropperAbortController = new AbortController();
1427
1424
 
1428
1425
  try {
@@ -140,7 +140,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
140
140
  private dataTableHeaders: Record<string, Element>;
141
141
  scrollContainerInternal: Element;
142
142
  #dataContainer: Element;
143
- private readonly dataTable: Element;
143
+ private readonly dataTable: HTMLTableElement;
144
144
  protected inline: boolean;
145
145
  private columnsArray: ColumnDescriptor[];
146
146
  columns: Record<string, ColumnDescriptor>;
@@ -1516,19 +1516,19 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1516
1516
  void contextMenu.show();
1517
1517
  }
1518
1518
 
1519
- private clickInDataTable(event: Event): void {
1519
+ private clickInDataTable(event: MouseEvent): void {
1520
1520
  const gridNode = this.dataGridNodeFromNode((event.target as Node));
1521
- if (!gridNode || !gridNode.hasChildren() || !gridNode.isEventWithinDisclosureTriangle((event as MouseEvent))) {
1521
+ if (!gridNode || !gridNode.hasChildren() || !gridNode.isEventWithinDisclosureTriangle(event)) {
1522
1522
  return;
1523
1523
  }
1524
1524
 
1525
1525
  if (gridNode.expanded) {
1526
- if ((event as MouseEvent).altKey) {
1526
+ if (event.altKey) {
1527
1527
  gridNode.collapseRecursively();
1528
1528
  } else {
1529
1529
  gridNode.collapse();
1530
1530
  }
1531
- } else if ((event as MouseEvent).altKey) {
1531
+ } else if (event.altKey) {
1532
1532
  gridNode.expandRecursively();
1533
1533
  } else {
1534
1534
  gridNode.expand();
@@ -325,8 +325,8 @@ export class ChartViewport extends UI.Widget.VBox {
325
325
  this.delegate.updateRangeSelection(this.rangeSelectionStart, this.rangeSelectionEnd);
326
326
  }
327
327
 
328
- onClick(event: Event): void {
329
- const mouseEvent = (event as MouseEvent);
328
+ onClick(event: MouseEvent): void {
329
+ const mouseEvent = event;
330
330
  const time = this.pixelToTime(mouseEvent.offsetX);
331
331
  if (this.rangeSelectionStart !== null && this.rangeSelectionEnd !== null && time >= this.rangeSelectionStart &&
332
332
  time <= this.rangeSelectionEnd) {
@@ -217,8 +217,8 @@ export class Dialog {
217
217
  this.dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
218
218
  }
219
219
 
220
- private keyDown(event: Event): void {
221
- const keyboardEvent = (event as KeyboardEvent);
220
+ private keyDown(event: KeyboardEvent): void {
221
+ const keyboardEvent = event;
222
222
  switch (keyboardEvent.key) {
223
223
  case 'ArrowLeft':
224
224
  if (Host.Platform.isMac() && keyboardEvent.metaKey) {
@@ -39,10 +39,7 @@ export class Performance {
39
39
  const nodesToGo: CPUProfile.CPUProfileDataModel.CPUProfileNode[] = [profile.profileHead];
40
40
  const sampleDuration = (profile.profileEndTime - profile.profileStartTime) / profile.totalHitCount;
41
41
  while (nodesToGo.length) {
42
- const nodes: CPUProfile.CPUProfileDataModel.CPUProfileNode[] =
43
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
44
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
- (nodesToGo.pop() as any).children; // Cast to any because runtime checks assert the props.
42
+ const nodes: CPUProfile.CPUProfileDataModel.CPUProfileNode[] = nodesToGo.pop()?.children ?? [];
46
43
  for (let i = 0; i < nodes.length; ++i) {
47
44
  const node = nodes[i];
48
45
  nodesToGo.push(node);
@@ -128,7 +128,7 @@ const ResizerOffset = 5;
128
128
  const OffsetFromWindowEnds = 10;
129
129
 
130
130
  export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
131
- private parentElement: Element;
131
+ private parentElement: HTMLElement;
132
132
  private calculator: NetworkTimeCalculator.Calculator|undefined;
133
133
  private leftResizeElement: HTMLElement;
134
134
  private rightResizeElement: HTMLElement;
@@ -618,8 +618,8 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
618
618
  this.setWindowRatio(windowLeft || 0, windowRight || 0);
619
619
  }
620
620
 
621
- private onMouseWheel(event: Event): void {
622
- const wheelEvent = (event as WheelEvent);
621
+ private onMouseWheel(event: WheelEvent): void {
622
+ const wheelEvent = event;
623
623
  if (!this.resizeEnabled) {
624
624
  return;
625
625
  }
@@ -91,11 +91,11 @@ export class TimelineOverviewPane extends Common.ObjectWrapper.eventMixin<EventT
91
91
  this.hasPointer = false;
92
92
  }
93
93
 
94
- private onMouseMove(event: Event): void {
94
+ private onMouseMove(event: MouseEvent): void {
95
95
  if (!this.cursorEnabled) {
96
96
  return;
97
97
  }
98
- const mouseEvent = (event as MouseEvent);
98
+ const mouseEvent = event;
99
99
  const target = (event.target as HTMLElement);
100
100
  const offsetLeftRelativeToCursorArea =
101
101
  target.getBoundingClientRect().left - this.cursorArea.getBoundingClientRect().left;
@@ -68,9 +68,9 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
68
68
  }
69
69
 
70
70
  private static parseJSON(text: string|null): Promise<ParsedJSON|null> {
71
- let returnObj: (ParsedJSON|null)|null = null;
71
+ let returnObj: ParsedJSON<string>|null = null;
72
72
  if (text) {
73
- returnObj = JSONView.extractJSON((text));
73
+ returnObj = JSONView.extractJSON(text);
74
74
  }
75
75
  if (!returnObj) {
76
76
  return Promise.resolve(null);
@@ -88,7 +88,7 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
88
88
  return Promise.resolve(returnObj);
89
89
  }
90
90
 
91
- private static extractJSON(text: string): ParsedJSON|null {
91
+ private static extractJSON(text: string): ParsedJSON<string>|null {
92
92
  // Do not treat HTML as JSON.
93
93
  if (text.startsWith('<')) {
94
94
  return null;
@@ -260,21 +260,21 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
260
260
  return true;
261
261
  }
262
262
 
263
+ supportsWholeWordSearch(): boolean {
264
+ return true;
265
+ }
266
+
263
267
  supportsRegexSearch(): boolean {
264
268
  return true;
265
269
  }
266
270
  }
267
271
 
268
- export class ParsedJSON {
269
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
270
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
271
- data: any;
272
+ export class ParsedJSON<T extends unknown = unknown> {
273
+ data: T;
272
274
  prefix: string;
273
275
  suffix: string;
274
276
 
275
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
276
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
277
- constructor(data: any, prefix: string, suffix: string) {
277
+ constructor(data: T, prefix: string, suffix: string) {
278
278
  this.data = data;
279
279
  this.prefix = prefix;
280
280
  this.suffix = suffix;
@@ -862,6 +862,10 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
862
862
  return true;
863
863
  }
864
864
 
865
+ supportsWholeWordSearch(): boolean {
866
+ return true;
867
+ }
868
+
865
869
  supportsRegexSearch(): boolean {
866
870
  return true;
867
871
  }
@@ -342,6 +342,10 @@ export class XMLView extends UI.Widget.Widget implements UI.SearchableView.Searc
342
342
  return true;
343
343
  }
344
344
 
345
+ supportsWholeWordSearch(): boolean {
346
+ return true;
347
+ }
348
+
345
349
  supportsRegexSearch(): boolean {
346
350
  return true;
347
351
  }
@@ -974,10 +974,7 @@ function listenForNewComponentLinkifierEvents(): void {
974
974
  listeningToNewEvents = true;
975
975
 
976
976
  window.addEventListener('linkifieractivated', function(event: Event) {
977
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
978
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
979
- const unknownEvent = (event as any);
980
- const eventWithData = (unknownEvent as {
977
+ const eventWithData = (event as unknown as {
981
978
  data: LinkInfo,
982
979
  });
983
980
  Linkifier.handleClickFromNewComponentLand(eventWithData.data);
@@ -160,7 +160,3 @@
160
160
  :host-context(#sources-panel-sources-view) .search-bar {
161
161
  flex-basis: auto;
162
162
  }
163
-
164
- :host-context(#sources-panel-sources-view) .toolbar-search {
165
- flex-wrap: wrap;
166
- }
package/package.json CHANGED
@@ -102,5 +102,5 @@
102
102
  "@eslint/core": "0.15.1"
103
103
  }
104
104
  },
105
- "version": "1.0.1514545"
105
+ "version": "1.0.1515446"
106
106
  }
@@ -1,9 +0,0 @@
1
- <svg width="57" height="26" viewBox="0 0 57 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M37.8354 6.97422L34.9026 10.6776L33.0631 13.0009L29.9954 9.12688C29.521 8.56621 28.9209 8.48183 28.6022 8.48183C28.2834 8.48183 27.6833 8.56621 27.2089 9.12688L24.1412 13.0009L22.3429 15.2736L22.3035 15.3242L22.2623 15.3767L19.3708 19.0277L18.047 20.7003C18.0188 20.7359 17.9907 20.7697 17.9626 20.8034C16.0912 23.0498 13.4247 24.2668 10.6476 24.2668C9.55629 24.2668 8.44808 24.0793 7.36425 23.6911C3.49769 22.3035 1 18.7501 1 14.6361V11.3639C1 13.4303 2.67451 15.1048 4.74092 15.1048C6.80733 15.1048 8.48183 13.4303 8.48183 11.3639V14.6361C8.48183 15.9955 9.46441 16.4943 9.88819 16.6462C10.3063 16.7962 11.3677 17.0325 12.2171 16.0087L14.6004 13.0009L16.4118 10.7133L16.44 10.6776L16.4606 10.6514L19.3727 6.97422L21.3753 4.44652C21.3903 4.42777 21.4053 4.40902 21.4203 4.39214C23.1942 2.23572 25.8138 1 28.6059 1C31.398 1 34.0176 2.23572 35.7915 4.39214C35.8065 4.41089 35.8215 4.42777 35.8365 4.44652L37.8391 6.97422H37.8354Z" fill="#4285F4" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
3
- <path d="M18.0451 5.3041L19.3689 6.97673L16.4568 10.6539L16.4362 10.6801L16.4081 10.7158L14.5967 13.0035L12.2152 9.99572C11.3658 8.97189 10.3045 9.20816 9.88632 9.35817C9.46441 9.51005 8.47996 10.0088 8.47996 11.3683C8.47996 13.4347 6.80545 15.1092 4.73904 15.1092C2.67263 15.1092 1 13.431 1 11.3646C1 7.2505 3.49769 3.6971 7.36424 2.31137C11.2027 0.935011 15.3542 2.06947 17.9607 5.19722C17.9888 5.23097 18.0188 5.2666 18.047 5.30035L18.0451 5.3041Z" fill="#EA4335" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
4
- <path d="M22.3424 15.2715L22.303 15.3221L22.2617 15.3746C22.2898 15.3409 22.3161 15.3071 22.3424 15.2734V15.2715Z" fill="#EA4335" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
5
- <path d="M16.4102 10.7132C16.4254 10.6922 16.4425 10.6713 16.4596 10.6504L16.4387 10.677L16.4102 10.7132Z" fill="#34A853" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
6
- <path d="M56.2064 11.3638V14.6359C56.2064 12.5695 54.5319 10.895 52.4655 10.895C50.3991 10.895 48.7246 12.5695 48.7246 14.6359V11.3638C48.7246 10.0043 47.742 9.50549 47.3182 9.3536C46.9 9.20359 45.8387 8.96732 44.9893 9.99115L42.6078 12.9989L40.7964 15.2866L40.7683 15.3222L40.7477 15.3484L37.8356 19.0256L35.8329 21.5533C35.8179 21.572 35.8029 21.5908 35.7879 21.6077C34.014 23.7622 31.3945 24.9998 28.6024 24.9998C25.8103 24.9998 23.1907 23.7641 21.4168 21.6077C21.4018 21.5889 21.3868 21.572 21.3718 21.5533L19.3691 19.0237L22.2606 15.3728C22.2887 15.3391 22.315 15.3053 22.3412 15.2716L24.1395 12.9989L27.2073 16.8729C27.6817 17.4336 28.2817 17.518 28.6005 17.518C28.9193 17.518 29.5193 17.4336 29.9918 16.8729L33.0596 12.9989L34.8691 10.7131L34.8972 10.6775L34.9235 10.6437L37.83 6.97404L39.1538 5.30141C39.1819 5.26578 39.2119 5.23015 39.2401 5.1964C41.8465 2.06866 45.9981 0.936069 49.8365 2.31055C53.7012 3.69628 56.2008 7.24969 56.2008 11.3638H56.2064Z" fill="#34A853" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
7
- <path d="M34.8721 10.7149C34.8892 10.6921 34.9082 10.6674 34.9272 10.6445L34.9006 10.6788L34.8721 10.7149Z" fill="#FBBC04" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
8
- <path d="M56.2058 14.6353C56.2058 18.7494 53.7081 22.3028 49.8415 23.6885C48.7577 24.0767 47.6495 24.2642 46.5581 24.2642C43.7829 24.2642 41.1165 23.0472 39.2451 20.8008C39.2151 20.767 39.1869 20.7314 39.1588 20.6958L37.835 19.0231L40.7471 15.346L40.7677 15.3197L40.7958 15.2841L42.6072 12.9964L44.9886 16.0041C45.8381 17.028 46.9013 16.7917 47.3176 16.6417C47.7395 16.4898 48.7239 15.991 48.7239 14.6315C48.7239 12.5651 50.3984 10.8906 52.4648 10.8906C54.5313 10.8906 56.2058 12.5651 56.2058 14.6315V14.6353Z" fill="#FBBC04" stroke="#202124" stroke-width="0.853016" stroke-miterlimit="10"/>
9
- </svg>