chrome-devtools-frontend 1.0.945329 → 1.0.946351

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 (120) hide show
  1. package/config/gni/all_devtools_files.gni +0 -5
  2. package/config/gni/devtools_grd_files.gni +1 -33
  3. package/config/gni/devtools_image_files.gni +1 -0
  4. package/front_end/Images/src/circled_exclamation_icon.svg +3 -0
  5. package/front_end/core/host/UserMetrics.ts +0 -1
  6. package/front_end/core/i18n/locales/en-US.json +12 -12
  7. package/front_end/core/i18n/locales/en-XL.json +12 -12
  8. package/front_end/core/root/Runtime.ts +0 -1
  9. package/front_end/core/sdk/CSSMetadata.ts +0 -1
  10. package/front_end/core/sdk/CSSProperty.ts +16 -9
  11. package/front_end/core/sdk/sdk-meta.ts +20 -8
  12. package/front_end/devtools_compatibility.js +0 -7
  13. package/front_end/entrypoints/devtools_app/devtools_app.js +3 -0
  14. package/front_end/entrypoints/devtools_app/devtools_app.json +1 -2
  15. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +1 -3
  16. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -2
  17. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +0 -120
  18. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -11
  19. package/front_end/entrypoints/formatter_worker/formatter_worker.ts +5 -0
  20. package/front_end/entrypoints/js_app/js_app.js +3 -0
  21. package/front_end/entrypoints/js_app/js_app.json +1 -2
  22. package/front_end/entrypoints/main/MainImpl.ts +0 -6
  23. package/front_end/entrypoints/ndb_app/ndb_app.js +3 -0
  24. package/front_end/entrypoints/ndb_app/ndb_app.json +1 -2
  25. package/front_end/entrypoints/node_app/node_app.js +3 -0
  26. package/front_end/entrypoints/node_app/node_app.json +1 -2
  27. package/front_end/entrypoints/shell/shell.js +18 -1
  28. package/front_end/entrypoints/worker_app/worker_app.js +3 -0
  29. package/front_end/entrypoints/worker_app/worker_app.json +1 -2
  30. package/front_end/generated/protocol.d.ts +0 -4
  31. package/front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js +0 -1
  32. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
  33. package/front_end/models/bindings/ResourceMapping.ts +1 -1
  34. package/front_end/models/emulation/EmulatedDevices.ts +2 -4
  35. package/front_end/models/formatter/FormatterWorkerPool.ts +0 -18
  36. package/front_end/models/text_utils/CodeMirrorUtils.ts +6 -51
  37. package/front_end/models/text_utils/TextUtils.ts +1 -2
  38. package/front_end/models/text_utils/text_utils-legacy.ts +0 -5
  39. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  40. package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
  41. package/front_end/panels/application/BackForwardCacheView.ts +8 -1
  42. package/front_end/panels/elements/StyleEditorWidget.ts +13 -2
  43. package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -12
  44. package/front_end/panels/elements/StylesSidebarPane.ts +35 -9
  45. package/front_end/panels/elements/elementsTreeOutline.css +0 -13
  46. package/front_end/panels/network/NetworkConfigView.ts +10 -0
  47. package/front_end/panels/network/NetworkItemView.ts +10 -1
  48. package/front_end/panels/network/networkConfigView.css +5 -0
  49. package/front_end/panels/profiler/heapProfiler.css +2 -5
  50. package/front_end/panels/profiler/profilesPanel.css +1 -1
  51. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +6 -4
  52. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -12
  53. package/front_end/panels/sources/DebuggerPlugin.ts +6 -2
  54. package/front_end/panels/sources/sourcesView.css +0 -130
  55. package/front_end/panels/webauthn/WebauthnPane.ts +31 -32
  56. package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
  57. package/front_end/ui/components/adorners/Adorner.ts +14 -14
  58. package/front_end/ui/components/buttons/Button.ts +133 -42
  59. package/front_end/ui/components/buttons/button.css +31 -0
  60. package/front_end/ui/components/data_grid/DataGrid.ts +131 -122
  61. package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
  62. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  63. package/front_end/ui/components/docs/button/basic.html +3 -0
  64. package/front_end/ui/components/docs/button/basic.ts +58 -0
  65. package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
  66. package/front_end/ui/components/icon_button/Icon.ts +24 -21
  67. package/front_end/ui/components/icon_button/IconButton.ts +31 -31
  68. package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
  69. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
  70. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
  71. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
  72. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
  73. package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
  74. package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +24 -32
  75. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
  76. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
  77. package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
  78. package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
  79. package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
  80. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
  81. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
  82. package/front_end/ui/components/report_view/ReportView.ts +18 -18
  83. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
  84. package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
  85. package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
  86. package/front_end/ui/components/text_editor/TextEditor.ts +55 -52
  87. package/front_end/ui/components/text_editor/config.ts +3 -3
  88. package/front_end/ui/components/text_editor/javascript.ts +27 -9
  89. package/front_end/ui/components/text_editor/theme.ts +1 -0
  90. package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
  91. package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
  92. package/front_end/ui/legacy/Infobar.ts +9 -0
  93. package/front_end/ui/legacy/ListWidget.ts +2 -2
  94. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -3
  95. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +0 -1
  96. package/front_end/ui/legacy/components/object_ui/object_ui-legacy.ts +0 -8
  97. package/front_end/ui/legacy/components/object_ui/object_ui.ts +0 -4
  98. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -0
  99. package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -211
  100. package/front_end/ui/legacy/legacy-legacy.ts +0 -6
  101. package/front_end/ui/legacy/legacy.ts +0 -2
  102. package/front_end/ui/legacy/tabbedPane.css +1 -1
  103. package/inspector_overlay/main.ts +12 -2
  104. package/package.json +1 -1
  105. package/scripts/check_gn.js +1 -1
  106. package/scripts/eslint_rules/lib/l10n_filename_matches.js +17 -4
  107. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +21 -0
  108. package/scripts/hosted_mode/server.js +17 -2
  109. package/front_end/entrypoints/shell/shell-meta-files.ts +0 -22
  110. package/front_end/entrypoints/shell/shell.json +0 -5
  111. package/front_end/ui/legacy/TextEditor.ts +0 -82
  112. package/front_end/ui/legacy/components/object_ui/JavaScriptAutocomplete.ts +0 -836
  113. package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +0 -1676
  114. package/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts +0 -586
  115. package/front_end/ui/legacy/components/text_editor/autocompleteTooltip.css +0 -20
  116. package/front_end/ui/legacy/components/text_editor/cm_modes.ts +0 -23
  117. package/front_end/ui/legacy/components/text_editor/cmdevtools.css +0 -995
  118. package/front_end/ui/legacy/components/text_editor/module.json +0 -7
  119. package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -33
  120. package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -13
