chrome-devtools-frontend 1.0.927127 → 1.0.928589

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 (144) hide show
  1. package/AUTHORS +1 -0
  2. package/config/gni/all_devtools_files.gni +0 -1
  3. package/config/gni/devtools_grd_files.gni +30 -4
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/Images/src/ic_preview_feature.svg +3 -0
  6. package/front_end/Tests.js +2 -3
  7. package/front_end/core/common/Settings.ts +26 -45
  8. package/front_end/core/host/UserMetrics.ts +2 -2
  9. package/front_end/core/i18n/locales/en-US.json +60 -15
  10. package/front_end/core/i18n/locales/en-XL.json +60 -15
  11. package/front_end/core/platform/keyboard-utilities.ts +1 -0
  12. package/front_end/core/root/Runtime.ts +62 -61
  13. package/front_end/core/sdk/AccessibilityModel.ts +73 -73
  14. package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
  15. package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
  16. package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
  17. package/front_end/core/sdk/CSSFontFace.ts +10 -10
  18. package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
  19. package/front_end/core/sdk/CSSMedia.ts +22 -22
  20. package/front_end/core/sdk/CSSMetadata.ts +53 -49
  21. package/front_end/core/sdk/CSSModel.ts +139 -135
  22. package/front_end/core/sdk/CSSProperty.ts +18 -18
  23. package/front_end/core/sdk/CSSRule.ts +15 -15
  24. package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
  25. package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
  26. package/front_end/core/sdk/ChildTargetManager.ts +41 -40
  27. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
  28. package/front_end/core/sdk/Connections.ts +81 -81
  29. package/front_end/core/sdk/ConsoleModel.ts +68 -68
  30. package/front_end/core/sdk/Cookie.ts +48 -48
  31. package/front_end/core/sdk/CookieModel.ts +13 -13
  32. package/front_end/core/sdk/CookieParser.ts +45 -45
  33. package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
  34. package/front_end/core/sdk/DOMModel.ts +264 -252
  35. package/front_end/core/sdk/DebuggerModel.ts +209 -205
  36. package/front_end/core/sdk/EmulationModel.ts +76 -76
  37. package/front_end/core/sdk/FilmStripModel.ts +29 -29
  38. package/front_end/core/sdk/FrameManager.ts +43 -42
  39. package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
  40. package/front_end/core/sdk/IsolateManager.ts +82 -82
  41. package/front_end/core/sdk/IssuesModel.ts +6 -6
  42. package/front_end/core/sdk/LayerTreeBase.ts +37 -37
  43. package/front_end/core/sdk/LogModel.ts +5 -5
  44. package/front_end/core/sdk/NetworkManager.ts +229 -225
  45. package/front_end/core/sdk/NetworkRequest.ts +368 -360
  46. package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
  47. package/front_end/core/sdk/OverlayModel.ts +155 -153
  48. package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
  49. package/front_end/core/sdk/PageResourceLoader.ts +30 -30
  50. package/front_end/core/sdk/PaintProfiler.ts +16 -16
  51. package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
  52. package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
  53. package/front_end/core/sdk/RemoteObject.ts +108 -104
  54. package/front_end/core/sdk/Resource.ts +85 -84
  55. package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
  56. package/front_end/core/sdk/RuntimeModel.ts +38 -34
  57. package/front_end/core/sdk/SDKModel.ts +3 -3
  58. package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
  59. package/front_end/core/sdk/Script.ts +29 -29
  60. package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
  61. package/front_end/core/sdk/ServerTiming.ts +2 -2
  62. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
  63. package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
  64. package/front_end/core/sdk/SourceMap.ts +40 -36
  65. package/front_end/core/sdk/SourceMapManager.ts +57 -57
  66. package/front_end/core/sdk/Target.ts +64 -63
  67. package/front_end/core/sdk/TargetManager.ts +60 -56
  68. package/front_end/core/sdk/TracingManager.ts +39 -39
  69. package/front_end/core/sdk/TracingModel.ts +125 -125
  70. package/front_end/core/sdk/WebAuthnModel.ts +9 -9
  71. package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
  72. package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
  73. package/front_end/entrypoints/main/MainImpl.ts +7 -2
  74. package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
  75. package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
  76. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
  77. package/front_end/models/issues_manager/GenericIssue.ts +86 -0
  78. package/front_end/models/issues_manager/Issue.ts +24 -0
  79. package/front_end/models/issues_manager/IssuesManager.ts +18 -6
  80. package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
  81. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  82. package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
  83. package/front_end/panels/console/ConsoleSidebar.ts +0 -3
  84. package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
  85. package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
  86. package/front_end/panels/elements/components/LayoutPane.ts +5 -1
  87. package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
  88. package/front_end/panels/issues/IssueAggregator.ts +16 -0
  89. package/front_end/panels/issues/IssueKindView.ts +95 -0
  90. package/front_end/panels/issues/IssueView.ts +6 -0
  91. package/front_end/panels/issues/IssuesPane.ts +81 -18
  92. package/front_end/panels/issues/issuesTree.css +8 -3
  93. package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
  94. package/front_end/panels/network/NetworkItemView.ts +1 -1
  95. package/front_end/panels/network/networkLogView.css +5 -0
  96. package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
  97. package/front_end/panels/settings/SettingsScreen.ts +1 -0
  98. package/front_end/panels/settings/settingsScreen.css +24 -0
  99. package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
  100. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  101. package/front_end/panels/sources/sources-meta.ts +22 -7
  102. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  103. package/front_end/third_party/codemirror.next/package.json +4 -4
  104. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
  105. package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
  106. package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
  107. package/front_end/ui/components/docs/text_editor/basic.html +28 -0
  108. package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
  109. package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
  110. package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
  111. package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
  112. package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
  113. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
  114. package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
  115. package/front_end/ui/components/text_editor/config.ts +264 -0
  116. package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
  117. package/front_end/ui/components/text_editor/theme.ts +113 -0
  118. package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
  119. package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
  120. package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
  121. package/front_end/ui/legacy/ARIAUtils.ts +14 -11
  122. package/front_end/ui/legacy/TabbedPane.ts +32 -3
  123. package/front_end/ui/legacy/UIUtils.ts +3 -1
  124. package/front_end/ui/legacy/View.ts +6 -0
  125. package/front_end/ui/legacy/ViewManager.ts +5 -1
  126. package/front_end/ui/legacy/ViewRegistration.ts +5 -0
  127. package/front_end/ui/legacy/XLink.ts +1 -1
  128. package/front_end/ui/legacy/closeButton.css +6 -0
  129. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
  130. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
  131. package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
  132. package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
  133. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
  134. package/front_end/ui/legacy/filter.css +1 -0
  135. package/front_end/ui/legacy/tabbedPane.css +24 -0
  136. package/front_end/ui/legacy/toolbar.css +5 -0
  137. package/inspector_overlay/main.ts +2 -1
  138. package/inspector_overlay/tool_screenshot.ts +8 -1
  139. package/package.json +1 -1
  140. package/scripts/build/rollup.config.js +9 -0
  141. package/scripts/migration/class-fields/migrate.js +56 -0
  142. package/scripts/migration/class-fields/package.json +5 -0
  143. package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
  144. package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
