chrome-devtools-frontend 1.0.925655 → 1.0.927419

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 (128) hide show
  1. package/.stylelintignore +1 -0
  2. package/AUTHORS +1 -0
  3. package/config/gni/devtools_grd_files.gni +10 -3
  4. package/front_end/core/common/Color.ts +6 -0
  5. package/front_end/core/common/SettingRegistration.ts +8 -0
  6. package/front_end/core/host/InspectorFrontendHost.ts +3 -0
  7. package/front_end/core/host/InspectorFrontendHostAPI.ts +3 -0
  8. package/front_end/core/host/UserMetrics.ts +7 -3
  9. package/front_end/core/i18n/locales/en-US.json +71 -14
  10. package/front_end/core/i18n/locales/en-XL.json +71 -14
  11. package/front_end/core/platform/keyboard-utilities.ts +1 -0
  12. package/front_end/core/root/Runtime.ts +1 -0
  13. package/front_end/core/sdk/ConsoleModel.ts +3 -0
  14. package/front_end/core/sdk/DebuggerModel.ts +2 -0
  15. package/front_end/core/sdk/NetworkManager.ts +12 -2
  16. package/front_end/core/sdk/NetworkRequest.ts +20 -5
  17. package/front_end/core/sdk/OverlayModel.ts +21 -0
  18. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +55 -3
  19. package/front_end/devtools_compatibility.js +11 -1
  20. package/front_end/entrypoints/main/MainImpl.ts +4 -2
  21. package/front_end/entrypoints/main/main-meta.ts +16 -0
  22. package/front_end/generated/InspectorBackendCommands.js +8 -7
  23. package/front_end/generated/SupportedCSSProperties.js +7 -1
  24. package/front_end/generated/protocol-mapping.d.ts +5 -24
  25. package/front_end/generated/protocol-proxy-api.d.ts +6 -29
  26. package/front_end/generated/protocol.d.ts +51 -46
  27. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
  28. package/front_end/models/issues_manager/CorsIssue.ts +4 -0
  29. package/front_end/models/logs/LogManager.ts +1 -0
  30. package/front_end/models/persistence/WorkspaceSettingsTab.ts +6 -4
  31. package/front_end/models/persistence/workspaceSettingsTab.css +18 -18
  32. package/front_end/models/timeline_model/TimelineFrameModel.ts +107 -28
  33. package/front_end/panels/application/ReportingApiReportsView.ts +89 -0
  34. package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
  35. package/front_end/panels/application/ReportingApiView.ts +27 -0
  36. package/front_end/panels/application/application.ts +2 -0
  37. package/front_end/panels/application/components/EndpointsGrid.ts +55 -0
  38. package/front_end/panels/application/components/ReportsGrid.ts +144 -0
  39. package/front_end/panels/application/components/components.ts +4 -2
  40. package/front_end/panels/application/components/reportingApiGrid.css +35 -0
  41. package/front_end/panels/application/reportingApiReportsView.css +13 -0
  42. package/front_end/panels/console/ConsoleView.ts +17 -0
  43. package/front_end/panels/console/console-meta.ts +26 -0
  44. package/front_end/panels/elements/ElementsTreeElement.ts +19 -0
  45. package/front_end/panels/elements/PropertiesWidget.ts +1 -2
  46. package/front_end/panels/elements/StylePropertyTreeElement.ts +28 -0
  47. package/front_end/panels/elements/StylePropertyUtils.ts +13 -0
  48. package/front_end/panels/elements/components/nodeText.css +4 -4
  49. package/front_end/panels/elements/elements.ts +2 -0
  50. package/front_end/panels/elements/layoutPane.css +1 -1
  51. package/front_end/panels/issues/CorsIssueDetailsView.ts +4 -2
  52. package/front_end/panels/network/RequestCookiesView.ts +13 -4
  53. package/front_end/panels/screencast/screencastView.css +2 -6
  54. package/front_end/panels/search/SearchResultsPane.ts +1 -1
  55. package/front_end/panels/settings/SettingsScreen.ts +3 -0
  56. package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
  57. package/front_end/panels/sources/CallStackSidebarPane.ts +1 -10
  58. package/front_end/panels/sources/GoToLineQuickOpen.ts +50 -10
  59. package/front_end/panels/sources/UISourceCodeFrame.ts +0 -13
  60. package/front_end/panels/sources/sources-legacy.ts +0 -11
  61. package/front_end/panels/sources/sources-meta.ts +22 -20
  62. package/front_end/panels/sources/sources.ts +0 -2
  63. package/front_end/third_party/codemirror.next/LICENSE +21 -0
  64. package/front_end/third_party/codemirror.next/README.chromium +18 -0
  65. package/front_end/third_party/codemirror.next/bundle-tsconfig.json +21 -0
  66. package/front_end/third_party/codemirror.next/bundle.ts +87 -0
  67. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -0
  68. package/front_end/third_party/codemirror.next/chunk/cpp.js +2 -0
  69. package/front_end/third_party/codemirror.next/chunk/css.js +2 -0
  70. package/front_end/third_party/codemirror.next/chunk/html.js +4 -0
  71. package/front_end/third_party/codemirror.next/chunk/java.js +2 -0
  72. package/front_end/third_party/codemirror.next/chunk/javascript.js +2 -0
  73. package/front_end/third_party/codemirror.next/chunk/json.js +2 -0
  74. package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -0
  75. package/front_end/third_party/codemirror.next/chunk/markdown.js +6 -0
  76. package/front_end/third_party/codemirror.next/chunk/php.js +6 -0
  77. package/front_end/third_party/codemirror.next/chunk/python.js +2 -0
  78. package/front_end/third_party/codemirror.next/chunk/wast.js +2 -0
  79. package/front_end/third_party/codemirror.next/chunk/xml.js +2 -0
  80. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +5467 -0
  81. package/front_end/third_party/codemirror.next/codemirror.next.js +2 -0
  82. package/front_end/third_party/codemirror.next/package.json +39 -0
  83. package/front_end/third_party/codemirror.next/rebuild.sh +6 -0
  84. package/front_end/third_party/codemirror.next/rollup.config.js +45 -0
  85. package/front_end/ui/components/buttons/Button.ts +33 -5
  86. package/front_end/ui/components/buttons/button.css +32 -2
  87. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
  88. package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
  89. package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
  90. package/front_end/ui/components/docs/button/basic.html +1 -0
  91. package/front_end/ui/components/docs/button/basic.ts +47 -4
  92. package/front_end/ui/components/docs/text_editor/basic.html +28 -0
  93. package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
  94. package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
  95. package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
  96. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
  97. package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
  98. package/front_end/ui/components/text_editor/config.ts +264 -0
  99. package/front_end/ui/components/text_editor/text_editor.ts +6 -0
  100. package/front_end/ui/components/text_editor/theme.ts +113 -0
  101. package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
  102. package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
  103. package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
  104. package/front_end/ui/legacy/UIUtils.ts +9 -1
  105. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
  106. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +39 -39
  107. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
  108. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +31 -14
  109. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +7 -8
  110. package/front_end/ui/legacy/components/source_frame/source_frame-legacy.ts +0 -6
  111. package/front_end/ui/legacy/components/source_frame/source_frame.ts +0 -2
  112. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +11 -9
  113. package/front_end/ui/legacy/filter.css +1 -0
  114. package/front_end/ui/legacy/inspectorSyntaxHighlight.css +3 -8
  115. package/front_end/ui/legacy/inspectorSyntaxHighlightDark.css +11 -16
  116. package/front_end/ui/legacy/themeColors.css +60 -0
  117. package/inspector_overlay/debug/tool_persistent_isolated_element.html +75 -0
  118. package/inspector_overlay/drag_resize_handler.ts +142 -0
  119. package/inspector_overlay/highlight_isolated_element.ts +62 -0
  120. package/inspector_overlay/main.ts +4 -1
  121. package/inspector_overlay/tool_highlight.ts +6 -0
  122. package/inspector_overlay/tool_paused.ts +2 -0
  123. package/inspector_overlay/tool_persistent.ts +110 -0
  124. package/inspector_overlay/tool_screenshot.ts +8 -1
  125. package/package.json +1 -1
  126. package/front_end/panels/application/components/ReportingApiView.ts +0 -24
  127. package/front_end/panels/sources/GutterDiffPlugin.ts +0 -282
  128. package/front_end/ui/legacy/components/source_frame/SourceCodeDiff.ts +0 -140
