chrome-devtools-frontend 1.0.1040084 → 1.0.1040857

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 (97) hide show
  1. package/config/gni/devtools_grd_files.gni +0 -1
  2. package/front_end/core/i18n/locales/af.json +87 -18
  3. package/front_end/core/i18n/locales/am.json +100 -31
  4. package/front_end/core/i18n/locales/ar.json +91 -22
  5. package/front_end/core/i18n/locales/as.json +87 -18
  6. package/front_end/core/i18n/locales/az.json +87 -18
  7. package/front_end/core/i18n/locales/be.json +89 -20
  8. package/front_end/core/i18n/locales/bg.json +86 -17
  9. package/front_end/core/i18n/locales/bn.json +91 -22
  10. package/front_end/core/i18n/locales/bs.json +86 -17
  11. package/front_end/core/i18n/locales/ca.json +88 -19
  12. package/front_end/core/i18n/locales/cs.json +89 -20
  13. package/front_end/core/i18n/locales/cy.json +86 -17
  14. package/front_end/core/i18n/locales/da.json +87 -18
  15. package/front_end/core/i18n/locales/de.json +92 -23
  16. package/front_end/core/i18n/locales/el.json +90 -21
  17. package/front_end/core/i18n/locales/en-GB.json +86 -17
  18. package/front_end/core/i18n/locales/en-US.json +10 -4
  19. package/front_end/core/i18n/locales/en-XL.json +10 -4
  20. package/front_end/core/i18n/locales/es-419.json +88 -19
  21. package/front_end/core/i18n/locales/es.json +88 -19
  22. package/front_end/core/i18n/locales/et.json +86 -17
  23. package/front_end/core/i18n/locales/eu.json +86 -17
  24. package/front_end/core/i18n/locales/fa.json +93 -24
  25. package/front_end/core/i18n/locales/fi.json +86 -17
  26. package/front_end/core/i18n/locales/fil.json +88 -19
  27. package/front_end/core/i18n/locales/fr-CA.json +86 -17
  28. package/front_end/core/i18n/locales/fr.json +87 -18
  29. package/front_end/core/i18n/locales/gl.json +87 -18
  30. package/front_end/core/i18n/locales/gu.json +89 -20
  31. package/front_end/core/i18n/locales/he.json +89 -20
  32. package/front_end/core/i18n/locales/hi.json +93 -24
  33. package/front_end/core/i18n/locales/hr.json +87 -18
  34. package/front_end/core/i18n/locales/hu.json +89 -20
  35. package/front_end/core/i18n/locales/hy.json +89 -20
  36. package/front_end/core/i18n/locales/id.json +89 -20
  37. package/front_end/core/i18n/locales/is.json +87 -18
  38. package/front_end/core/i18n/locales/it.json +86 -17
  39. package/front_end/core/i18n/locales/ja.json +87 -18
  40. package/front_end/core/i18n/locales/ka.json +86 -17
  41. package/front_end/core/i18n/locales/kk.json +99 -30
  42. package/front_end/core/i18n/locales/km.json +89 -20
  43. package/front_end/core/i18n/locales/kn.json +89 -20
  44. package/front_end/core/i18n/locales/ko.json +87 -18
  45. package/front_end/core/i18n/locales/ky.json +87 -18
  46. package/front_end/core/i18n/locales/lo.json +90 -21
  47. package/front_end/core/i18n/locales/lt.json +89 -20
  48. package/front_end/core/i18n/locales/lv.json +88 -19
  49. package/front_end/core/i18n/locales/mk.json +86 -17
  50. package/front_end/core/i18n/locales/ml.json +86 -17
  51. package/front_end/core/i18n/locales/mn.json +86 -17
  52. package/front_end/core/i18n/locales/mr.json +86 -17
  53. package/front_end/core/i18n/locales/ms.json +86 -17
  54. package/front_end/core/i18n/locales/my.json +107 -38
  55. package/front_end/core/i18n/locales/ne.json +87 -18
  56. package/front_end/core/i18n/locales/nl.json +87 -18
  57. package/front_end/core/i18n/locales/no.json +90 -21
  58. package/front_end/core/i18n/locales/or.json +89 -20
  59. package/front_end/core/i18n/locales/pa.json +87 -18
  60. package/front_end/core/i18n/locales/pl.json +87 -18
  61. package/front_end/core/i18n/locales/pt-PT.json +90 -21
  62. package/front_end/core/i18n/locales/pt.json +87 -18
  63. package/front_end/core/i18n/locales/ro.json +86 -17
  64. package/front_end/core/i18n/locales/ru.json +91 -22
  65. package/front_end/core/i18n/locales/si.json +87 -18
  66. package/front_end/core/i18n/locales/sk.json +91 -22
  67. package/front_end/core/i18n/locales/sl.json +89 -20
  68. package/front_end/core/i18n/locales/sq.json +92 -23
  69. package/front_end/core/i18n/locales/sr-Latn.json +87 -18
  70. package/front_end/core/i18n/locales/sr.json +87 -18
  71. package/front_end/core/i18n/locales/sv.json +88 -19
  72. package/front_end/core/i18n/locales/sw.json +89 -20
  73. package/front_end/core/i18n/locales/ta.json +87 -18
  74. package/front_end/core/i18n/locales/te.json +90 -21
  75. package/front_end/core/i18n/locales/th.json +86 -17
  76. package/front_end/core/i18n/locales/tr.json +87 -18
  77. package/front_end/core/i18n/locales/uk.json +91 -22
  78. package/front_end/core/i18n/locales/ur.json +86 -17
  79. package/front_end/core/i18n/locales/uz.json +86 -17
  80. package/front_end/core/i18n/locales/vi.json +88 -19
  81. package/front_end/core/i18n/locales/zh-HK.json +88 -19
  82. package/front_end/core/i18n/locales/zh-TW.json +88 -19
  83. package/front_end/core/i18n/locales/zh.json +87 -18
  84. package/front_end/core/i18n/locales/zu.json +87 -18
  85. package/front_end/core/sdk/ScreenCaptureModel.ts +32 -3
  86. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +35 -0
  87. package/front_end/models/emulation/DeviceModeModel.ts +15 -3
  88. package/front_end/models/issues_manager/DeprecationIssue.ts +1 -1
  89. package/front_end/models/workspace/UISourceCode.ts +12 -6
  90. package/front_end/panels/application/components/BackForwardCacheView.ts +13 -13
  91. package/front_end/panels/application/components/OriginTrialTreeView.ts +0 -5
  92. package/front_end/panels/sources/BreakpointsSidebarPane.ts +193 -14
  93. package/front_end/panels/sources/components/breakpointsView.css +1 -1
  94. package/front_end/panels/sources/sources-meta.ts +1 -1
  95. package/front_end/ui/legacy/SearchableView.ts +4 -0
  96. package/package.json +1 -1
  97. package/front_end/panels/application/components/originTrialTreeView.css +0 -9