@@ -1,3 +1,7 @@
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
+
1
5
  /*
2
6
  * Copyright (C) 2010 Nikita Vasilyev. All rights reserved.
3
7
  * Copyright (C) 2010 Joseph Pecoraro. All rights reserved.
@@ -13,7 +17,7 @@
13
17
  * copyright notice, this list of conditions and the following disclaimer
14
18
  * in the documentation and/or other materials provided with the
15
19
  * distribution.
16
- * * Neither the name of Google Inc. nor the names of its
20
+ * * Neither the #name of Google Inc. nor the names of its
17
21
  * contributors may be used to endorse or promote products derived from
18
22
  * this software without specific prior written permission.
19
23
  *
@@ -35,58 +39,58 @@ import * as Common from '../common/common.js';
35
39
  import * as Platform from '../platform/platform.js';
36
40
 
37
41
  export class CSSMetadata {
38
- private readonly values: string[];
39
- private readonly longhands: Map<string, string[]>;
40
- private readonly shorthands: Map<string, string[]>;
41
- private readonly inherited: Set<string>;
42
- private readonly svgProperties: Set<string>;
43
- private readonly propertyValues: Map<string, string[]>;
44
- private readonly aliasesFor: Map<string, string>;
45
- private valuesSet: Set<string>;
46
- private readonly nameValuePresetsInternal: string[];
47
- private readonly nameValuePresetsIncludingSVG: string[];
42
+ readonly #values: string[];
43
+ readonly #longhands: Map<string, string[]>;
44
+ readonly #shorthands: Map<string, string[]>;
45
+ readonly #inherited: Set<string>;
46
+ readonly #svgProperties: Set<string>;
47
+ readonly #propertyValues: Map<string, string[]>;
48
+ readonly #aliasesFor: Map<string, string>;
49
+ #valuesSet: Set<string>;
50
+ readonly #nameValuePresetsInternal: string[];
51
+ readonly #nameValuePresetsIncludingSVG: string[];
48
52
 
49
53
  constructor(properties: CSSPropertyDefinition[], aliasesFor: Map<string, string>) {
50
- this.values = [];
51
- this.longhands = new Map();
52
- this.shorthands = new Map();
53
- this.inherited = new Set();
54
- this.svgProperties = new Set();
55
- this.propertyValues = new Map();
56
- this.aliasesFor = aliasesFor;
54
+ this.#values = [];
55
+ this.#longhands = new Map();
56
+ this.#shorthands = new Map();
57
+ this.#inherited = new Set();
58
+ this.#svgProperties = new Set();
59
+ this.#propertyValues = new Map();
60
+ this.#aliasesFor = aliasesFor;
57
61
  for (let i = 0; i < properties.length; ++i) {
58
62
  const property = properties[i];
59
63
  const propertyName = property.name;
60
64
  if (!CSS.supports(propertyName, 'initial')) {
61
65
  continue;
62
66
  }
63
- this.values.push(propertyName);
67
+ this.#values.push(propertyName);
64
68
 
65
69
  if (property.inherited) {
66
- this.inherited.add(propertyName);
70
+ this.#inherited.add(propertyName);
67
71
  }
68
72
  if (property.svg) {
69
- this.svgProperties.add(propertyName);
73
+ this.#svgProperties.add(propertyName);
70
74
  }
71
75
 
72
76
  const longhands = properties[i].longhands;
73
77
  if (longhands) {
74
- this.longhands.set(propertyName, longhands);
78
+ this.#longhands.set(propertyName, longhands);
75
79
  for (let j = 0; j < longhands.length; ++j) {
76
80
  const longhandName = longhands[j];
77
- let shorthands = this.shorthands.get(longhandName);
81
+ let shorthands = this.#shorthands.get(longhandName);
78
82
  if (!shorthands) {
79
83
  shorthands = [];
80
- this.shorthands.set(longhandName, shorthands);
84
+ this.#shorthands.set(longhandName, shorthands);
81
85
  }
82
86
  shorthands.push(propertyName);
83
87
  }
84
88
  }
85
89
  }
86
- this.values.sort(CSSMetadata.sortPrefixesToEnd);
87
- this.valuesSet = new Set(this.values);
90
+ this.#values.sort(CSSMetadata.sortPrefixesToEnd);
91
+ this.#valuesSet = new Set(this.#values);
88
92
 
89
- // Reads in auto-generated property names and values from blink/public/renderer/core/css/css_properties.json5
93
+ // Reads in auto-generated property names and #values from blink/public/renderer/core/css/css_properties.json5
90
94
  // treats _generatedPropertyValues as basis
91
95
  const propertyValueSets = new Map<string, Set<string>>();
92
96
  for (const [propertyName, basisValueObj] of Object.entries(SupportedCSSProperties.generatedPropertyValues)) {
@@ -101,7 +105,7 @@ export class CSSMetadata {
101
105
  propertyValueSets.set(propertyName, new Set(extraValueObj.values));
102
106
  }
103
107
  }
104
- // finally add common keywords to value sets and convert property values
108
+ // finally add common keywords to value sets and convert property #values
105
109
  // into arrays since callers expect arrays
106
110
  for (const [propertyName, values] of propertyValueSets) {
107
111
  for (const commonKeyword of CommonKeywords) {
@@ -110,20 +114,20 @@ export class CSSMetadata {
110
114
  }
111
115
  }
112
116
 
113
- this.propertyValues.set(propertyName, [...values]);
117
+ this.#propertyValues.set(propertyName, [...values]);
114
118
  }
115
119
 
116
- this.nameValuePresetsInternal = [];
117
- this.nameValuePresetsIncludingSVG = [];
118
- for (const name of this.valuesSet) {
120
+ this.#nameValuePresetsInternal = [];
121
+ this.#nameValuePresetsIncludingSVG = [];
122
+ for (const name of this.#valuesSet) {
119
123
  const values = this.specificPropertyValues(name)
120
124
  .filter(value => CSS.supports(name, value))
121
125
  .sort(CSSMetadata.sortPrefixesToEnd);
122
126
  const presets = values.map(value => `${name}: ${value}`);
123
127
  if (!this.isSVGProperty(name)) {
124
- this.nameValuePresetsInternal.push(...presets);
128
+ this.#nameValuePresetsInternal.push(...presets);
125
129
  }
126
- this.nameValuePresetsIncludingSVG.push(...presets);
130
+ this.#nameValuePresetsIncludingSVG.push(...presets);
127
131
  }
128
132
  }
129
133
 
@@ -140,24 +144,24 @@ export class CSSMetadata {
140
144
  }
141
145
 
142
146
  allProperties(): string[] {
143
- return this.values;
147
+ return this.#values;
144
148
  }
145
149
 
146
150
  nameValuePresets(includeSVG?: boolean): string[] {
147
- return includeSVG ? this.nameValuePresetsIncludingSVG : this.nameValuePresetsInternal;
151
+ return includeSVG ? this.#nameValuePresetsIncludingSVG : this.#nameValuePresetsInternal;
148
152
  }
149
153
 
150
154
  isSVGProperty(name: string): boolean {
151
155
  name = name.toLowerCase();
152
- return this.svgProperties.has(name);
156
+ return this.#svgProperties.has(name);
153
157
  }
154
158
 
155
159
  getLonghands(shorthand: string): string[]|null {
156
- return this.longhands.get(shorthand) || null;
160
+ return this.#longhands.get(shorthand) || null;
157
161
  }
158
162
 
159
163
  getShorthands(longhand: string): string[]|null {
160
- return this.shorthands.get(longhand) || null;
164
+ return this.#shorthands.get(longhand) || null;
161
165
  }
162
166
 
163
167
  isColorAwareProperty(propertyName: string): boolean {
@@ -212,7 +216,7 @@ export class CSSMetadata {
212
216
  isStringProperty(propertyName: string): boolean {
213
217
  propertyName = propertyName.toLowerCase();
214
218
  // TODO(crbug.com/1033910): Generalize this to all CSS properties
215
- // that accept <string> values.
219
+ // that accept <string> #values.
216
220
  return propertyName === 'content';
217
221
  }
218
222
 
@@ -222,7 +226,7 @@ export class CSSMetadata {
222
226
  }
223
227
  name = name.toLowerCase();
224
228
 
225
- const aliasFor = this.aliasesFor.get(name);
229
+ const aliasFor = this.#aliasesFor.get(name);
226
230
  if (aliasFor) {
227
231
  return aliasFor;
228
232
  }
@@ -231,7 +235,7 @@ export class CSSMetadata {
231
235
  return name;
232
236
  }
233
237
  const match = name.match(/(?:-webkit-)(.+)/);
234
- if (!match || !this.valuesSet.has(match[1])) {
238
+ if (!match || !this.#valuesSet.has(match[1])) {
235
239
  return name;
236
240
  }
237
241
  return match[1];
@@ -243,19 +247,19 @@ export class CSSMetadata {
243
247
  propertyName.startsWith('-ms-') || propertyName.startsWith('-o-') || propertyName.startsWith('-webkit-')) {
244
248
  return true;
245
249
  }
246
- return this.valuesSet.has(propertyName);
250
+ return this.#valuesSet.has(propertyName);
247
251
  }
248
252
 
249
253
  isPropertyInherited(propertyName: string): boolean {
250
254
  propertyName = propertyName.toLowerCase();
251
- return propertyName.startsWith('--') || this.inherited.has(this.canonicalPropertyName(propertyName)) ||
252
- this.inherited.has(propertyName);
255
+ return propertyName.startsWith('--') || this.#inherited.has(this.canonicalPropertyName(propertyName)) ||
256
+ this.#inherited.has(propertyName);
253
257
  }
254
258
 
255
259
  private specificPropertyValues(propertyName: string): string[] {
256
260
  const unprefixedName = propertyName.replace(/^-webkit-/, '');
257
- const propertyValues = this.propertyValues;
258
- // propertyValues acts like cache; missing properties are added with possible common keywords
261
+ const propertyValues = this.#propertyValues;
262
+ // #propertyValues acts like cache; missing properties are added with possible common keywords
259
263
  let keywords: (string[]|undefined) = propertyValues.get(propertyName) || propertyValues.get(unprefixedName);
260
264
  if (!keywords) {
261
265
  keywords = [];
@@ -318,7 +322,7 @@ export const URLRegex = /url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g;
318
322
  * "a a ."
319
323
  *
320
324
  * 'grid', 'grid-template', e.g.
321
- * [track-name] "a a ." minmax(50px, auto) [track-name]
325
+ * [track-#name] "a a ." minmax(50px, auto) [track-#name]
322
326
  */
323
327
  export const GridAreaRowRegex = /((?:\[[\w\- ]+\]\s*)*(?:"[^"]+"|'[^']+'))[^'"\[]*\[?[^'"\[]*/;
324
328
 
@@ -494,7 +498,7 @@ const angleAwareProperties = new Set<string>([
494
498
  'font-style',
495
499
  ]);
496
500
 
497
- // manually maintained list of property values to add into autocomplete list
501
+ // manually maintained list of property #values to add into autocomplete list
498
502
  const extraPropertyValues = {
499
503
  'background-repeat': {values: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space', 'round']},
500
504
  'content': {values: ['normal', 'close-quote', 'no-close-quote', 'no-open-quote', 'open-quote']},