@@ -4,6 +4,9 @@
4
4
  import '../shell/shell.js';
5
5
  import '../../panels/js_profiler/js_profiler-meta.js';
6
6
  import './JsMain.js';
7
+
8
+ import * as Main from '../main/main.js';
7
9
  import * as Startup from '../startup/startup.js';
8
10
 
11
+ new Main.MainImpl.MainImpl();
9
12
  Startup.RuntimeInstantiator.startApplication('js_app');
@@ -1,4 +1,3 @@
1
1
  {
2
- "modules" : [],
3
- "extends": "shell"
2
+ "modules" : []
4
3
  }
@@ -299,9 +299,6 @@ export class MainImpl {
299
299
  'keyboardShortcutEditor', 'Enable keyboard shortcut editor', true,
300
300
  'https://developer.chrome.com/blog/new-in-devtools-88/#keyboard-shortcuts');
301
301
 
302
- // Back/forward cache
303
- Root.Runtime.experiments.register('bfcacheDebugging', 'Enable back/forward cache debugging support');
304
-
305
302
  // Timeline
306
303
  Root.Runtime.experiments.register('timelineEventInitiators', 'Timeline: event initiators');
307
304
  Root.Runtime.experiments.register('timelineInvalidationTracking', 'Timeline: invalidation tracking', true);
@@ -371,7 +368,6 @@ export class MainImpl {
371
368
  Root.Runtime.experiments.enableExperimentsByDefault([
372
369
  'sourceOrderViewer',
373
370
  'hideIssuesFeature',
374
- 'bfcacheDebugging',
375
371
  'cssTypeComponentLength',
376
372
  'preciseChanges',
377
373
  Root.Runtime.ExperimentName.SYNC_SETTINGS,
@@ -1011,5 +1007,3 @@ export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegat
1011
1007
  return false;
1012
1008
  }
1013
1009
  }
1014
-
1015
- new MainImpl();
@@ -2,6 +2,9 @@
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
  import '../shell/shell.js';
5
+
6
+ import * as Main from '../main/main.js';
5
7
  import * as Startup from '../startup/startup.js';
6
8
 
9
+ new Main.MainImpl.MainImpl();
7
10
  Startup.RuntimeInstantiator.startApplication('ndb_app');
@@ -1,5 +1,4 @@
1
1
  {
2
2
  "modules" : [
3
- ],
4
- "extends": "shell"
3
+ ]
5
4
  }
@@ -5,9 +5,12 @@ import '../shell/shell.js';
5
5
  import '../../panels/js_profiler/js_profiler-meta.js';
6
6
  import '../node_main/node_main-meta.js';
7
7
  import './node_app-meta.js';