@@ -722,13 +722,23 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
722
722
  return null;
723
723
  }
724
724
 
725
+ let screenshotMode;
726
+ if (clip) {
727
+ screenshotMode = SDK.ScreenCaptureModel.ScreenshotMode.FROM_CLIP;
728
+ } else if (fullSize) {
729
+ screenshotMode = SDK.ScreenCaptureModel.ScreenshotMode.FULLPAGE;
730
+ } else {
731
+ screenshotMode = SDK.ScreenCaptureModel.ScreenshotMode.FROM_VIEWPORT;
732
+ }
733
+
725
734
  const overlayModel = this.#emulationModel ? this.#emulationModel.overlayModel() : null;
726
735
  if (overlayModel) {
727
736
  overlayModel.setShowViewportSizeOnResize(false);
728
737
  }
729
738
 
739
+ // TODO(crbug/1357584): Delete this after the upstream CDP change lands.
730
740
  // Define the right clipping area for fullsize screenshots.
731
- if (fullSize) {
741
+ if (!clip) {
732
742
  const metrics = await screenCaptureModel.fetchLayoutMetrics();
733
743
  if (!metrics) {
734
744
  return null;
@@ -738,8 +748,10 @@ export class DeviceModeModel extends Common.ObjectWrapper.ObjectWrapper<EventTyp
738
748
  const contentHeight = Math.min((1 << 14), metrics.contentHeight);
739
749
  clip = {x: 0, y: 0, width: Math.floor(metrics.contentWidth), height: Math.floor(contentHeight), scale: 1};
740
750
  }
741
- const screenshot =
742
- await screenCaptureModel.captureScreenshot(Protocol.Page.CaptureScreenshotRequestFormat.Png, 100, clip);
751
+ // TODO(crbug/1357584): Delete till here.
752
+
753
+ const screenshot = await screenCaptureModel.captureScreenshot(
754
+ Protocol.Page.CaptureScreenshotRequestFormat.Png, 100, screenshotMode, clip);
743
755
 
744
756
  const deviceMetrics: Protocol.Page.SetDeviceMetricsOverrideRequest = {
745
757
  width: 0,
@@ -185,7 +185,7 @@ const UIStrings = {
185
185
  * @description Warning displayed to developers when `window.openDatabase` is used in non-secure contexts to notify that the API is deprecated and will be removed.
186
186
  */
187
187
  openWebDatabaseInsecureContext:
188
- 'WebSQL in non-secure contexts is deprecated and will be removed in M107. Please use Web Storage or Indexed Database.',
188
+ 'WebSQL in non-secure contexts is deprecated and will be removed soon. Please use Web Storage or Indexed Database.',
189
189
  /**
190
190
  * @description Warning displayed to developers when persistent storage type is used to notify that storage type is deprecated.
191
191
  */
@@ -528,21 +528,27 @@ export class UILocation {
528
528
  this.columnNumber = columnNumber;
529
529
  }
530
530
 
531
- linkText(skipTrim?: boolean, showColumnNumber?: boolean): string {
532
- let linkText = this.uiSourceCode.displayName(skipTrim);
531
+ linkText(skipTrim: boolean = false, showColumnNumber: boolean = false): string {
532
+ const displayName = this.uiSourceCode.displayName(skipTrim);
533
+ const lineAndColumnText = this.lineAndColumnText(showColumnNumber);
534
+ return lineAndColumnText ? displayName + ':' + lineAndColumnText : displayName;
535
+ }
536
+
537
+ lineAndColumnText(showColumnNumber: boolean = false): string|undefined {
538
+ let lineAndColumnText;
533
539
  if (this.uiSourceCode.mimeType() === 'application/wasm') {
534
540
  // For WebAssembly locations, we follow the conventions described in
535
541
  // github.com/WebAssembly/design/blob/master/Web.md#developer-facing-display-conventions
536
542
  if (typeof this.columnNumber === 'number') {
537
- linkText += `:0x${this.columnNumber.toString(16)}`;
543
+ lineAndColumnText = `0x${this.columnNumber.toString(16)}`;
538
544
  }
539
545
  } else {
540
- linkText += ':' + (this.lineNumber + 1);
546
+ lineAndColumnText = `${this.lineNumber + 1}`;
541
547
  if (showColumnNumber && typeof this.columnNumber === 'number') {
542
- linkText += ':' + (this.columnNumber + 1);
548
+ lineAndColumnText += ':' + (this.columnNumber + 1);
543
549
  }
544
550
  }
545
- return linkText;
551
+ return lineAndColumnText;
546
552
  }
547
553
 
548
554
  id(): string {
@@ -280,11 +280,11 @@ export class BackForwardCacheView extends HTMLElement {
280
280
  // clang-format off
281
281
  return LitHtml.html`
282
282
  ${this.#renderBackForwardCacheStatus(this.#frame.backForwardCacheDetails.restoredFromCache)}
283
- <div class='report-line'>
284
- <div class='report-key'>
283
+ <div class="report-line">
284
+ <div class="report-key">
285
285
  ${i18nString(UIStrings.url)}
286
286
  </div>
287
- <div class='report-value'>
287
+ <div class="report-value">
288
288
  ${this.#frame.url}
289
289
  </div>
290
290
  </div>
@@ -339,11 +339,11 @@ export class BackForwardCacheView extends HTMLElement {
339
339
  topFrameElement.setLeadingIcons([UI.Icon.Icon.create('mediumicon-frame')]);
340
340
  }
341
341
  return LitHtml.html`
342
- <div class='report-line'>
343
- <div class='report-key'>
342
+ <div class="report-line">
343
+ <div class="report-key">
344
344
  ${i18nString(UIStrings.framesTitle)}
345
345
  </div>
346
- <div class='report-value'>
346
+ <div class="report-value">
347
347
  ${treeOutline.element}
348
348
  </div>
349
349
  </div>`;
@@ -395,7 +395,7 @@ export class BackForwardCacheView extends HTMLElement {
395
395
  // clang-format off
396
396
  return LitHtml.html`
397
397
  <${ReportView.ReportView.ReportSection.litTagName}>
398
- <div class='status'>
398
+ <div class="status">
399
399
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
400
400
  iconName: 'ic_checkmark_16x16',
401
401
  color: 'green',
@@ -412,7 +412,7 @@ export class BackForwardCacheView extends HTMLElement {
412
412
  // clang-format off
413
413
  return LitHtml.html`
414
414
  <${ReportView.ReportView.ReportSection.litTagName}>
415
- <div class='status'>
415
+ <div class="status">
416
416
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
417
417
  iconName: 'circled_backslash_icon',
418
418
  color: 'var(--color-text-secondary)',
@@ -496,7 +496,7 @@ export class BackForwardCacheView extends HTMLElement {
496
496
  ${explanations.length > 0 ? LitHtml.html`
497
497
  <${ReportView.ReportView.ReportSectionHeader.litTagName}>
498
498
  ${category}
499
- <div class='help-outline-icon'>
499
+ <div class="help-outline-icon">
500
500
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
501
501
  iconName: 'help_outline',
502
502
  color: 'var(--color-text-secondary)',
@@ -530,9 +530,9 @@ export class BackForwardCacheView extends HTMLElement {
530
530
  return LitHtml.nothing;
531
531
  }
532
532
  const rows = [LitHtml.html`<div>${i18nString(UIStrings.framesPerIssue, {n: frames.length})}</div>`];
533
- rows.push(...frames.map(url => LitHtml.html`<div class='text-ellipsis' title=${url}>${url}</div>`));
533
+ rows.push(...frames.map(url => LitHtml.html`<div class="text-ellipsis" title=${url}>${url}</div>`));
534
534
  return LitHtml.html`
535
- <div class='explanation-frames'>
535
+ <div class="explanation-frames">
536
536
  <${ExpandableList.ExpandableList.ExpandableList.litTagName} .data=${
537
537
  {rows} as
538
538
  ExpandableList.ExpandableList.ExpandableListData}></${ExpandableList.ExpandableList.ExpandableList.litTagName}>
@@ -558,7 +558,7 @@ export class BackForwardCacheView extends HTMLElement {
558
558
  <${ReportView.ReportView.ReportSection.litTagName}>
559
559
  ${(explanation.reason in NotRestoredReasonDescription) ?
560
560
  LitHtml.html`
561
- <div class='circled-exclamation-icon'>
561
+ <div class="circled-exclamation-icon">
562
562
  <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
563
563
  iconName: 'circled_exclamation_icon',
564
564
  color: 'orange',
@@ -574,7 +574,7 @@ export class BackForwardCacheView extends HTMLElement {
574
574
  </div>` :
575
575
  LitHtml.nothing}
576
576
  </${ReportView.ReportView.ReportSection.litTagName}>
577
- <div class='gray-text'>
577
+ <div class="gray-text">
578
578
  ${explanation.reason}
579
579
  </div>
580
580
  ${this.#renderFramesPerReason(frames)}
@@ -11,7 +11,6 @@ import * as LitHtml from '../../../ui/lit-html/lit-html.js';
11
11
 
12
12
  import badgeStyles from './badge.css.js';
13
13
  import originTrialTokenRowsStyles from './originTrialTokenRows.css.js';
14
- import originTrialTreeViewStyles from './originTrialTreeView.css.js';
15
14
 
16
15
  const UIStrings = {
17
16
  /**
@@ -323,10 +322,6 @@ export class OriginTrialTreeView extends HTMLElement {
323
322
  this.#render(data.trials);
324
323
  }
325
324
 
326
- connectedCallback(): void {
327
- this.#shadow.adoptedStyleSheets = [originTrialTreeViewStyles];
328
- }
329
-
330
325
  #render(trials: Protocol.Page.OriginTrial[]): void {
331
326
  if (!trials.length) {
332
327
  return;
@@ -2,23 +2,20 @@
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
4
 
5
- import * as i18n from '../../core/i18n/i18n.js';
5
+ import * as Platform from '../../core/platform/platform.js';
6
+ import * as SDK from '../../core/sdk/sdk.js';
7
+ import * as Bindings from '../../models/bindings/bindings.js';
8
+ import * as TextUtils from '../../models/text_utils/text_utils.js';
9
+ import * as Workspace from '../../models/workspace/workspace.js';
6
10
  import * as UI from '../../ui/legacy/legacy.js';
7
11
 
8
- const UIStrings = {
9
- /**
10
- *@description Text to indicate that there are no breakpoints
11
- */
12
- noBreakpoints: 'No breakpoints',
13
- };
14
-
15
- const str_ = i18n.i18n.registerUIStrings('panels/sources/BreakpointsSidebarPane.ts', UIStrings);
16
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
12
+ import * as SourcesComponents from './components/components.js';
17
13
 
18
14
  let breakpointsSidebarPaneInstance: BreakpointsSidebarPane;
15
+ let breakpointsViewControllerInstance: BreakpointsSidebarController;
19
16
 
20
17
  export class BreakpointsSidebarPane extends UI.ThrottledWidget.ThrottledWidget {
21
- readonly #noBreakpointsView: HTMLElement;
18
+ readonly #breakpointsView: SourcesComponents.BreakpointsView.BreakpointsView;
22
19
 
23
20
  static instance(): BreakpointsSidebarPane {
24
21
  if (!breakpointsSidebarPaneInstance) {
@@ -30,8 +27,190 @@ export class BreakpointsSidebarPane extends UI.ThrottledWidget.ThrottledWidget {
30
27
  constructor() {
31
28
  super(true);
32
29
 
33
- this.#noBreakpointsView = this.contentElement.createChild('div', 'gray-info-message');
34
- this.#noBreakpointsView.textContent = i18nString(UIStrings.noBreakpoints);
35
- this.#noBreakpointsView.tabIndex = -1;
30
+ this.#breakpointsView = new SourcesComponents.BreakpointsView.BreakpointsView();
31
+ this.contentElement.appendChild(this.#breakpointsView);
32
+ this.update();
33
+ }
34
+
35
+ async doUpdate(): Promise<void> {
36
+ await BreakpointsSidebarController.instance().update();
37
+ }
38
+
39
+ set data(data: SourcesComponents.BreakpointsView.BreakpointsViewData) {
40
+ this.#breakpointsView.data = data;
41
+ }
42
+ }
43
+ export class BreakpointsSidebarController implements UI.ContextFlavorListener.ContextFlavorListener {
44
+ readonly #breakpointManager: Bindings.BreakpointManager.BreakpointManager;
45
+
46
+ constructor() {
47
+ this.#breakpointManager = Bindings.BreakpointManager.BreakpointManager.instance();
48
+ this.#breakpointManager.addEventListener(Bindings.BreakpointManager.Events.BreakpointAdded, this.update, this);
49
+ this.#breakpointManager.addEventListener(Bindings.BreakpointManager.Events.BreakpointRemoved, this.update, this);
50
+ }
51
+
52
+ static instance(opts: {forceNew: boolean|null} = {forceNew: null}): BreakpointsSidebarController {
53
+ if (!breakpointsViewControllerInstance || opts.forceNew) {
54
+ breakpointsViewControllerInstance = new BreakpointsSidebarController();
55
+ }
56
+ return breakpointsViewControllerInstance;
57
+ }
58
+
59
+ flavorChanged(_object: Object|null): void {
60
+ void this.update();
61
+ }
62
+
63
+ async update(): Promise<void> {
64
+ const data = await this.getUpdatedBreakpointViewData();
65
+ BreakpointsSidebarPane.instance().data = data;
66
+ }
67
+
68
+ async getUpdatedBreakpointViewData(): Promise<SourcesComponents.BreakpointsView.BreakpointsViewData> {
69
+ const breakpointLocations = this.#getBreakpointLocations();
70
+ if (!breakpointLocations.length) {
71
+ return {groups: []};
72
+ }
73
+
74
+ const locationsGroupedById = this.#groupBreakpointLocationsById(breakpointLocations);
75
+ const locationIdsByLineId = this.#getLocationIdsByLineId(breakpointLocations);
76
+
77
+ const content = await this.#getContent(locationsGroupedById);
78
+ const selectedUILocation = await this.#getHitUILocation();
79
+
80
+ const urlToGroup = new Map<Platform.DevToolsPath.UrlString, SourcesComponents.BreakpointsView.BreakpointGroup>();
81
+
82
+ for (let idx = 0; idx < locationsGroupedById.length; idx++) {
83
+ const locations = locationsGroupedById[idx];
84
+ const fstLocation = locations[0];
85
+ const sourceURL = fstLocation.uiLocation.uiSourceCode.url();
86
+ const uiLocation = fstLocation.uiLocation;
87
+
88
+ const isHit = selectedUILocation !== null &&
89
+ locations.some(location => location.uiLocation.id() === selectedUILocation.id());
90
+
91
+ const numBreakpointsOnLine = locationIdsByLineId.get(uiLocation.lineId()).size;
92
+ const showColumn = numBreakpointsOnLine > 1;
93
+ const locationText = uiLocation.lineAndColumnText(showColumn);
94
+
95
+ const text = (content[idx] as TextUtils.Text.Text);
96
+ const codeSnippet = text.lineAt(uiLocation.lineNumber);
97
+
98
+ const status: SourcesComponents.BreakpointsView.BreakpointStatus = this.#getBreakpointState(locations);
99
+ const item = {location: locationText, codeSnippet, isHit, status} as
100
+ SourcesComponents.BreakpointsView.BreakpointItem;
101
+
102
+ let group = urlToGroup.get(sourceURL);
103
+ if (group) {
104
+ group.breakpointItems.push(item);
105
+ } else {
106
+ group =
107
+ {url: sourceURL, name: uiLocation.uiSourceCode.displayName(), expanded: true, breakpointItems: [item]} as
108
+ SourcesComponents.BreakpointsView.BreakpointGroup;
109
+ urlToGroup.set(sourceURL, group);
110
+ }
111
+ }
112
+ return {groups: Array.from(urlToGroup.values())};
113
+ }
114
+
115
+ async #getHitUILocation(): Promise<Workspace.UISourceCode.UILocation|null> {
116
+ const details = UI.Context.Context.instance().flavor(SDK.DebuggerModel.DebuggerPausedDetails);
117
+ if (details && details.callFrames.length) {
118
+ return await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(
119
+ details.callFrames[0].location());
120
+ }
121
+ return null;
122
+ }
123
+
124
+ #getBreakpointLocations(): Bindings.BreakpointManager.BreakpointLocation[] {
125
+ const locations = this.#breakpointManager.allBreakpointLocations().filter(
126
+ breakpointLocation =>
127
+ breakpointLocation.uiLocation.uiSourceCode.project().type() !== Workspace.Workspace.projectTypes.Debugger);
128
+
129
+ locations.sort((item1, item2) => item1.uiLocation.compareTo(item2.uiLocation));
130
+
131
+ const result = [];
132
+ let lastBreakpoint: Bindings.BreakpointManager.Breakpoint|null = null;
133
+ let lastLocation: Workspace.UISourceCode.UILocation|null = null;
134
+ for (const location of locations) {
135
+ if (location.breakpoint !== lastBreakpoint || (lastLocation && location.uiLocation.compareTo(lastLocation))) {
136
+ result.push(location);
137
+ lastBreakpoint = location.breakpoint;
138
+ lastLocation = location.uiLocation;
139
+ }
140
+ }
141
+ return result;
142
+ }
143
+
144
+ #groupBreakpointLocationsById(breakpointLocations: Bindings.BreakpointManager.BreakpointLocation[]):
145
+ Bindings.BreakpointManager.BreakpointLocation[][] {
146
+ const map = new Platform.MapUtilities.Multimap<string, Bindings.BreakpointManager.BreakpointLocation>();
147
+ for (const breakpointLocation of breakpointLocations) {
148
+ const uiLocation = breakpointLocation.uiLocation;
149
+ map.set(uiLocation.id(), breakpointLocation);
150
+ }
151
+ const arr: Bindings.BreakpointManager.BreakpointLocation[][] = [];
152
+ for (const id of map.keysArray()) {
153
+ const locations = Array.from(map.get(id));
154
+ if (locations.length) {
155
+ arr.push(locations);
156
+ }
157
+ }
158
+ return arr;
159
+ }
160
+
161
+ #getLocationIdsByLineId(breakpointLocations: Bindings.BreakpointManager.BreakpointLocation[]):
162
+ Platform.MapUtilities.Multimap<string, string> {
163
+ const result = new Platform.MapUtilities.Multimap<string, string>();
164
+
165
+ for (const breakpointLocation of breakpointLocations) {
166
+ const uiLocation = breakpointLocation.uiLocation;
167
+ result.set(uiLocation.lineId(), uiLocation.id());
168
+ }
169
+
170
+ return result;
171
+ }
172
+
173
+ #getBreakpointState(locations: Bindings.BreakpointManager.BreakpointLocation[]):
174
+ SourcesComponents.BreakpointsView.BreakpointStatus {
175
+ const hasEnabled = locations.some(location => location.breakpoint.enabled());
176
+ const hasDisabled = locations.some(location => !location.breakpoint.enabled());
177
+ let status: SourcesComponents.BreakpointsView.BreakpointStatus;
178
+ if (hasEnabled) {
179
+ status = hasDisabled ? SourcesComponents.BreakpointsView.BreakpointStatus.INDETERMINATE :
180
+ SourcesComponents.BreakpointsView.BreakpointStatus.ENABLED;
181
+ } else {
182
+ status = SourcesComponents.BreakpointsView.BreakpointStatus.DISABLED;
183
+ }
184
+ return status;
185
+ }
186
+
187
+ #getContent(locations: Bindings.BreakpointManager.BreakpointLocation[][]): Promise<TextUtils.Text.Text[]> {
188
+ // Use a cache to share the Text objects between all breakpoints. This way
189
+ // we share the cached line ending information that Text calculates. This
190
+ // was very slow to calculate with a lot of breakpoints in the same very
191
+ // large source file.
192
+ const contentToTextMap = new Map<string, TextUtils.Text.Text>();
193
+
194
+ return Promise.all(locations.map(async ([{uiLocation: {uiSourceCode}}]) => {
195
+ if (uiSourceCode.mimeType() === 'application/wasm') {
196
+ // We could mirror the logic from `SourceFrame._ensureContentLoaded()` here
197
+ // (and if so, ideally share that code somewhere), but that's quite heavy
198
+ // logic just to display a single Wasm instruction. Also not really clear
199
+ // how much value this would add. So let's keep it simple for now and don't
200
+ // display anything additional for Wasm breakpoints, and if there's demand
201
+ // to display some text preview, we could look into selectively disassemb-
202
+ // ling the part of the text that we need here.
203
+ // Relevant crbug: https://crbug.com/1090256
204
+ return new TextUtils.Text.Text('');
205
+ }
206
+ const {content} = await uiSourceCode.requestContent();
207
+ const contentText = content || '';
208
+ if (contentToTextMap.has(contentText)) {
209
+ return contentToTextMap.get(contentText) as TextUtils.Text.Text;
210
+ }
211
+ const text = new TextUtils.Text.Text(contentText);
212
+ contentToTextMap.set(contentText, text);
213
+ return text;
214
+ }));
36
215
  }
37
216
  }
@@ -39,7 +39,7 @@ details > summary {
39
39
  height: 18px;
40
40
  list-style: none;
41
41
  display: flex;
42
- padding: 4px 4px 4px 6px;
42
+ padding: 0 4px 0 6px;
43
43
  align-items: center;
44
44
  }
45
45
 
@@ -1730,7 +1730,7 @@ UI.Context.registerListener({
1730
1730
  },
1731
1731
  async loadListener() {
1732
1732
  const Sources = await loadSourcesModule();
1733
- return Sources.JavaScriptBreakpointsSidebarPane.JavaScriptBreakpointsSidebarPane.instance();
1733
+ return Sources.BreakpointsSidebarPane.BreakpointsSidebarController.instance();
1734
1734
  },
1735
1735
  });
1736
1736
 
@@ -561,6 +561,10 @@ export class SearchableView extends VBox {
561
561
  }
562
562
 
563
563
  private onInput(_event: Event): void {
564
+ if (!Common.Settings.Settings.instance().moduleSetting('searchAsYouType').get()) {
565
+ return;
566
+ }
567
+
564
568
  if (this.valueChangedTimeoutId) {
565
569
  clearTimeout(this.valueChangedTimeoutId);
566
570
  }
package/package.json CHANGED
@@ -56,5 +56,5 @@
56
56
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
57
57
  "watch": "vpython third_party/node/node.py --output scripts/watch_build.js"
58
58
  },
59
- "version": "1.0.1040084"
59
+ "version": "1.0.1040857"
60
60
  }
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 The Chromium Authors. All rights reserved.
3
- * Use of this source code is governed by a BSD-style license that can be
4
- * found in the LICENSE file.
5
- */
6
-
7
- :host {
8
- --legacy-item-selection-bg-color: transparent;
9
- }