@@ -80,6 +80,14 @@ const UIStrings = {
80
80
  */
81
81
  doNotGroupSimilarMessagesIn: 'Do not group similar messages in console',
82
82
  /**
83
+ *@description Title of a setting under the Console category that can be invoked through the Command Menu
84
+ */
85
+ showCorsErrorsInConsole: 'Show `CORS` errors in console',
86
+ /**
87
+ *@description Title of a setting under the Console category that can be invoked through the Command Menu
88
+ */
89
+ doNotShowCorsErrorsIn: 'Do not show `CORS` errors in console',
90
+ /**
83
91
  *@description Title of a setting under the Console category in Settings
84
92
  */
85
93
  eagerEvaluation: 'Eager evaluation',
@@ -310,6 +318,24 @@ Common.Settings.registerSettingExtension({
310
318
  ],
311
319
  });
312
320
 
321
+ Common.Settings.registerSettingExtension({
322
+ category: Common.Settings.SettingCategory.CONSOLE,
323
+ title: i18nLazyString(UIStrings.showCorsErrorsInConsole),
324
+ settingName: 'consoleShowsCorsErrors',
325
+ settingType: Common.Settings.SettingType.BOOLEAN,
326
+ defaultValue: true,
327
+ options: [
328
+ {
329
+ value: true,
330
+ title: i18nLazyString(UIStrings.showCorsErrorsInConsole),
331
+ },
332
+ {
333
+ value: false,
334
+ title: i18nLazyString(UIStrings.doNotShowCorsErrorsIn),
335
+ },
336
+ ],
337
+ });
338
+
313
339
  Common.Settings.registerSettingExtension({
314
340
  category: Common.Settings.SettingCategory.CONSOLE,
315
341
  title: i18nLazyString(UIStrings.eagerEvaluation),
@@ -83,6 +83,14 @@ const UIStrings = {
83
83
  */
84
84
  scrollIntoView: 'Scroll into view',
85
85
  /**
86
+ *@description Text to enter Isolation Mode, a mode with focus on a single element and interactive resizing
87
+ */
88
+ enterIsolationMode: 'Enter Isolation Mode',
89
+ /**
90
+ *@description Text to exit Isolation Mode, a mode with focus on a single element and interactive resizing
91
+ */
92
+ exitIsolationMode: 'Exit Isolation Mode',
93
+ /**
86
94
  *@description A context menu item in the Elements Tree Element of the Elements panel
87
95
  */
88
96
  editText: 'Edit text',
@@ -636,6 +644,17 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
636
644
  contextMenu.viewSection().appendItem(i18nString(UIStrings.focus), async () => {
637
645
  await this.nodeInternal.focus();
638
646
  });
647
+
648
+ const overlayModel = this.nodeInternal.domModel().overlayModel();
649
+ if (overlayModel.isHighlightedIsolatedElementInPersistentOverlay(this.nodeInternal.id)) {
650
+ contextMenu.viewSection().appendItem(i18nString(UIStrings.exitIsolationMode), () => {
651
+ overlayModel.hideIsolatedElementInPersistentOverlay(this.nodeInternal.id);
652
+ });
653
+ } else {
654
+ contextMenu.viewSection().appendItem(i18nString(UIStrings.enterIsolationMode), () => {
655
+ overlayModel.highlightIsolatedElementInPersistentOverlay(this.nodeInternal.id);
656
+ });
657
+ }
639
658
  }
640
659
 
641
660
  populateScrollIntoView(contextMenu: UI.ContextMenu.ContextMenu): void {
@@ -107,8 +107,7 @@ export class PropertiesWidget extends UI.ThrottledWidget.ThrottledWidget {
107
107
  }
108
108
 
109
109
  await ObjectUI.ObjectPropertiesSection.ObjectPropertyTreeElement.populate(
110
- this.treeOutline.rootElement(), object, true, true, undefined, undefined,
111
- ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.All);
110
+ this.treeOutline.rootElement(), object, true, true, undefined, undefined);
112
111
  }
113
112
 
114
113
  private onNodeChange(event: Common.EventTarget
@@ -19,6 +19,7 @@ import {ElementsPanel} from './ElementsPanel.js';
19
19
  import {StyleEditorWidget} from './StyleEditorWidget.js';
20
20
  import type {StylePropertiesSection} from './StylesSidebarPane.js';
21
21
  import {CSSPropertyPrompt, StylesSidebarPane, StylesSidebarPropertyRenderer} from './StylesSidebarPane.js';
22
+ import {getCssDeclarationAsJavascriptProperty} from './StylePropertyUtils.js';
22
23
 
23
24
  const FlexboxEditor = ElementsComponents.StylePropertyEditor.FlexboxEditor;
24
25
  const GridEditor = ElementsComponents.StylePropertyEditor.GridEditor;
@@ -83,6 +84,14 @@ const UIStrings = {
83
84
  * @description Title of the button that opens the CSS Grid editor in the Styles panel.
84
85
  */
85
86
  gridEditorButton: 'Open `grid` editor',
87
+ /**
88
+ *@description A context menu item in Styles panel to copy CSS declaration as JavaScript property.
89
+ */
90
+ copyCssDeclarationAsJs: 'Copy declaration as JS',
91
+ /**
92
+ *@description A context menu item in Styles panel to copy all declarations of CSS rule as JavaScript properties.
93
+ */
94
+ copyAllCssDeclarationsAsJs: 'Copy all declarations as JS',
86
95
  };
87
96
  const str_ = i18n.i18n.registerUIStrings('panels/elements/StylePropertyTreeElement.ts', UIStrings);
88
97
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -846,6 +855,12 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
846
855
  this.viewComputedValue();
847
856
  });