8
+
9
+ import * as Main from '../main/main.js';
8
10
  import * as Startup from '../startup/startup.js';
9
11
 
10
12
  // Side-effect start the `node_main` module, which implements runnables in
11
13
  // the NodeMain class
12
14
  await import('../node_main/node_main.js');
15
+ new Main.MainImpl.MainImpl();
13
16
  Startup.RuntimeInstantiator.startApplication('node_app');
@@ -1,4 +1,3 @@
1
1
  {
2
- "modules" : [ ],
3
- "extends": "shell"
2
+ "modules" : [ ]
4
3
  }
@@ -8,6 +8,23 @@ import '../../core/root/root-legacy.js';
8
8
  import '../../core/platform/platform.js';
9
9
  import '../../core/dom_extension/dom_extension.js';
10
10
 
11
- import './shell-meta-files.js';
11
+ import '../../panels/sources/sources-meta.js';
12
+ import '../../panels/profiler/profiler-meta.js';
13
+ import '../../panels/console/console-meta.js';
14
+ import '../../panels/coverage/coverage-meta.js';
15
+ import '../../panels/changes/changes-meta.js';
16
+ import '../../panels/input/input-meta.js';
17
+ import '../../ui/components/linear_memory_inspector/linear_memory_inspector-meta.js';
18
+ import '../../panels/settings/settings-meta.js';
19
+ import '../../panels/protocol_monitor/protocol_monitor-meta.js';
20
+ import '../../models/persistence/persistence-meta.js';
21
+ import '../../models/logs/logs-meta.js';
22
+ import '../main/main-meta.js';
23
+ import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
24
+ import '../../ui/legacy/components/quick_open/quick_open-meta.js';
25
+ import '../../core/sdk/sdk-meta.js';
26
+ import '../../ui/legacy/components/source_frame/source_frame-meta.js';
27
+ import '../../panels/console_counters/console_counters-meta.js';
28
+ import '../../ui/legacy/components/object_ui/object_ui-meta.js';
12
29
  import '../main/main.js';
13
30
  // We generate the descriptors in this file, which depend on the runtime.
@@ -13,6 +13,9 @@ import '../../panels/network/network-meta.js';
13
13
  import '../../panels/application/application-meta.js';
14
14
  import '../../panels/timeline/timeline-meta.js';
15
15
  import './WorkerMain.js';
16
+
17
+ import * as Main from '../main/main.js';
16
18
  import * as Startup from '../startup/startup.js';
17
19
 
20
+ new Main.MainImpl.MainImpl();
18
21
  Startup.RuntimeInstantiator.startApplication('worker_app');
@@ -1,4 +1,3 @@
1
1
  {
2
- "modules" : [],
3
- "extends": "shell"
2
+ "modules" : []
4
3
  }
@@ -10442,10 +10442,6 @@ declare namespace Protocol {
10442
10442
  * The fantasy font-family.
10443
10443
  */
10444
10444
  fantasy?: string;
10445
- /**
10446
- * The pictograph font-family.
10447
- */
10448
- pictograph?: string;
10449
10445
  }
10450
10446
 
