chrome-devtools-frontend 1.0.980472 → 1.0.982087

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 (65) hide show
  1. package/front_end/core/common/ParsedURL.ts +42 -4
  2. package/front_end/core/host/InspectorFrontendHost.ts +7 -6
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +8 -8
  4. package/front_end/core/i18n/locales/en-US.json +15 -0
  5. package/front_end/core/i18n/locales/en-XL.json +15 -0
  6. package/front_end/core/platform/DevToolsPath.ts +3 -0
  7. package/front_end/core/sdk/CSSRule.ts +2 -2
  8. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -2
  9. package/front_end/core/sdk/NetworkRequest.ts +1 -1
  10. package/front_end/core/sdk/SourceMap.ts +14 -5
  11. package/front_end/core/sdk/Target.ts +4 -3
  12. package/front_end/generated/InspectorBackendCommands.js +6 -2
  13. package/front_end/generated/protocol.ts +16 -0
  14. package/front_end/legacy_test_runner/bindings_test_runner/BindingsTestRunner.js +5 -0
  15. package/front_end/models/bindings/BreakpointManager.ts +0 -2
  16. package/front_end/models/bindings/ContentProviderBasedProject.ts +6 -4
  17. package/front_end/models/bindings/FileUtils.ts +3 -2
  18. package/front_end/models/persistence/EditFileSystemView.ts +3 -1
  19. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +14 -9
  20. package/front_end/models/persistence/IsolatedFileSystem.ts +66 -40
  21. package/front_end/models/persistence/IsolatedFileSystemManager.ts +4 -3
  22. package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -5
  23. package/front_end/models/persistence/PlatformFileSystem.ts +15 -10
  24. package/front_end/models/timeline_model/TimelineModel.ts +1 -0
  25. package/front_end/models/workspace/FileManager.ts +9 -6
  26. package/front_end/models/workspace/UISourceCode.ts +4 -2
  27. package/front_end/models/workspace/WorkspaceImpl.ts +9 -5
  28. package/front_end/panels/application/BackgroundServiceView.ts +2 -1
  29. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  30. package/front_end/panels/console/ConsoleFormat.ts +23 -0
  31. package/front_end/panels/console/ConsoleView.ts +3 -1
  32. package/front_end/panels/console/ConsoleViewMessage.ts +3 -19
  33. package/front_end/panels/coverage/CoverageView.ts +2 -1
  34. package/front_end/panels/emulation/AdvancedApp.ts +6 -2
  35. package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -1
  36. package/front_end/panels/input/InputTimeline.ts +2 -1
  37. package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -1
  38. package/front_end/panels/network/NetworkLogView.ts +2 -2
  39. package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -2
  40. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -2
  41. package/front_end/panels/profiler/ProfileView.ts +2 -2
  42. package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +4 -2
  43. package/front_end/panels/screencast/ScreencastView.ts +4 -1
  44. package/front_end/panels/settings/SettingsScreen.ts +4 -1
  45. package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +25 -19
  46. package/front_end/panels/sources/NavigatorView.ts +9 -5
  47. package/front_end/panels/sources/SourcesNavigator.ts +2 -2
  48. package/front_end/panels/sources/components/HeadersView.css +17 -2
  49. package/front_end/panels/sources/components/HeadersView.ts +102 -0
  50. package/front_end/panels/timeline/TimelinePanel.ts +2 -1
  51. package/front_end/panels/timeline/TimelineUIUtils.ts +7 -0
  52. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +963 -886
  53. package/front_end/third_party/lighthouse/report/bundle.js +3 -2
  54. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  55. package/front_end/ui/components/buttons/Button.ts +11 -1
  56. package/front_end/ui/components/buttons/button.css +31 -10
  57. package/front_end/ui/components/docs/button/basic.ts +47 -1
  58. package/front_end/ui/components/panel_feedback/FeedbackButton.ts +4 -1
  59. package/front_end/ui/legacy/XLink.ts +8 -3
  60. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +3 -1
  61. package/front_end/ui/legacy/components/utils/ImagePreview.ts +6 -2
  62. package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -2
  63. package/front_end/ui/legacy/tabbedPane.css +1 -0
  64. package/front_end/ui/legacy/themeColors.css +4 -0
  65. package/package.json +1 -1
@@ -64,6 +64,16 @@ export function normalizePath(path: string): string {
64
64
  return normalizedPath;
65
65
  }
66
66
 