848
857
 
858
+ contextMenu.clipboardSection().appendItem(
859
+ i18nString(UIStrings.copyCssDeclarationAsJs), this.copyCssDeclarationAsJs.bind(this));
860
+
861
+ contextMenu.defaultSection().appendItem(
862
+ i18nString(UIStrings.copyAllCssDeclarationsAsJs), this.copyAllCssDeclarationAsJs.bind(this));
863
+
849
864
  contextMenu.show();
850
865
  }
851
866
 
@@ -870,6 +885,19 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
870
885
  filterInput.focus();
871
886
  }
872
887
 
888
+ private copyCssDeclarationAsJs(): void {
889
+ const cssDeclarationValue = getCssDeclarationAsJavascriptProperty(this.property);
890
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(cssDeclarationValue);
891
+ }
892
+
893
+ private copyAllCssDeclarationAsJs(): void {
894
+ const section = this.section() as StylePropertiesSection;
895
+ const leadingProperties = (section.style()).leadingProperties();
896
+ const cssDeclarationsAsJsProperties =
897
+ leadingProperties.filter(property => !property.disabled).map(getCssDeclarationAsJavascriptProperty);
898
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(cssDeclarationsAsJsProperties.join(',\n'));
899
+ }
900
+
873
901
  private navigateToSource(element: Element, omitFocus?: boolean): void {
874
902
  const section = this.section();
875
903
  if (!section || !section.navigable) {
@@ -0,0 +1,13 @@
1
+ // Copyright 2021 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
+ import type * as SDK from '../../core/sdk/sdk.js';
6
+
7
+ export function getCssDeclarationAsJavascriptProperty(declaration: SDK.CSSProperty.CSSProperty): string {
8
+ const {name, value} = declaration;
9
+ const declarationNameAsJs =
10
+ name.startsWith('--') ? `'${name}'` : name.replace(/-([a-z])/gi, (_str, group) => group.toUpperCase());
11
+ const declarationAsJs = `'${value.replaceAll('\'', '\\\'')}'`;
12
+ return `${declarationNameAsJs}: ${declarationAsJs}`;
13
+ }
@@ -7,11 +7,11 @@
7
7
  /* See: https://crbug.com/1227651 for details on changing these to --override pattern. */
8
8
 
9
9
  .node-label-name {
10
- color: var(--override-node-text-label-color, --override-dom-tag-name-color);
10
+ color: var(--override-node-text-label-color, --color-token-tag);
11
11
  }
12
12
 
13
13
  .node-label-class {
14
- color: var(--override-node-text-class-color, --override-dom-attribute-name-color);
14
+ color: var(--override-node-text-class-color, --color-token-attribute);
15
15
  }
16
16
 
17
17
  .node-label-id {
@@ -19,9 +19,9 @@
19
19
  }
20
20
 
21
21
  .node-label-class.node-multiple-descriptors {
22
- color: var(--override-node-text-multiple-descriptors-class, var(--override-node-text-class-color, --override-dom-attribute-name-color));
22
+ color: var(--override-node-text-multiple-descriptors-class, var(--override-node-text-class-color, --color-token-attribute));
23
23
  }
24
24
 
25
25
  .node-label-id.node-multiple-descriptors {
26
- color: var(--override-node-text-multiple-descriptors-id, var(--override-node-text-id-color, --override-dom-attribute-name-color));
26
+ color: var(--override-node-text-multiple-descriptors-id, var(--override-node-text-id-color, --color-token-attribute));
27
27
  }
@@ -48,6 +48,7 @@ import * as PropertiesWidget from './PropertiesWidget.js';
48
48
  import * as StyleEditorWidget from './StyleEditorWidget.js';
49
49
  import * as StylePropertyHighlighter from './StylePropertyHighlighter.js';
50
50
  import * as StylePropertyTreeElement from './StylePropertyTreeElement.js';
51
+ import * as StylePropertyUtils from './StylePropertyUtils.js';
51
52
  import * as StylesSidebarPane from './StylesSidebarPane.js';
52
53
 
53
54
  export {
@@ -74,5 +75,6 @@ export {
74
75
  StyleEditorWidget,
75
76
  StylePropertyHighlighter,
76
77
  StylePropertyTreeElement,
78
+ StylePropertyUtils,
77
79
  StylesSidebarPane,
78
80
  };
@@ -96,7 +96,7 @@
96
96
 
97
97
  .elements {
98
98
  margin-top: 12px;
99
- color: var(--override-dom-tag-name-color);
99
+ color: var(--color-token-tag);
100
100
  display: grid;
101
101
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
102
102
  gap: 8px;
@@ -205,7 +205,8 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
205
205
  default:
206
206
  Platform.assertUnhandled<IssuesManager.CorsIssue.IssueCode.PreflightMissingAllowExternal|
207
207
  IssuesManager.CorsIssue.IssueCode.PreflightInvalidAllowExternal|
208
- IssuesManager.CorsIssue.IssueCode.InvalidResponse>(issueCode);
208
+ IssuesManager.CorsIssue.IssueCode.InvalidResponse|
209
+ IssuesManager.CorsIssue.IssueCode.InvalidPrivateNetworkAccess>(issueCode);
209
210
  }
210
211
 
211
212
  this.affectedResources.appendChild(header);
@@ -429,7 +430,8 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
429
430
  this.appendStatus(element, details.isWarning);
430
431
  Platform.assertUnhandled<IssuesManager.CorsIssue.IssueCode.PreflightMissingAllowExternal|
431
432
  IssuesManager.CorsIssue.IssueCode.PreflightInvalidAllowExternal|
432
- IssuesManager.CorsIssue.IssueCode.InvalidResponse>(issueCode);
433
+ IssuesManager.CorsIssue.IssueCode.InvalidResponse|
434
+ IssuesManager.CorsIssue.IssueCode.InvalidPrivateNetworkAccess>(issueCode);
433
435
  break;
434
436
  }
435
437
 
@@ -189,8 +189,10 @@ export class RequestCookiesView extends UI.Widget.Widget {
189
189
 
190
190
  for (const blockedCookie of this.request.blockedResponseCookies()) {
191
191
  const parsedCookies = SDK.CookieParser.CookieParser.parseSetCookie(blockedCookie.cookieLine);
192
- if (parsedCookies && !parsedCookies.length ||
193
- blockedCookie.blockedReasons.includes(Protocol.Network.SetCookieBlockedReason.SyntaxError)) {
192
+ if ((parsedCookies && !parsedCookies.length) ||
193
+ blockedCookie.blockedReasons.includes(Protocol.Network.SetCookieBlockedReason.SyntaxError) ||
194
+ blockedCookie.blockedReasons.includes(
195
+ Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize)) {
194
196
  malformedResponseCookies.push(blockedCookie);
195
197
  continue;
196
198
  }
@@ -265,8 +267,15 @@ export class RequestCookiesView extends UI.Widget.Widget {
265
267
  const icon = UI.Icon.Icon.create('smallicon-error', 'cookie-warning-icon');
266
268
  listItem.appendChild(icon);
267
269
  UI.UIUtils.createTextChild(listItem, malformedCookie.cookieLine);
268
- listItem.title =
269
- SDK.NetworkRequest.setCookieBlockedReasonToUiString(Protocol.Network.SetCookieBlockedReason.SyntaxError);
270
+
271
+ if (malformedCookie.blockedReasons.includes(
272
+ Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize)) {
273
+ listItem.title = SDK.NetworkRequest.setCookieBlockedReasonToUiString(
274
+ Protocol.Network.SetCookieBlockedReason.NameValuePairExceedsMaxSize);
275
+ } else {
276
+ listItem.title =
277
+ SDK.NetworkRequest.setCookieBlockedReasonToUiString(Protocol.Network.SetCookieBlockedReason.SyntaxError);
278
+ }
270
279
  }
271
280
  } else {
272
281
  this.malformedResponseCookiesTitle.classList.add('hidden');
@@ -137,15 +137,11 @@
137
137
  }
138
138
 
139
139
  .screencast-tag-name {
140
- --override-tag-name-color: rgb(163 18 128);
141
- /* Keep this in sync with inspectorSyntaxHighlight.css (--override-dom-tag-name-color) */
142
- color: var(--override-tag-name-color);
140
+ color: var(--color-token-tag);
143
141
  }
144
142
 
145
143
  .screencast-attribute {
146
- --override-attribute-color: rgb(26 26 166);
147
- /* Keep this in sync with inspectorSyntaxHighlight.css (.webkit-html-attribute-value) */
148
- color: var(--override-attribute-color);
144
+ color: var(--color-token-attribute);
149
145
  }
150
146
 
151
147
  .screencast-dimension {
@@ -75,7 +75,7 @@ export class SearchResultsPane extends UI.Widget.VBox {
75
75
  }
76
76
  }
77
77
 
78
- export const matchesExpandedByDefault = 20;
78
+ export const matchesExpandedByDefault = 200;
79
79
  export const matchesShownAtOnce = 20;
80
80
 
81
81
  export class SearchResultsTreeElement extends UI.TreeOutline.TreeElement {
@@ -279,6 +279,9 @@ export class GenericSettingsTab extends SettingsTab {
279
279
  Common.Settings.SettingCategory.DEBUGGER,
280
280
  Common.Settings.SettingCategory.GLOBAL,
281
281
  ];
282
+ if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.SYNC_SETTINGS)) {
283
+ explicitSectionOrder.push(Common.Settings.SettingCategory.SYNC);
284
+ }
282
285
 
283
286
  // Some settings define their initial ordering.
284
287
  const preRegisteredSettings = Common.Settings.getRegisteredSettings().sort(
@@ -14,9 +14,13 @@ const UIStrings = {
14
14
  */
15
15
  noSnippetsFound: 'No snippets found.',
16
16
  /**
17
- *@description Text to run a code snippet
17
+ *@description Text for command prefix of run a code snippet
18
18
  */
19
- runSnippet: 'Run snippet',
19
+ run: 'Run',
20
+ /**
21
+ *@description Text for suggestion of run a code snippet
22
+ */
23
+ snippet: 'Snippet',
20
24
  };
21
25
  const str_ = i18n.i18n.registerUIStrings('panels/snippets/SnippetsQuickOpen.ts', UIStrings);
22
26
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -77,6 +81,7 @@ export class SnippetsQuickOpen extends QuickOpen.FilteredListWidget.Provider {
77
81
  QuickOpen.FilteredListWidget.registerProvider({
78
82
  prefix: '!',
79
83
  iconName: 'ic_command_run_snippet',
80
- title: i18nLazyString(UIStrings.runSnippet),
81
84
  provider: () => Promise.resolve(SnippetsQuickOpen.instance()),
85
+ titlePrefix: i18nLazyString(UIStrings.run),
86
+ titleSuggestion: i18nLazyString(UIStrings.snippet),
82
87
  });
@@ -198,16 +198,7 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
198
198
  let previousStackTrace: Protocol.Runtime.CallFrame[]|SDK.DebuggerModel.CallFrame[] = details.callFrames;
199
199
  let maxAsyncStackChainDepth = this.maxAsyncStackChainDepth;
200
200
  while (asyncStackTrace && maxAsyncStackChainDepth > 0) {
201
- let title = '';
202
- const isAwait = asyncStackTrace.description === 'async function';
203
- if (isAwait && previousStackTrace.length && asyncStackTrace.callFrames.length) {
204
- const lastPreviousFrame = previousStackTrace[previousStackTrace.length - 1];
205
- const lastPreviousFrameName = UI.UIUtils.beautifyFunctionName(lastPreviousFrame.functionName);
206
- title = UI.UIUtils.asyncStackTraceLabel('await in ' + lastPreviousFrameName);
207
- } else {
208
- title = UI.UIUtils.asyncStackTraceLabel(asyncStackTrace.description);
209
- }
210
-
201
+ const title = UI.UIUtils.asyncStackTraceLabel(asyncStackTrace.description, previousStackTrace);
211
202
  items.push(...await Item.createItemsForAsyncStack(
212
203
  title, debuggerModel, asyncStackTrace.callFrames, this.locationPool, this.refreshItem.bind(this)));
213
204
 
@@ -17,6 +17,10 @@ const UIStrings = {
17
17
  */
18
18
  noFileSelected: 'No file selected.',
19
19
  /**
20
+ *@description Text to show no results have been found
21
+ */
22
+ noResultsFound: 'No results found',
23
+ /**
20
24
  *@description Text in Go To Line Quick Open of the Sources panel
21
25
  */
22
26
  typeANumberToGoToThatLine: 'Type a number to go to that line.',
@@ -56,6 +60,8 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
56
60
 
57
61
  let goToLineQuickOpenInstance: GoToLineQuickOpen;
58
62
  export class GoToLineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
63
+ #goToLineStrings: string[] = [];
64
+
59
65
  static instance(opts: {
60
66
  forceNew: boolean|null,
61
67
  } = {forceNew: null}): GoToLineQuickOpen {
@@ -67,7 +73,7 @@ export class GoToLineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
67
73
  return goToLineQuickOpenInstance;
68
74
  }
69
75
 
70
- selectItem(itemIndex: number|null, promptValue: string): void {
76
+ selectItem(_itemIndex: number|null, promptValue: string): void {
71
77
  const uiSourceCode = this.currentUISourceCode();
72
78
  if (!uiSourceCode) {
73
79
  return;
@@ -79,15 +85,17 @@ export class GoToLineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
79
85
  Common.Revealer.reveal(uiSourceCode.uiLocation(position.line - 1, position.column - 1));
80
86
  }
81
87
 
82
- notFoundText(query: string): string {
88
+ updateGoToLineStrings(query: string): void {
89
+ this.#goToLineStrings = [];
83
90
  if (!this.currentUISourceCode()) {
84
- return i18nString(UIStrings.noFileSelected);
91
+ return;
85
92
  }
86
93
  const position = this.parsePosition(query);
87
94
  const sourceFrame = this.currentSourceFrame();
88
95
  if (!position) {
89
96
  if (!sourceFrame) {
90
- return i18nString(UIStrings.typeANumberToGoToThatLine);
97
+ this.#goToLineStrings.push(i18nString(UIStrings.typeANumberToGoToThatLine));
98
+ return;
91
99
  }
92
100
  const disassembly = sourceFrame.wasmDisassembly;
93
101
  const currentLineNumber = sourceFrame.textEditor.currentLineNumber();
@@ -95,23 +103,55 @@ export class GoToLineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
95
103
  const lastBytecodeOffset = disassembly.lineNumberToBytecodeOffset(disassembly.lineNumbers - 1);
96
104
  const bytecodeOffsetDigits = lastBytecodeOffset.toString(16).length;
97
105
  const currentPosition = disassembly.lineNumberToBytecodeOffset(currentLineNumber);
98
- return i18nString(UIStrings.currentPositionXsTypeAnOffset, {
106
+ this.#goToLineStrings.push(i18nString(UIStrings.currentPositionXsTypeAnOffset, {
99
107
  PH1: currentPosition.toString(16).padStart(bytecodeOffsetDigits, '0'),
100
108
  PH2: '0'.padStart(bytecodeOffsetDigits, '0'),
101
109
  PH3: lastBytecodeOffset.toString(16),
102
- });
110
+ }));
111
+ return;
103
112
  }
104
113
  const linesCount = sourceFrame.textEditor.linesCount;
105
- return i18nString(UIStrings.currentLineSTypeALineNumber, {PH1: currentLineNumber + 1, PH2: linesCount});
114
+ this.#goToLineStrings.push(
115
+ i18nString(UIStrings.currentLineSTypeALineNumber, {PH1: currentLineNumber + 1, PH2: linesCount}));
116
+ return;
106
117
  }
107
118
 
108
119
  if (sourceFrame && sourceFrame.wasmDisassembly) {
109
- return i18nString(UIStrings.goToOffsetXs, {PH1: (position.column - 1).toString(16)});
120
+ this.#goToLineStrings.push(i18nString(UIStrings.goToOffsetXs, {PH1: (position.column - 1).toString(16)}));
121
+ return;
110
122
  }
111
123
  if (position.column && position.column > 1) {
112
- return i18nString(UIStrings.goToLineSAndColumnS, {PH1: position.line, PH2: position.column});
124
+ this.#goToLineStrings.push(i18nString(UIStrings.goToLineSAndColumnS, {PH1: position.line, PH2: position.column}));
125
+ return;
126
+ }
127
+ if (sourceFrame && position.line > sourceFrame.textEditor.linesCount) {
128
+ return;
129
+ }
130
+ this.#goToLineStrings.push(i18nString(UIStrings.goToLineS, {PH1: position.line}));
131
+ }
132
+
133
+ itemCount(): number {
134
+ return this.#goToLineStrings.length;
135
+ }
136
+
137
+ renderItem(itemIndex: number, _query: string, titleElement: Element, _subtitleElement: Element): void {
138
+ UI.UIUtils.createTextChild(titleElement, this.#goToLineStrings[itemIndex]);
139
+ }
140
+
141
+ rewriteQuery(_query: string): string {
142
+ // For Go to Line Quick Open, we don't need to filter any item, set query to empty string, so the filter regex matching will be skipped
143
+ return '';
144
+ }
145
+
146
+ queryChanged(query: string): void {
147
+ this.updateGoToLineStrings(query);
148
+ }
149
+
150
+ notFoundText(_query: string): string {
151
+ if (!this.currentUISourceCode()) {
152
+ return i18nString(UIStrings.noFileSelected);
113
153
  }
114
- return i18nString(UIStrings.goToLineS, {PH1: position.line});
154
+ return i18nString(UIStrings.noResultsFound);
115
155
  }
116
156
 
117
157
  private parsePosition(query: string): {
@@ -44,7 +44,6 @@ import * as UI from '../../ui/legacy/legacy.js';
44
44
  import {CoveragePlugin} from './CoveragePlugin.js';
45
45
  import {CSSPlugin} from './CSSPlugin.js';
46
46
  import {DebuggerPlugin} from './DebuggerPlugin.js';
47
- import {GutterDiffPlugin} from './GutterDiffPlugin.js';
48
47
  import {JavaScriptCompilerPlugin} from './JavaScriptCompilerPlugin.js';
49
48
  import type {Plugin} from './Plugin.js';
50
49
  import {ScriptOriginPlugin} from './ScriptOriginPlugin.js';
@@ -55,7 +54,6 @@ export class UISourceCodeFrame extends
55
54
  Common.ObjectWrapper.eventMixin<EventTypes, typeof SourceFrame.SourceFrame.SourceFrameImpl>(
56
55
  SourceFrame.SourceFrame.SourceFrameImpl) {
57
56
  private uiSourceCodeInternal: Workspace.UISourceCode.UISourceCode;
58
- private readonly diff: SourceFrame.SourceCodeDiff.SourceCodeDiff|undefined;
59
57
  private muteSourceCodeEvents: boolean;
60
58
  private isSettingContent: boolean;
61
59
  private persistenceBinding: Persistence.Persistence.PersistenceBinding|null;
@@ -71,10 +69,6 @@ export class UISourceCodeFrame extends
71
69
  super(workingCopy);
72
70
  this.uiSourceCodeInternal = uiSourceCode;
73
71
 
74
- if (Root.Runtime.experiments.isEnabled('sourceDiff')) {
75
- this.diff = new SourceFrame.SourceCodeDiff.SourceCodeDiff(this.textEditor);
76
- }
77
-
78
72
  this.muteSourceCodeEvents = false;
79
73
  this.isSettingContent = false;
80
74
 
@@ -363,10 +357,6 @@ export class UISourceCodeFrame extends
363
357
  if (ScriptOriginPlugin.accepts(pluginUISourceCode)) {
364
358
  this.plugins.push(new ScriptOriginPlugin(this.textEditor, pluginUISourceCode));
365
359
  }
366
- if (!this.pretty && Root.Runtime.experiments.isEnabled('sourceDiff') &&
367
- GutterDiffPlugin.accepts(pluginUISourceCode)) {
368
- this.plugins.push(new GutterDiffPlugin(this.textEditor, pluginUISourceCode));
369
- }
370
360
  if (CoveragePlugin.accepts(pluginUISourceCode)) {
371
361
  this.plugins.push(new CoveragePlugin(this.textEditor, pluginUISourceCode));
372
362
  }
@@ -403,9 +393,6 @@ export class UISourceCodeFrame extends
403
393
  private innerSetContent(content: string): void {
404
394
  this.isSettingContent = true;
405
395
  const oldContent = this.textEditor.text();
406
- if (this.diff) {
407
- this.diff.highlightModifiedLines(oldContent, content);
408
- }
409
396
  if (oldContent !== content) {
410
397
  this.setContent(content, null);
411
398
  }
@@ -73,17 +73,6 @@ Sources.FilteredUISourceCodeListProvider =
73
73
  /** @constructor */
74
74
  Sources.GoToLineQuickOpen = SourcesModule.GoToLineQuickOpen.GoToLineQuickOpen;
75
75
 
76
- /** @constructor */
77
- Sources.GutterDiffPlugin = SourcesModule.GutterDiffPlugin.GutterDiffPlugin;
78
-
79
- /** @constructor */
80
- Sources.GutterDiffPlugin.GutterDecoration = SourcesModule.GutterDiffPlugin.GutterDecoration;
81
-
82
- Sources.GutterDiffPlugin.DiffGutterType = SourcesModule.GutterDiffPlugin.DiffGutterType;
83
-
84
- /** @constructor */
85
- Sources.GutterDiffPlugin.ContextMenuProvider = SourcesModule.GutterDiffPlugin.ContextMenuProvider;
86
-
87
76
  /** @constructor */
88
77
  Sources.InplaceFormatterEditorAction = SourcesModule.InplaceFormatterEditorAction.InplaceFormatterEditorAction;
89
78
 
@@ -348,13 +348,25 @@ const UIStrings = {
348
348
  */
349
349
  disallowScrollingPastEndOfFile: 'Disallow scrolling past end of file',
350
350
  /**
351
- *@description Title of the Filtered List WidgetProvider of Quick Open
351
+ *@description Text for command prefix of go to a given line or symbol
352
352
  */
353
- goToSymbol: 'Go to symbol',
353
+ goTo: 'Go to',
354
354
  /**
355
- *@description Text to open a file
355
+ *@description Text for command suggestion of go to a given line
356
356
  */
357
- openFile: 'Open file',
357
+ line: 'Line',
358
+ /**
359
+ *@description Text for command suggestion of go to a given symbol
360
+ */
361
+ symbol: 'Symbol',
362
+ /**
363
+ *@description Text for command prefix of open a file
364
+ */
365
+ open: 'Open',
366
+ /**
367
+ *@description Text for command suggestion of open a file
368
+ */
369
+ file: 'File',
358
370
  /**
359
371
  * @description Title of a setting under the Sources category in Settings. If this option is off,
360
372
  * the sources panel will not be automatically be focsed whenever the application hits a breakpoint
@@ -1558,19 +1570,6 @@ UI.ContextMenu.registerProvider({
1558
1570
  experiment: undefined,
1559
1571
  });
1560
1572
 
1561
- UI.ContextMenu.registerProvider({
1562
- contextTypes() {
1563
- return [
1564
- Workspace.UISourceCode.UISourceCode,
1565
- ];
1566
- },
1567
- async loadProvider() {
1568
- const Sources = await loadSourcesModule();
1569
- return Sources.GutterDiffPlugin.ContextMenuProvider.instance();
1570
- },
1571
- experiment: undefined,
1572
- });
1573
-
1574
1573
  UI.ContextMenu.registerProvider({
1575
1574
  async loadProvider() {
1576
1575
  const Sources = await loadSourcesModule();
@@ -1701,29 +1700,32 @@ UI.ContextMenu.registerItem({
1701
1700
  QuickOpen.FilteredListWidget.registerProvider({
1702
1701
  prefix: '@',
1703
1702
  iconName: 'ic_command_go_to_symbol',
1704
- title: i18nLazyString(UIStrings.goToSymbol),
1705
1703
  async provider() {
1706
1704
  const Sources = await loadSourcesModule();
1707
1705
  return Sources.OutlineQuickOpen.OutlineQuickOpen.instance();
1708
1706
  },
1707
+ titlePrefix: i18nLazyString(UIStrings.goTo),
1708
+ titleSuggestion: i18nLazyString(UIStrings.symbol),
1709
1709
  });
1710
1710
 
1711
1711
  QuickOpen.FilteredListWidget.registerProvider({
1712
1712
  prefix: ':',
1713
1713
  iconName: 'ic_command_go_to_line',
1714
- title: i18nLazyString(UIStrings.goToLine),
1715
1714
  async provider() {
1716
1715
  const Sources = await loadSourcesModule();
1717
1716
  return Sources.GoToLineQuickOpen.GoToLineQuickOpen.instance();
1718
1717
  },
1718
+ titlePrefix: i18nLazyString(UIStrings.goTo),
1719
+ titleSuggestion: i18nLazyString(UIStrings.line),
1719
1720
  });
1720
1721
 
1721
1722
  QuickOpen.FilteredListWidget.registerProvider({
1722
1723
  prefix: '',
1723
1724
  iconName: 'ic_command_open_file',
1724
- title: i18nLazyString(UIStrings.openFile),
1725
1725
  async provider() {
1726
1726
  const Sources = await loadSourcesModule();
1727
1727
  return Sources.OpenFileQuickOpen.OpenFileQuickOpen.instance();
1728
1728
  },
1729
+ titlePrefix: i18nLazyString(UIStrings.open),
1730
+ titleSuggestion: i18nLazyString(UIStrings.file),
1729
1731
  });
@@ -13,7 +13,6 @@ import * as EditingLocationHistoryManager from './EditingLocationHistoryManager.
13
13
  import * as FilePathScoreFunction from './FilePathScoreFunction.js';
14
14
  import * as FilteredUISourceCodeListProvider from './FilteredUISourceCodeListProvider.js';
15
15
  import * as GoToLineQuickOpen from './GoToLineQuickOpen.js';
16
- import * as GutterDiffPlugin from './GutterDiffPlugin.js';
17
16
  import * as InplaceFormatterEditorAction from './InplaceFormatterEditorAction.js';
18
17
  import * as JavaScriptBreakpointsSidebarPane from './JavaScriptBreakpointsSidebarPane.js';
19
18
  import * as JavaScriptCompilerPlugin from './JavaScriptCompilerPlugin.js';
@@ -48,7 +47,6 @@ export {
48
47
  FilePathScoreFunction,
49
48
  FilteredUISourceCodeListProvider,
50
49
  GoToLineQuickOpen,
51
- GutterDiffPlugin,
52
50
  InplaceFormatterEditorAction,
53
51
  JavaScriptBreakpointsSidebarPane,
54
52
  JavaScriptCompilerPlugin,
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijnh@gmail.com> and others
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.