10451
10447
  /**
@@ -8,7 +8,6 @@ import '../../models/workspace/workspace-legacy.js';
8
8
  import '../../ui/legacy/components/source_frame/source_frame-legacy.js';
9
9
  import '../../models/text_utils/text_utils-legacy.js';
10
10
  import '../../ui/legacy/components/object_ui/object_ui-legacy.js';
11
- import '../../ui/legacy/components/text_editor/text_editor-legacy.js';
12
11
  import '../../panels/browser_debugger/browser_debugger-legacy.js';
13
12
 
14
13
  import './SourcesTestRunner.js';
@@ -341,7 +341,7 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
341
341
  modelData.callFrameLocations.clear();
342
342
  }
343
343
 
344
- private resetForTest(target: SDK.Target.Target): void {
344
+ resetForTest(target: SDK.Target.Target): void {
345
345
  const debuggerModel = (target.model(SDK.DebuggerModel.DebuggerModel) as SDK.DebuggerModel.DebuggerModel);
346
346
  const modelData = this.#debuggerModelToData.get(debuggerModel);
347
347
  if (modelData) {
@@ -149,7 +149,7 @@ export class ResourceMapping implements SDK.TargetManager.SDKModelObserver<SDK.R
149
149
  uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber);
150
150
  }
151
151
 
152
- private resetForTest(target: SDK.Target.Target): void {
152
+ resetForTest(target: SDK.Target.Target): void {
153
153
  const resourceTreeModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);
154
154
  const info = resourceTreeModel ? this.#modelToInfo.get(resourceTreeModel) : null;
155
155
  if (info) {
@@ -502,14 +502,12 @@ export class EmulatedDevicesList extends Common.ObjectWrapper.ObjectWrapper<Even
502
502
  constructor() {
503
503
  super();
504
504
 
505
- this.#standardSetting = Common.Settings.Settings.instance().createSetting(
506
- 'standardEmulatedDeviceList', [], Common.Settings.SettingStorageType.Synced);
505
+ this.#standardSetting = Common.Settings.Settings.instance().createSetting('standardEmulatedDeviceList', []);
507
506
  this.#standardInternal = new Set();
508
507
  this.listFromJSONV1(this.#standardSetting.get(), this.#standardInternal);
509
508
  this.updateStandardDevices();
510
509
 
511
- this.#customSetting = Common.Settings.Settings.instance().createSetting(
512
- 'customEmulatedDeviceList', [], Common.Settings.SettingStorageType.Synced);
510
+ this.#customSetting = Common.Settings.Settings.instance().createSetting('customEmulatedDeviceList', []);
513
511
  this.#customInternal = new Set();
514
512
  if (!this.listFromJSONV1(this.#customSetting.get(), this.#customInternal)) {
515
513
  this.saveCustomDevices();
@@ -171,24 +171,6 @@ export class FormatterWorkerPool {
171
171
  }
172
172
  }
173
173
 
174
- findLastExpression(content: string): Promise<string|null> {
175
- return this.runTask(FormatterActions.FormatterActions.FIND_LAST_EXPRESSION, {content}) as Promise<string|null>;
176
- }
177
-
178
- findLastFunctionCall(content: string): Promise<{
179
- baseExpression: string,
180
- receiver: string,
181
- argumentIndex: number,
182
- functionName: string,
183
- }|null> {
184
- return this.runTask(FormatterActions.FormatterActions.FIND_LAST_FUNCTION_CALL, {content}) as Promise<{
185
- baseExpression: string,
186
- receiver: string,
187
- argumentIndex: number,
188
- functionName: string,
189
- }|null>;
190
- }
191
-
192
174
  argumentsList(content: string): Promise<string[]> {
193
175
  return this.runTask(FormatterActions.FormatterActions.ARGUMENTS_LIST, {content}) as Promise<string[]>;
194
176
  }
@@ -31,57 +31,11 @@
31
31
  /* eslint-disable @typescript-eslint/no-explicit-any */
32
32
 
33
33
  import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
34
+ import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.js';
35
+ import '../../third_party/codemirror/package/mode/css/css.js';
34
36
 
35
- import * as TextRange from './TextRange.js';
36
37
  import type * as TextUtils from './TextUtils.js';
37
38
 
38
- export function toPos(range: TextRange.TextRange): {
39
- start: any,
40
- end: any,
41
- } {
42
- return {
43
- start: new CodeMirror.Pos(range.startLine, range.startColumn),
44
- end: new CodeMirror.Pos(range.endLine, range.endColumn),
45
- };
46
- }
47
-
48
- export function toRange(start: any, end: any): TextRange.TextRange {
49
- return new TextRange.TextRange(start.line, start.ch, end.line, end.ch);
50
- }
51
-
52
- export function changeObjectToEditOperation(changeObject: any): {
53
- oldRange: TextRange.TextRange,
54
- newRange: TextRange.TextRange,
55
- } {
56
- const oldRange = toRange(changeObject.from, changeObject.to);
57
- const newRange = oldRange.clone();
58
- const linesAdded = changeObject.text.length;
59
- if (linesAdded === 0) {
60
- newRange.endLine = newRange.startLine;
61
- newRange.endColumn = newRange.startColumn;
62
- } else if (linesAdded === 1) {
63
- newRange.endLine = newRange.startLine;
64
- newRange.endColumn = newRange.startColumn + changeObject.text[0].length;
65
- } else {
66
- newRange.endLine = newRange.startLine + linesAdded - 1;
67
- newRange.endColumn = changeObject.text[linesAdded - 1].length;
68
- }
69
- return {oldRange: oldRange, newRange: newRange};
70
- }
71
-
72
- export function pullLines(codeMirror: typeof CodeMirror, linesCount: number): string[] {
73
- const lines: string[] = [];
74
- // @ts-expect-error CodeMirror types do not specify eachLine.
75
- codeMirror.eachLine(0, linesCount, onLineHandle);
76
- return lines;
77
-
78
- function onLineHandle(lineHandle: {
79
- text: string,
80
- }): void {
81
- lines.push(lineHandle.text);
82
- }
83
- }
84
-
85
39
  let tokenizerFactoryInstance: TokenizerFactory;
86
40
 
87
41
  export type Tokenizer =
@@ -103,15 +57,16 @@ export class TokenizerFactory implements TextUtils.TokenizerFactory {
103
57
  }
104
58
 
105
59
  // https://crbug.com/1151919 * = CodeMirror.Mode