67
+ /**
68
+ * File paths in DevTools that are represented either as unencoded absolute or relative paths, or encoded paths, or URLs.
69
+ * @example
70
+ * RawPathString: “/Hello World/file.js”
71
+ * EncodedPathString: “/Hello%20World/file.js”
72
+ * UrlString: “file:///Hello%20World/file/js”
73
+ */
74
+ type BrandedPathString =
75
+ Platform.DevToolsPath.UrlString|Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.EncodedPathString;
76
+
67
77
  export class ParsedURL {
68
78
  isValid: boolean;
69
79
  url: string;
@@ -215,18 +225,46 @@ export class ParsedURL {
215
225
  return decodedFileURL.substr('file://'.length) as Platform.DevToolsPath.RawPathString;
216
226
  }
217
227
 
218
- static substr<DevToolsPathType extends Platform.DevToolsPath.UrlString|Platform.DevToolsPath.RawPathString|
219
- Platform.DevToolsPath.EncodedPathString>(
228
+ static sliceUrlToEncodedPathString(url: Platform.DevToolsPath.UrlString, start: number):
229
+ Platform.DevToolsPath.EncodedPathString {
230
+ return url.substring(start) as Platform.DevToolsPath.EncodedPathString;
231
+ }
232
+
233
+ static substr<DevToolsPathType extends BrandedPathString>(
220
234
  devToolsPath: DevToolsPathType, from: number, length?: number): DevToolsPathType {
221
235
  return devToolsPath.substr(from, length) as DevToolsPathType;
222
236
  }
223
237
 
224
- static concatenate<DevToolsPathType extends Platform.DevToolsPath.UrlString|Platform.DevToolsPath
225
- .RawPathString|Platform.DevToolsPath.EncodedPathString>(
238
+ static substring<DevToolsPathType extends BrandedPathString>(
239
+ devToolsPath: DevToolsPathType, start: number, end?: number): DevToolsPathType {
240
+ return devToolsPath.substring(start, end) as DevToolsPathType;
241
+ }
242
+
243
+ static prepend<DevToolsPathType extends BrandedPathString>(prefix: string, devToolsPath: DevToolsPathType):
244
+ DevToolsPathType {
245
+ return prefix + devToolsPath as DevToolsPathType;
246
+ }
247
+
248
+ static concatenate<DevToolsPathType extends BrandedPathString>(
226
249
  devToolsPath: DevToolsPathType, ...appendage: string[]): DevToolsPathType {
227
250
  return devToolsPath.concat(...appendage) as DevToolsPathType;
228
251
  }
229
252
 
253
+ static trim<DevToolsPathType extends BrandedPathString>(devToolsPath: DevToolsPathType): DevToolsPathType {
254
+ return devToolsPath.trim() as DevToolsPathType;
255
+ }
256
+
257
+ static slice<DevToolsPathType extends BrandedPathString>(
258
+ devToolsPath: DevToolsPathType, start?: number, end?: number): DevToolsPathType {
259
+ return devToolsPath.slice(start, end) as DevToolsPathType;
260
+ }
261
+
262
+ static join<DevToolsPathType extends Platform.DevToolsPath.UrlString|Platform.DevToolsPath.RawPathString|
263
+ Platform.DevToolsPath.EncodedPathString>(
264
+ devToolsPaths: DevToolsPathType[], separator?: string): DevToolsPathType {
265
+ return devToolsPaths.join(separator) as DevToolsPathType;
266
+ }
267
+
230
268
  static urlWithoutHash(url: string): string {
231
269
  const hashIndex = url.indexOf('#');
232
270
  if (hashIndex !== -1) {
@@ -53,7 +53,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
53
53
  const MAX_RECORDED_HISTOGRAMS_SIZE = 100;
54
54
 
55
55
  export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
56
- readonly #urlsBeingSaved: Map<string, string[]>;
56
+ readonly #urlsBeingSaved: Map<Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString, string[]>;
57
57
  events!: Common.EventTarget.EventTarget<EventTypes>;
58
58
 
59
59
  recordedEnumeratedHistograms: {actionName: EnumeratedHistogram, actionCode: number}[] = [];
@@ -122,7 +122,7 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
122
122
  setInjectedScriptForOrigin(origin: string, script: string): void {
123
123
  }
124
124
 
125
- inspectedURLChanged(url: string): void {
125
+ inspectedURLChanged(url: Platform.DevToolsPath.UrlString): void {
126
126
  document.title = i18nString(UIStrings.devtoolsS, {PH1: url.replace(/^https?:\/\//, '')});
127
127
  }
128
128
 
@@ -133,7 +133,7 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
133
133
  void navigator.clipboard.writeText(text);
134
134
  }
135
135
 
136
- openInNewTab(url: string): void {
136
+ openInNewTab(url: Platform.DevToolsPath.UrlString): void {
137
137
  window.open(url, '_blank');
138
138
  }
139
139
 
@@ -142,7 +142,8 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
142
142
  'Show item in folder is not enabled in hosted mode. Please inspect using chrome://inspect');
143
143
  }
144
144
 
145
- save(url: string, content: string, forceSaveAs: boolean): void {
145
+ save(url: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString, content: string, forceSaveAs: boolean):
146
+ void {
146
147
  let buffer = this.#urlsBeingSaved.get(url);
147
148
  if (!buffer) {
148
149
  buffer = [];
@@ -152,7 +153,7 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
152
153
  this.events.dispatchEventToListeners(Events.SavedURL, {url, fileSystemPath: url});
153
154
  }
154
155
 
155
- append(url: string, content: string): void {
156
+ append(url: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString, content: string): void {
156
157
  const buffer = this.#urlsBeingSaved.get(url);
157
158
  if (buffer) {
158
159
  buffer.push(content);
@@ -160,7 +161,7 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
160
161
  }
161
162
  }
162
163
 
163
- close(url: string): void {
164
+ close(url: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString): void {
164
165
  const buffer = this.#urlsBeingSaved.get(url) || [];
165
166
  this.#urlsBeingSaved.delete(url);
166
167
  let fileName = '';
@@ -127,8 +127,8 @@ export interface RevealSourceLineEvent {
127
127
  }
128
128
 
129
129
  export interface SavedURLEvent {
130
- url: string;
131
- fileSystemPath: string;
130
+ url: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString;
131
+ fileSystemPath: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString;
132
132
  }
133
133
 
134
134
  export interface SearchCompletedEvent {
@@ -142,8 +142,8 @@ export interface SearchCompletedEvent {
142
142
  // Please note that the "dispatch" side can't be type-checked as the dispatch is
143
143
  // done dynamically.
144
144
  export type EventTypes = {
145
- [Events.AppendedToURL]: string,
146
- [Events.CanceledSaveURL]: string,
145
+ [Events.AppendedToURL]: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString,
146
+ [Events.CanceledSaveURL]: Platform.DevToolsPath.UrlString,
147
147
  [Events.ContextMenuCleared]: void,
148
148
  [Events.ContextMenuItemSelected]: number,
149
149
  [Events.DeviceCountUpdated]: number,
@@ -197,7 +197,7 @@ export interface InspectorFrontendHostAPI {
197
197
 
198
198
  inspectElementCompleted(): void;
199
199
 
200
- openInNewTab(url: string): void;
200
+ openInNewTab(url: Platform.DevToolsPath.UrlString): void;
201
201
 
202
202
  showItemInFolder(fileSystemPath: string): void;
203
203
 
@@ -205,11 +205,11 @@ export interface InspectorFrontendHostAPI {
205
205
 
206
206
  requestFileSystems(): void;
207
207
 
208
- save(url: string, content: string, forceSaveAs: boolean): void;
208
+ save(url: Platform.DevToolsPath.UrlString, content: string, forceSaveAs: boolean): void;
209
209
 
210
- append(url: string, content: string): void;
210
+ append(url: Platform.DevToolsPath.UrlString, content: string): void;
211
211
 
212
- close(url: string): void;
212
+ close(url: Platform.DevToolsPath.UrlString): void;
213
213
 
214
214
  searchInPath(requestId: number, fileSystemPath: string, query: string): void;
215
215
 
@@ -9245,12 +9245,24 @@
9245
9245
  "panels/sources/CallStackSidebarPane.ts | showMore": {
9246
9246
  "message": "Show more"
9247
9247
  },
9248
+ "panels/sources/components/HeadersView.ts | addHeader": {
9249
+ "message": "Add a header"
9250
+ },
9251
+ "panels/sources/components/HeadersView.ts | addHeaderOverride": {
9252
+ "message": "Add header override"
9253
+ },
9248
9254
  "panels/sources/components/HeadersView.ts | errorWhenParsing": {
9249
9255
  "message": "Error when parsing ''{PH1}''."
9250
9256
  },
9251
9257
  "panels/sources/components/HeadersView.ts | parsingErrorExplainer": {
9252
9258
  "message": "This is most likely due to a syntax error in ''{PH1}''. Try opening this file in an external editor to fix the error or delete the file and re-create the override."
9253
9259
  },
9260
+ "panels/sources/components/HeadersView.ts | removeBlock": {
9261
+ "message": "Remove this 'ApplyTo'-section"
9262
+ },
9263
+ "panels/sources/components/HeadersView.ts | removeHeader": {
9264
+ "message": "Remove this header"
9265
+ },
9254
9266
  "panels/sources/CoveragePlugin.ts | clickToShowCoveragePanel": {
9255
9267
  "message": "Click to show Coverage Panel"
9256
9268
  },
@@ -10991,6 +11003,9 @@
10991
11003
  "panels/timeline/TimelineUIUtils.ts | pinchUpdate": {
10992
11004
  "message": "Pinch Update"
10993
11005
  },
11006
+ "panels/timeline/TimelineUIUtils.ts | prePaint": {
11007
+ "message": "Pre-Paint"
11008
+ },
10994
11009
  "panels/timeline/TimelineUIUtils.ts | preview": {
10995
11010
  "message": "Preview"
10996
11011
  },
@@ -9245,12 +9245,24 @@
9245
9245
  "panels/sources/CallStackSidebarPane.ts | showMore": {
9246
9246
  "message": "Ŝh́ôẃ m̂ór̂é"
9247
9247
  },
9248
+ "panels/sources/components/HeadersView.ts | addHeader": {
9249
+ "message": "Âd́d̂ á ĥéâd́êŕ"
9250
+ },
9251
+ "panels/sources/components/HeadersView.ts | addHeaderOverride": {
9252
+ "message": "Âd́d̂ h́êád̂ér̂ óv̂ér̂ŕîd́ê"
9253
+ },
9248
9254
  "panels/sources/components/HeadersView.ts | errorWhenParsing": {
9249
9255
  "message": "Êŕr̂ór̂ ẃĥén̂ ṕâŕŝín̂ǵ ''{PH1}''."
9250
9256
  },
9251
9257
  "panels/sources/components/HeadersView.ts | parsingErrorExplainer": {
9252
9258
  "message": "T̂h́îś îś m̂óŝt́ l̂ík̂él̂ý d̂úê t́ô á ŝýn̂t́âx́ êŕr̂ór̂ ín̂ ''{PH1}''. T́r̂ý ôṕêńîńĝ t́ĥíŝ f́îĺê ín̂ án̂ éx̂t́êŕn̂ál̂ éd̂ít̂ór̂ t́ô f́îx́ t̂h́ê ér̂ŕôŕ ôŕ d̂él̂ét̂é t̂h́ê f́îĺê án̂d́ r̂é-ĉŕêát̂é t̂h́ê óv̂ér̂ŕîd́ê."
9253
9259
  },
9260
+ "panels/sources/components/HeadersView.ts | removeBlock": {
9261
+ "message": "R̂ém̂óv̂é t̂h́îś 'ApplyTo'-ŝéĉt́îón̂"
9262
+ },
9263
+ "panels/sources/components/HeadersView.ts | removeHeader": {
9264
+ "message": "R̂ém̂óv̂é t̂h́îś ĥéâd́êŕ"
9265
+ },
9254
9266
  "panels/sources/CoveragePlugin.ts | clickToShowCoveragePanel": {
9255
9267
  "message": "Ĉĺîćk̂ t́ô śĥóŵ Ćôv́êŕâǵê Ṕâńêĺ"
9256
9268
  },
@@ -10991,6 +11003,9 @@
10991
11003
  "panels/timeline/TimelineUIUtils.ts | pinchUpdate": {
10992
11004
  "message": "P̂ín̂ćĥ Úp̂d́ât́ê"
10993
11005
  },
11006
+ "panels/timeline/TimelineUIUtils.ts | prePaint": {
11007
+ "message": "P̂ŕê-Ṕâín̂t́"
11008
+ },
10994
11009
  "panels/timeline/TimelineUIUtils.ts | preview": {
10995
11010
  "message": "P̂ŕêv́îéŵ"
10996
11011
  },
@@ -11,6 +11,7 @@ class UrlStringTag {
11
11
  * “file:///Hello%20World/file/js”
12
12
  */
13
13
  export type UrlString = string&UrlStringTag;
14
+ export const EmptyUrlString = '' as UrlString;
14
15
 
15
16
  class RawPathStringTag {
16
17
  private rawPathTag: (string|undefined);
@@ -22,6 +23,7 @@ class RawPathStringTag {
22
23
  * “/Hello World/file.js”
23
24
  */
24
25
  export type RawPathString = string&RawPathStringTag;
26
+ export const EmptyRawPathString = '' as RawPathString;
25
27
 
26
28
  class EncodedPathStringTag {
27
29
  private encodedPathTag: (string|undefined);
@@ -32,3 +34,4 @@ class EncodedPathStringTag {
32
34
  * “/Hello%20World/file.js”
33
35
  */
34
36
  export type EncodedPathString = string&EncodedPathStringTag;
37
+ export const EmptyEncodedPathString = '' as EncodedPathString;
@@ -2,9 +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
 
5
- import type * as Platform from '../platform/platform.js';
6
5
  import * as Protocol from '../../generated/protocol.js';
7
6
  import * as TextUtils from '../../models/text_utils/text_utils.js';
7
+ import * as Platform from '../platform/platform.js';
8
8
 
9
9
  import {CSSContainerQuery} from './CSSContainerQuery.js';
10
10
  import {CSSLayer} from './CSSLayer.js';
@@ -47,7 +47,7 @@ export class CSSRule {
47
47
 
48
48
  resourceURL(): Platform.DevToolsPath.UrlString {
49
49
  if (!this.styleSheetId) {
50
- return '' as Platform.DevToolsPath.UrlString;
50
+ return Platform.DevToolsPath.EmptyUrlString;
51
51
  }
52
52
  const styleSheetHeader = this.getStyleSheetHeader(this.styleSheetId);
53
53
  return styleSheetHeader.resourceURL();
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Common from '../common/common.js';
6
6
  import * as i18n from '../i18n/i18n.js';
7
- import type * as Platform from '../platform/platform.js';
7
+ import * as Platform from '../platform/platform.js';
8
8
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
9
9
  import * as Protocol from '../../generated/protocol.js';
10
10
 
@@ -534,7 +534,7 @@ export class EventListener {
534
534
  this.#originalHandlerInternal = originalHandler || handler;
535
535
  this.#locationInternal = location;
536
536
  const script = location.script();
537
- this.#sourceURLInternal = script ? script.contentURL() : '' as Platform.DevToolsPath.UrlString;
537
+ this.#sourceURLInternal = script ? script.contentURL() : Platform.DevToolsPath.EmptyUrlString;
538
538
  this.#customRemoveFunction = customRemoveFunction;
539
539
  this.#originInternal = origin || EventListener.Origin.Raw;
540
540
  }
@@ -379,7 +379,7 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
379
379
  backendRequestId: Protocol.Network.RequestId, requestURL: Platform.DevToolsPath.UrlString,
380
380
  initiator?: Protocol.Network.Initiator): NetworkRequest {
381
381
  return new NetworkRequest(
382
- backendRequestId, backendRequestId, requestURL, '' as Platform.DevToolsPath.UrlString, null, null,
382
+ backendRequestId, backendRequestId, requestURL, Platform.DevToolsPath.EmptyUrlString, null, null,
383
383
  initiator || null);
384
384
  }
385
385
 
@@ -296,10 +296,19 @@ export class TextSourceMap implements SourceMap {
296
296
  ++endIndex;
297
297
  ++i;
298
298
  }
299
- const endLine = endIndex < mappings.length ? mappings[endIndex].lineNumber : Infinity;
300
- const endColumn = endIndex < mappings.length ? mappings[endIndex].columnNumber : 0;
301
- ranges.push(new TextUtils.TextRange.TextRange(
302
- mappings[startIndex].lineNumber, mappings[startIndex].columnNumber, endLine, endColumn));
299
+
300
+ // Source maps don't contain end positions for entries, but each entry is assumed to
301
+ // span until the following entry. This doesn't work however in case of the last
302
+ // entry, where there's no following entry. We also don't know the number of lines
303
+ // and columns in the original source code (which might not be available at all), so
304
+ // for that case we store the maximum signed 32-bit integer, which is definitely going
305
+ // to be larger than any script we can process and can safely be serialized as part of
306
+ // the skip list we send to V8 with `Debugger.stepOver` (http://crbug.com/1305956).
307
+ const startLine = mappings[startIndex].lineNumber;
308
+ const startColumn = mappings[startIndex].columnNumber;
309
+ const endLine = endIndex < mappings.length ? mappings[endIndex].lineNumber : 2 ** 31 - 1;
310
+ const endColumn = endIndex < mappings.length ? mappings[endIndex].columnNumber : 2 ** 31 - 1;
311
+ ranges.push(new TextUtils.TextRange.TextRange(startLine, startColumn, endLine, endColumn));
303
312
  }
304
313
 
305
314
  return ranges;
@@ -360,7 +369,7 @@ export class TextSourceMap implements SourceMap {
360
369
 
361
370
  private parseSources(sourceMap: SourceMapV3): void {
362
371
  const sourcesList = [];
363
- let sourceRoot = sourceMap.sourceRoot || '' as Platform.DevToolsPath.UrlString;
372
+ let sourceRoot = sourceMap.sourceRoot || Platform.DevToolsPath.EmptyUrlString;
364
373
  if (sourceRoot && !sourceRoot.endsWith('/')) {
365
374
  sourceRoot = Common.ParsedURL.ParsedURL.concatenate(sourceRoot, '/');
366
375
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Common from '../common/common.js';
6
6
  import * as Host from '../host/host.js';
7
- import type * as Platform from '../platform/platform.js';
7
+ import * as Platform from '../platform/platform.js';
8
8
  import * as ProtocolClient from '../protocol_client/protocol_client.js';
9
9
  import type * as Protocol from '../../generated/protocol.js';
10
10
  import type {TargetManager} from './TargetManager.js';
@@ -32,7 +32,7 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
32
32
  super(needsNodeJSPatching, parentTarget, sessionId, connection);
33
33
  this.#targetManagerInternal = targetManager;
34
34
  this.#nameInternal = name;
35
- this.#inspectedURLInternal = '' as Platform.DevToolsPath.UrlString;
35
+ this.#inspectedURLInternal = Platform.DevToolsPath.EmptyUrlString;
36
36
  this.#inspectedURLName = '';
37
37
  this.#capabilitiesMask = 0;
38
38
  switch (type) {
@@ -175,7 +175,8 @@ export class Target extends ProtocolClient.InspectorBackend.TargetBase {
175
175
  const parsedURL = Common.ParsedURL.ParsedURL.fromString(inspectedURL);
176
176
  this.#inspectedURLName = parsedURL ? parsedURL.lastPathComponentWithFragment() : '#' + this.#idInternal;
177
177
  if (!this.parentTarget()) {
178
- Host.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(inspectedURL || '');
178
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(
179
+ inspectedURL || Platform.DevToolsPath.EmptyUrlString);
179
180
  }
180
181
  this.#targetManagerInternal.onInspectedURLChange(this);
181
182
  if (!this.#nameInternal) {
@@ -289,6 +289,8 @@ export function registerCommands(inspectorBackend) {
289
289
  ClientMetadataHttpNotFound: 'ClientMetadataHttpNotFound',
290
290
  ClientMetadataNoResponse: 'ClientMetadataNoResponse',
291
291
  ClientMetadataInvalidResponse: 'ClientMetadataInvalidResponse',
292
+ ClientMetadataMissingPrivacyPolicyUrl: 'ClientMetadataMissingPrivacyPolicyUrl',
293
+ DisabledInSettings: 'DisabledInSettings',
292
294
  ErrorFetchingSignin: 'ErrorFetchingSignin',
293
295
  InvalidSigninResponse: 'InvalidSigninResponse',
294
296
  AccountsHttpNotFound: 'AccountsHttpNotFound',
@@ -511,8 +513,10 @@ export function registerCommands(inspectorBackend) {
511
513
  'CSS.getInlineStylesForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}],
512
514
  ['inlineStyle', 'attributesStyle']);
513
515
  inspectorBackend.registerCommand(
514
- 'CSS.getMatchedStylesForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}],
515
- ['inlineStyle', 'attributesStyle', 'matchedCSSRules', 'pseudoElements', 'inherited', 'cssKeyframesRules']);
516
+ 'CSS.getMatchedStylesForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}], [
517
+ 'inlineStyle', 'attributesStyle', 'matchedCSSRules', 'pseudoElements', 'inherited', 'inheritedPseudoElements',
518
+ 'cssKeyframesRules'
519
+ ]);
516
520
  inspectorBackend.registerCommand('CSS.getMediaQueries', [], ['medias']);
517
521
  inspectorBackend.registerCommand(
518
522
  'CSS.getPlatformFontsForNode', [{'name': 'nodeId', 'type': 'number', 'optional': false}], ['fonts']);
@@ -1069,6 +1069,8 @@ export namespace Audits {
1069
1069
  ClientMetadataHttpNotFound = 'ClientMetadataHttpNotFound',
1070
1070
  ClientMetadataNoResponse = 'ClientMetadataNoResponse',
1071
1071
  ClientMetadataInvalidResponse = 'ClientMetadataInvalidResponse',
1072
+ ClientMetadataMissingPrivacyPolicyUrl = 'ClientMetadataMissingPrivacyPolicyUrl',
1073
+ DisabledInSettings = 'DisabledInSettings',
1072
1074
  ErrorFetchingSignin = 'ErrorFetchingSignin',
1073
1075
  InvalidSigninResponse = 'InvalidSigninResponse',
1074
1076
  AccountsHttpNotFound = 'AccountsHttpNotFound',
@@ -1763,6 +1765,16 @@ export namespace CSS {
1763
1765
  matchedCSSRules: RuleMatch[];
1764
1766
  }
1765
1767
 
1768
+ /**
1769
+ * Inherited pseudo element matches from pseudos of an ancestor node.
1770
+ */
1771
+ export interface InheritedPseudoElementMatches {
1772
+ /**
1773
+ * Matches of pseudo styles from the pseudos of an ancestor node.
1774
+ */
1775
+ pseudoElements: PseudoElementMatches[];
1776
+ }
1777
+
1766
1778
  /**
1767
1779
  * Match data for a CSS rule.
1768
1780
  */
@@ -2504,6 +2516,10 @@ export namespace CSS {
2504
2516
  * A chain of inherited styles (from the immediate node parent up to the DOM tree root).
2505
2517
  */
2506
2518
  inherited?: InheritedStyleEntry[];
2519
+ /**
2520
+ * A chain of inherited pseudo element styles (from the immediate node parent up to the DOM tree root).
2521
+ */
2522
+ inheritedPseudoElements?: InheritedPseudoElementMatches[];
2507
2523
  /**
2508
2524
  * A list of CSS keyframed animations matching this node.
2509
2525
  */
@@ -236,3 +236,8 @@ BindingsTestRunner.dumpLocation = async function(liveLocation, hint) {
236
236
  prefix + BindingsTestRunner.cleanupURL(uiLocation.uiSourceCode.url()) + ':' + uiLocation.lineNumber + ':' +
237
237
  uiLocation.columnNumber);
238
238
  };
239
+
240
+ BindingsTestRunner.GC = async () => {
241
+ await TestRunner.evaluateInPageAsync(`new Promise(resolve =>
242
+ GCController.asyncCollectAll(resolve))`);
243
+ };
@@ -28,8 +28,6 @@
28
28
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
  */
30
30
 
31
- // TODO(crbug.com/1253323): All casts to RawPathString will be removed from this file when migration to branded types is complete.
32
-
33
31
  import * as Common from '../../core/common/common.js';
34
32
  import * as SDK from '../../core/sdk/sdk.js';
35
33
  import type * as Platform from '../../core/platform/platform.js';
@@ -30,6 +30,7 @@
30
30
 
31
31
  import type * as Common from '../../core/common/common.js';
32
32
  import * as i18n from '../../core/i18n/i18n.js';
33
+ import type * as Platform from '../../core/platform/platform.js';
33
34
  import type * as TextUtils from '../text_utils/text_utils.js';
34
35
  import * as Workspace from '../workspace/workspace.js';
35
36
 
@@ -115,7 +116,7 @@ export class ContentProviderBasedProject extends Workspace.Workspace.ProjectStor
115
116
  }
116
117
 
117
118
  rename(
118
- uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: string,
119
+ uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: Platform.DevToolsPath.RawPathString,
119
120
  callback:
120
121
  (arg0: boolean, arg1?: string|undefined, arg2?: string|undefined,
121
122
  arg3?: Common.ResourceType.ResourceType|undefined) => void): void {
@@ -139,12 +140,13 @@ export class ContentProviderBasedProject extends Workspace.Workspace.ProjectStor
139
140
  excludeFolder(_path: string): void {
140
141
  }
141
142
 
142
- canExcludeFolder(_path: string): boolean {
143
+ canExcludeFolder(_path: Platform.DevToolsPath.EncodedPathString): boolean {
143
144
  return false;
144
145
  }
145
146
 
146
- async createFile(_path: string, _name: string|null, _content: string, _isBase64?: boolean):
147
- Promise<Workspace.UISourceCode.UISourceCode|null> {
147
+ async createFile(
148
+ _path: Platform.DevToolsPath.EncodedPathString, _name: string|null, _content: string,
149
+ _isBase64?: boolean): Promise<Workspace.UISourceCode.UISourceCode|null> {
148
150
  return null;
149
151
  }
150
152
 
@@ -29,6 +29,7 @@
29
29
  */
30
30
 
31
31
  import type * as Common from '../../core/common/common.js';
32
+ import type * as Platform from '../../core/platform/platform.js';
32
33
  import * as Workspace from '../workspace/workspace.js';
33
34
 
34
35
  export interface ChunkedReader {
@@ -206,13 +207,13 @@ export class ChunkedFileReader implements ChunkedReader {
206
207
 
207
208
  export class FileOutputStream implements Common.StringOutputStream.OutputStream {
208
209
  #writeCallbacks: (() => void)[];
209
- #fileName!: string;
210
+ #fileName!: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString;
210
211
  #closed?: boolean;
211
212
  constructor() {
212
213
  this.#writeCallbacks = [];
213
214
  }
214
215
 
215
- async open(fileName: string): Promise<boolean> {
216
+ async open(fileName: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString): Promise<boolean> {
216
217
  this.#closed = false;
217
218
  this.#writeCallbacks = [];
218
219
  this.#fileName = fileName;
@@ -30,6 +30,7 @@
30
30
 
31
31
  import * as Common from '../../core/common/common.js';
32
32
  import * as i18n from '../../core/i18n/i18n.js';
33
+ import type * as Platform from '../../core/platform/platform.js';
33
34
  import * as UI from '../../ui/legacy/legacy.js';
34
35
 
35
36
  import editFileSystemViewStyles from './editFileSystemView.css.js';
@@ -152,7 +153,8 @@ export class EditFileSystemView extends UI.Widget.VBox implements UI.ListWidget.
152
153
  if (!isNew) {
153
154
  this.getFileSystem().removeExcludedFolder(item);
154
155
  }
155
- this.getFileSystem().addExcludedFolder(this.normalizePrefix(editor.control('pathPrefix').value));
156
+ this.getFileSystem().addExcludedFolder(
157
+ this.normalizePrefix(editor.control('pathPrefix').value) as Platform.DevToolsPath.EncodedPathString);
156
158
  this.muteUpdate = false;
157
159
  this.update();
158
160
  }
@@ -28,6 +28,8 @@
28
28
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
  */
30
30
 
31
+ // TODO(crbug.com/1253323): Cast to Branded Types will be removed from this file when migration to branded types is complete.
32
+
31
33
  import * as Common from '../../core/common/common.js';
32
34
  import * as Platform from '../../core/platform/platform.js';
33
35
  import * as TextUtils from '../text_utils/text_utils.js';
@@ -200,7 +202,8 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
200
202
 
201
203
  private filePathForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode):
202
204
  Platform.DevToolsPath.EncodedPathString {
203
- return uiSourceCode.url().substring(this.fileSystemPathInternal.length) as Platform.DevToolsPath.EncodedPathString;
205
+ return Common.ParsedURL.ParsedURL.sliceUrlToEncodedPathString(
206
+ uiSourceCode.url(), this.fileSystemPathInternal.length);
204
207
  }
205
208
 
206
209
  isServiceProject(): boolean {
@@ -257,7 +260,7 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
257
260
  }
258
261
 
259
262
  rename(
260
- uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: string,
263
+ uiSourceCode: Workspace.UISourceCode.UISourceCode, newName: Platform.DevToolsPath.RawPathString,
261
264
  callback:
262
265
  (arg0: boolean, arg1?: string|undefined, arg2?: string|undefined,
263
266
  arg3?: Common.ResourceType.ResourceType|undefined) => void): void {
@@ -339,12 +342,13 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
339
342
  }
340
343
 
341
344
  excludeFolder(url: string): void {
342
- let relativeFolder = url.substring(this.fileSystemBaseURL.length);
345
+ let relativeFolder = Common.ParsedURL.ParsedURL.sliceUrlToEncodedPathString(
346
+ url as Platform.DevToolsPath.UrlString, this.fileSystemBaseURL.length);
343
347
  if (!relativeFolder.startsWith('/')) {
344
- relativeFolder = '/' + relativeFolder;
348
+ relativeFolder = Common.ParsedURL.ParsedURL.prepend('/', relativeFolder);
345
349
  }
346
350
  if (!relativeFolder.endsWith('/')) {
347
- relativeFolder += '/';
351
+ relativeFolder = Common.ParsedURL.ParsedURL.concatenate(relativeFolder, '/');
348
352
  }
349
353
  this.fileSystemInternal.addExcludedFolder(relativeFolder);
350
354
 
@@ -357,7 +361,7 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
357
361
  }
358
362
  }
359
363
 
360
- canExcludeFolder(path: string): boolean {
364
+ canExcludeFolder(path: Platform.DevToolsPath.EncodedPathString): boolean {
361
365
  return this.fileSystemInternal.canExcludeFolder(path);
362
366
  }
363
367
 
@@ -365,8 +369,9 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
365
369
  return true;
366
370
  }
367
371
 
368
- async createFile(path: string, name: string|null, content: string, isBase64?: boolean):
369
- Promise<Workspace.UISourceCode.UISourceCode|null> {
372
+ async createFile(
373
+ path: Platform.DevToolsPath.EncodedPathString, name: Platform.DevToolsPath.RawPathString|null, content: string,
374
+ isBase64?: boolean): Promise<Workspace.UISourceCode.UISourceCode|null> {
370
375
  const guardFileName = this.fileSystemPathInternal + path + (!path.endsWith('/') ? '/' : '') + name;
371
376
  this.creatingFilesGuard.add(guardFileName);
372
377
  const filePath = await this.fileSystemInternal.createFile(path, name);
@@ -392,7 +397,7 @@ export class FileSystem extends Workspace.Workspace.ProjectStore {
392
397
  this.fileSystemWorkspaceBinding.isolatedFileSystemManager.removeFileSystem(this.fileSystemInternal);
393
398
  }
394
399
 
395
- private addFile(filePath: string): Workspace.UISourceCode.UISourceCode {
400
+ private addFile(filePath: Platform.DevToolsPath.EncodedPathString): Workspace.UISourceCode.UISourceCode {
396
401
  const contentType = this.fileSystemInternal.contentType(filePath);
397
402
  const uiSourceCode = this.createUISourceCode(this.fileSystemBaseURL + filePath, contentType);
398
403
  this.addUISourceCode(uiSourceCode);