106
- createTokenizer(mimeType: string, mode?: any): Tokenizer {
107
- const cmMode = mode || CodeMirror.getMode({indentUnit: 2}, mimeType);
60
+ createTokenizer(mimeType: string): Tokenizer {
61
+ const cmMode = CodeMirror.getMode({indentUnit: 2}, mimeType);
108
62
  const state = CodeMirror.startState(cmMode);
109
63
 
110
64
  function tokenize(
111
65
  line: string, callback: (value: string, style: string|null, start: number, end: number) => void): void {
112
66
  const stream = new CodeMirror.StringStream(line);
113
67
  while (!stream.eol()) {
114
- const style = cmMode.token(stream, state);
68
+ const style =
69
+ (cmMode.token as (stream: CodeMirror.StringStream, state: unknown) => string | null)(stream, state);
115
70
  const value = stream.current();
116
71
  callback(value, style, stream.start, stream.start + value.length);
117
72
  stream.start = stream.pos;
@@ -29,7 +29,6 @@
29
29
  */
30
30
 
31
31
  import * as Platform from '../../core/platform/platform.js';
32
- import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
33
32
 
34
33
  import {SearchMatch} from './ContentProvider.js';
35
34
  import {Text} from './Text.js';
@@ -330,7 +329,7 @@ export class BalancedJSONTokenizer {
330
329
  export interface TokenizerFactory {
331
330
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
332
331
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
333
- createTokenizer(mimeType: string, mode?: CodeMirror.Mode<any>):
332
+ createTokenizer(mimeType: string):
334
333
  (arg0: string, arg1: (arg0: string, arg1: string|null, arg2: number, arg3: number) => void) => void;
335
334
  }
336
335
 
@@ -48,10 +48,5 @@ TextUtils.isMinified = TextUtilsModule.TextUtils.isMinified;
48
48
 
49
49
  TextUtils.CodeMirrorUtils = {};
50
50
 
51
- TextUtils.CodeMirrorUtils.toPos = TextUtilsModule.CodeMirrorUtils.toPos;
52
- TextUtils.CodeMirrorUtils.toRange = TextUtilsModule.CodeMirrorUtils.toRange;
53
- TextUtils.CodeMirrorUtils.changeObjectToEditOperation = TextUtilsModule.CodeMirrorUtils.changeObjectToEditOperation;
54
- TextUtils.CodeMirrorUtils.pullLines = TextUtilsModule.CodeMirrorUtils.pullLines;
55
-
56
51
  /** @constructor */
57
52
  TextUtils.CodeMirrorUtils.TokenizerFactory = TextUtilsModule.CodeMirrorUtils.TokenizerFactory;
@@ -332,7 +332,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements SDK.TargetManag
332
332
  show: (popover: UI.GlassPane.GlassPane): Promise<boolean> => {
333
333
  let animGroup;
334
334
  for (const [group, previewUI] of this.#previewMap) {
335
- if (previewUI.element === element.parentElement) {
335
+ if (previewUI.element === element || previewUI.element === element.parentElement) {
336
336
  animGroup = group;
337
337
  }
338
338
  }
@@ -281,10 +281,8 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
281
281
  this.cacheStorageListTreeElement = new ServiceWorkerCacheTreeElement(panel);
282
282
  cacheTreeElement.appendChild(this.cacheStorageListTreeElement);
283
283
 
284
- if (Root.Runtime.experiments.isEnabled('bfcacheDebugging')) {
285
- this.backForwardCacheListTreeElement = new BackForwardCacheTreeElement(panel);
286
- cacheTreeElement.appendChild(this.backForwardCacheListTreeElement);
287
- }
284
+ this.backForwardCacheListTreeElement = new BackForwardCacheTreeElement(panel);
285
+ cacheTreeElement.appendChild(this.backForwardCacheListTreeElement);
288
286
 
289
287
  if (Root.Runtime.experiments.isEnabled('backgroundServices')) {
290
288
  const backgroundServiceSectionTitle = i18nString(UIStrings.backgroundServices);
@@ -262,7 +262,14 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
262
262
 
263
263
  private renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
264
264
  return LitHtml.html`
265
- <li>${explanation.reason} : ${
265
+ <li>
266
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
267
+ iconName: 'circled_exclamation_icon',
268
+ color: 'orange',
269
+ width: '16px',
270
+ height: '16px',
271
+ } as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}>
272
+ ${explanation.reason} : ${
266
273
  (explanation.reason in NotRestoredReasonDescription) ?
267
274
  LitHtml.html`${NotRestoredReasonDescription[explanation.reason].name()}` :
268
275
  LitHtml.nothing} </li>
@@ -30,6 +30,8 @@ export class StyleEditorWidget extends UI.Widget.VBox {
30
30
  private section?: StylePropertiesSection;
31
31
  private editorContainer: HTMLElement;
32
32
 
33
+ #triggerKey: string|undefined;
34
+
33
35
  constructor() {
34
36
  super(true);
35
37
  this.contentElement.tabIndex = 0;
@@ -71,6 +73,14 @@ export class StyleEditorWidget extends UI.Widget.VBox {
71
73
  this.editor?.addEventListener('propertydeselected', this.onPropertyDeselected);
72
74
  }
73
75
 
76
+ setTriggerKey(value: string): void {
77
+ this.#triggerKey = value;
78
+ }
79
+
80
+ getTriggerKey(): string|undefined {
81
+ return this.#triggerKey;
82
+ }
83
+
74
84
  unbindContext(): void {
75
85
  this.pane = undefined;
76
86
  this.section = undefined;
@@ -105,8 +115,8 @@ export class StyleEditorWidget extends UI.Widget.VBox {
105
115
  }
106
116
 
107
117
  static createTriggerButton(
108
- pane: StylesSidebarPane, section: StylePropertiesSection, editorClass: {new(): Editor},
109
- buttonTitle: string): HTMLElement {
118
+ pane: StylesSidebarPane, section: StylePropertiesSection, editorClass: {new(): Editor}, buttonTitle: string,
119
+ triggerKey: string): HTMLElement {
110
120
  const triggerButton = createButton(buttonTitle);
111
121
 
112
122
  triggerButton.onclick = async(event): Promise<void> => {
@@ -115,6 +125,7 @@ export class StyleEditorWidget extends UI.Widget.VBox {
115
125
  const widget = StyleEditorWidget.instance();
116
126
  widget.setEditor(editorClass);
117
127
  widget.bindContext(pane, section);
128
+ widget.setTriggerKey(triggerKey);
118
129
  await widget.render();
119
130
  const scrollerElement = triggerButton.enclosingNodeOrSelfWithClass('style-panes-wrapper');
120
131
  const onScroll = (): void => {
@@ -668,21 +668,17 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
668
668
  const section = this.section();
669
669
  if (this.valueElement && section && section.editable && this.property.name === 'display') {
670
670
  const propertyValue = this.property.trimmedValueWithoutImportant();
671
- if (propertyValue === 'flex' || propertyValue === 'inline-flex') {
671
+ const isFlex = propertyValue === 'flex' || propertyValue === 'inline-flex';
672
+ const isGrid = propertyValue === 'grid' || propertyValue === 'inline-grid';
673
+ if (isFlex || isGrid) {
674
+ const key = `${section.getSectionIdx()}_${section.nextEditorTriggerButtonIdx}`;
672
675
  const button = StyleEditorWidget.createTriggerButton(
673
- this.parentPaneInternal, section, FlexboxEditor, i18nString(UIStrings.flexboxEditorButton));
676
+ this.parentPaneInternal, section, isFlex ? FlexboxEditor : GridEditor,
677
+ isFlex ? i18nString(UIStrings.flexboxEditorButton) : i18nString(UIStrings.gridEditorButton), key);
678
+ section.nextEditorTriggerButtonIdx++;
674
679
  this.listItemElement.appendChild(button);
675
680
  const helper = this.parentPaneInternal.swatchPopoverHelper();
676
- if (helper.isShowing(StyleEditorWidget.instance())) {
677
- helper.setAnchorElement(button);
678
- }
679
- }
680
- if (propertyValue === 'grid' || propertyValue === 'inline-grid') {
681
- const button = StyleEditorWidget.createTriggerButton(
682
- this.parentPaneInternal, section, GridEditor, i18nString(UIStrings.gridEditorButton));
683
- this.listItemElement.appendChild(button);
684
- const helper = this.parentPaneInternal.swatchPopoverHelper();
685
- if (helper.isShowing(StyleEditorWidget.instance())) {
681
+ if (helper.isShowing(StyleEditorWidget.instance()) && StyleEditorWidget.instance().getTriggerKey() === key) {
686
682
  helper.setAnchorElement(button);
687
683
  }
688
684
  }
@@ -832,6 +832,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
832
832
  this.idleCallbackManager = new IdleCallbackManager();
833
833
 
834
834
  const blocks = [new SectionBlock(null)];
835
+ let sectionIdx = 0;
835
836
  let lastParentNode: SDK.DOMModel.DOMNode|null = null;
836
837
  for (const style of matchedStyles.nodeStyles()) {
837
838
  const parentNode = matchedStyles.isInherited(style) ? matchedStyles.nodeForStyle(style) : null;
@@ -844,7 +845,8 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
844
845
  const lastBlock = blocks[blocks.length - 1];
845
846
  if (lastBlock) {
846
847
  this.idleCallbackManager.schedule(() => {
847
- const section = new StylePropertiesSection(this, matchedStyles, style);
848
+ const section = new StylePropertiesSection(this, matchedStyles, style, sectionIdx);
849
+ sectionIdx++;
848
850
  lastBlock.sections.push(section);
849
851
  });
850
852
  }
@@ -860,7 +862,8 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
860
862
  const block = SectionBlock.createPseudoTypeBlock(pseudoType);
861
863
  for (const style of matchedStyles.pseudoStyles(pseudoType)) {
862
864
  this.idleCallbackManager.schedule(() => {
863
- const section = new StylePropertiesSection(this, matchedStyles, style);
865
+ const section = new StylePropertiesSection(this, matchedStyles, style, sectionIdx);
866
+ sectionIdx++;
864
867
  block.sections.push(section);
865
868
  });
866
869
  }
@@ -871,7 +874,8 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
871
874
  const block = SectionBlock.createKeyframesBlock(keyframesRule.name().text);
872
875
  for (const keyframe of keyframesRule.keyframes()) {
873
876
  this.idleCallbackManager.schedule(() => {
874
- block.sections.push(new KeyframePropertiesSection(this, matchedStyles, keyframe.style));
877
+ block.sections.push(new KeyframePropertiesSection(this, matchedStyles, keyframe.style, sectionIdx));
878
+ sectionIdx++;
875
879
  });
876
880
  }
877
881
  blocks.push(block);
@@ -917,7 +921,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
917
921
  const node = this.node();
918
922
  const blankSection = new BlankStylePropertiesSection(
919
923
  this, insertAfterSection.matchedStyles, node ? node.simpleSelector() : '', styleSheetId, ruleLocation,
920
- insertAfterSection.style());
924
+ insertAfterSection.style(), 0);
921
925
 
922
926
  this.sectionsContainer.insertBefore(blankSection.element, insertAfterSection.element.nextSibling);
923
927
 
@@ -929,6 +933,13 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
929
933
  block.sections.splice(index + 1, 0, blankSection);
930
934
  blankSection.startEditingSelector();
931
935
  }
936
+ let sectionIdx = 0;
937
+ for (const block of this.sectionBlocks) {
938
+ for (const section of block.sections) {
939
+ section.setSectionIdx(sectionIdx);
940
+ sectionIdx++;
941
+ }
942
+ }
932
943
  }
933
944
 
934
945
  removeSection(section: StylePropertiesSection): void {
@@ -1208,10 +1219,15 @@ export class StylePropertiesSection {
1208
1219
 
1209
1220
  private queryListElement: HTMLElement;
1210
1221
 
1222
+ // Used to identify buttons that trigger a flexbox or grid editor.
1223
+ nextEditorTriggerButtonIdx = 1;
1224
+ private sectionIdx = 0;
1225
+
1211
1226
  constructor(
1212
1227
  parentPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
1213
- style: SDK.CSSStyleDeclaration.CSSStyleDeclaration) {
1228
+ style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
1214
1229
  this.parentPane = parentPane;
1230
+ this.sectionIdx = sectionIdx;
1215
1231
  this.styleInternal = style;
1216
1232
  this.matchedStyles = matchedStyles;
1217
1233
  this.editable = Boolean(style.styleSheetId && style.range);
@@ -1344,6 +1360,15 @@ export class StylePropertiesSection {
1344
1360
  this.onpopulate();
1345
1361
  }
1346
1362
 
1363
+ setSectionIdx(sectionIdx: number): void {
1364
+ this.sectionIdx = sectionIdx;
1365
+ this.onpopulate();
1366
+ }
1367
+
1368
+ getSectionIdx(): number {
1369
+ return this.sectionIdx;
1370
+ }
1371
+
1347
1372
  registerFontProperty(treeElement: StylePropertyTreeElement): void {
1348
1373
  if (this.fontEditorSectionManager) {
1349
1374
  this.fontEditorSectionManager.registerFontProperty(treeElement);
@@ -1935,6 +1960,7 @@ export class StylePropertiesSection {
1935
1960
 
1936
1961
  onpopulate(): void {
1937
1962
  this.parentPane.setActiveProperty(null);
1963
+ this.nextEditorTriggerButtonIdx = 1;
1938
1964
  this.propertiesTreeOutline.removeChildren();
1939
1965
  const style = this.styleInternal;
1940
1966
  let count = 0;
@@ -2457,10 +2483,10 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
2457
2483
  constructor(
2458
2484
  stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, defaultSelectorText: string,
2459
2485
  styleSheetId: Protocol.CSS.StyleSheetId, ruleLocation: TextUtils.TextRange.TextRange,
2460
- insertAfterStyle: SDK.CSSStyleDeclaration.CSSStyleDeclaration) {
2486
+ insertAfterStyle: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
2461
2487
  const cssModel = (stylesPane.cssModel() as SDK.CSSModel.CSSModel);
2462
2488
  const rule = SDK.CSSRule.CSSStyleRule.createDummyRule(cssModel, defaultSelectorText);
2463
- super(stylesPane, matchedStyles, rule.style);
2489
+ super(stylesPane, matchedStyles, rule.style, sectionIdx);
2464
2490
  this.normal = false;
2465
2491
  this.ruleLocation = ruleLocation;
2466
2492
  this.styleSheetId = styleSheetId;
@@ -2564,8 +2590,8 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
2564
2590
  export class KeyframePropertiesSection extends StylePropertiesSection {
2565
2591
  constructor(
2566
2592
  stylesPane: StylesSidebarPane, matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
2567
- style: SDK.CSSStyleDeclaration.CSSStyleDeclaration) {
2568
- super(stylesPane, matchedStyles, style);
2593
+ style: SDK.CSSStyleDeclaration.CSSStyleDeclaration, sectionIdx: number) {
2594
+ super(stylesPane, matchedStyles, style, sectionIdx);
2569
2595
  this.selectorElement.className = 'keyframe-key';
2570
2596
  }
2571
2597
 
@@ -186,19 +186,6 @@
186
186
  margin-right: 4px;
187
187
  }
188
188
 
189
- .CodeMirror {
190
- background-color: var(--color-background);
191
- height: 300px !important; /* stylelint-disable-line declaration-no-important */
192
- }
193
-
194
- .CodeMirror-lines {
195
- padding: 0;
196
- }
197
-
198
- .CodeMirror pre {
199
- padding: 0;
200
- }
201
-
202
189
  button,
203
190
  input,
204
191
  select {
@@ -50,6 +50,10 @@ const UIStrings = {
50
50
  * a set of checkboxes to override the content encodings supported by the browser.
51
51
  */
52
52
  acceptedEncoding: 'Accepted `Content-Encoding`s',
53
+ /**
54
+ * @description Status text for successful update of client hints.
55
+ */
56
+ clientHintsStatusText: 'User agent updated.',
53
57
  };
54
58
  const str_ = i18n.i18n.registerUIStrings('panels/network/NetworkConfigView.ts', UIStrings);
55
59
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -246,10 +250,12 @@ export class NetworkConfigView extends UI.Widget.VBox {
246
250
  showMobileCheckbox: true,
247
251
  showSubmitButton: true,
248
252
  };
253
+ userAgentUpdateButtonStatusText.textContent = '';
249
254
  });
250
255
 
251
256
  clientHints.addEventListener('clienthintschange', () => {
252
257
  customSelectAndInput.select.value = 'custom';
258
+ userAgentUpdateButtonStatusText.textContent = '';
253
259
  });
254
260
 
255
261
  clientHints.addEventListener('clienthintssubmit', (event: Event) => {
@@ -257,8 +263,12 @@ export class NetworkConfigView extends UI.Widget.VBox {
257
263
  const customUA = customUserAgentSetting.get();
258
264
  userAgentMetadataSetting.set(metaData);
259
265
  SDK.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(customUA, metaData);
266
+ userAgentUpdateButtonStatusText.textContent = i18nString(UIStrings.clientHintsStatusText);
260
267
  });
261
268
 
269
+ const userAgentUpdateButtonStatusText = section.createChild('span', 'status-text');
270
+ userAgentUpdateButtonStatusText.textContent = '';
271
+
262
272
  userAgentSelectBoxChanged();
263
273
 
264
274
  function userAgentSelectBoxChanged(): void {
@@ -250,6 +250,9 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
250
250
  }
251
251
 
252
252
  private async maybeAppendPayloadPanel(): Promise<void> {
253
+ if (this.hasTab('payload')) {
254
+ return;
255
+ }
253
256
  if (this.requestInternal.queryParameters || await this.requestInternal.requestFormData()) {
254
257
  this.payloadView = new RequestPayloadView(this.requestInternal);
255
258
  this.appendTab(
@@ -270,7 +273,13 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
270
273
 
271
274
  private selectTabInternal(tabId: string): void {
272
275
  if (!this.selectTab(tabId)) {
273
- this.selectTab('headers');
276
+ // maybeAppendPayloadPanel might cause payload tab to appear asynchronously, so
277
+ // it makes sense to retry on the next tick
278
+ setTimeout(() => {
279
+ if (!this.selectTab(tabId)) {
280
+ this.selectTab('headers');
281
+ }
282
+ }, 0);
274
283
  }
275
284
  }
276
285
 
@@ -99,3 +99,8 @@
99
99
  margin-top: 14px;
100
100
  width: min(100%, 400px);
101
101
  }
102
+
103
+ .status-text {
104
+ padding: 10px;
105
+ color: var(--color-accent-green);
106
+ }