chrome-devtools-frontend 1.0.944903 → 1.0.945329

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 (35) hide show
  1. package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -5
  2. package/front_end/core/host/UserMetrics.ts +3 -1
  3. package/front_end/core/i18n/i18nImpl.ts +7 -4
  4. package/front_end/core/i18n/locales/en-US.json +0 -45
  5. package/front_end/core/i18n/locales/en-XL.json +0 -45
  6. package/front_end/entrypoints/main/MainImpl.ts +6 -0
  7. package/front_end/models/persistence/IsolatedFileSystemManager.ts +6 -10
  8. package/front_end/models/timeline_model/TimelineJSProfile.ts +16 -3
  9. package/front_end/models/timeline_model/TimelineModel.ts +1 -0
  10. package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
  11. package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
  12. package/front_end/panels/changes/ChangesView.ts +8 -7
  13. package/front_end/panels/elements/StyleEditorWidget.ts +2 -13
  14. package/front_end/panels/elements/StylePropertyTreeElement.ts +4 -7
  15. package/front_end/panels/emulation/DeviceModeView.ts +3 -0
  16. package/front_end/panels/help/ReleaseNoteText.ts +3 -1
  17. package/front_end/panels/timeline/TimelineController.ts +3 -0
  18. package/front_end/third_party/acorn/README.chromium +2 -2
  19. package/front_end/third_party/acorn/acorn.ts +1 -1
  20. package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
  21. package/front_end/third_party/acorn/package/README.md +1 -1
  22. package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
  23. package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
  24. package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
  25. package/front_end/third_party/acorn/package/dist/bin.js +47 -21
  26. package/front_end/third_party/acorn/package/package.json +1 -1
  27. package/front_end/third_party/acorn-loose/README.chromium +2 -2
  28. package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
  29. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
  30. package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
  31. package/front_end/third_party/acorn-loose/package/package.json +2 -2
  32. package/front_end/third_party/i18n/i18n-impl.ts +1 -1
  33. package/front_end/ui/legacy/InspectorView.ts +1 -1
  34. package/inspector_overlay/main.ts +3 -0
  35. package/package.json +1 -1
@@ -86,7 +86,7 @@ export interface DevToolsFileSystem {
86
86
  type: string;
87
87
  fileSystemName: string;
88
88
  rootURL: string;
89
- fileSystemPath: string;
89
+ fileSystemPath: Platform.DevToolsPath.RawPathString;
90
90
  }
91
91
 
92
92
  export interface FileSystemAddedEvent {
@@ -95,9 +95,9 @@ export interface FileSystemAddedEvent {
95
95
  }
96
96
 
97
97
  export interface FilesChangedEvent {
98
- changed: string[];
99
- added: string[];
100
- removed: string[];
98
+ changed: Platform.DevToolsPath.RawPathString[];
99
+ added: Platform.DevToolsPath.RawPathString[];
100
+ removed: Platform.DevToolsPath.RawPathString[];
101
101
  }
102
102
 
103
103
  export interface IndexingEvent {
@@ -155,7 +155,7 @@ export type EventTypes = {
155
155
  [Events.EnterInspectElementMode]: void,
156
156
  [Events.EyeDropperPickedColor]: EyeDropperPickedColorEvent,
157
157
  [Events.FileSystemsLoaded]: DevToolsFileSystem[],
158
- [Events.FileSystemRemoved]: string,
158
+ [Events.FileSystemRemoved]: Platform.DevToolsPath.RawPathString,
159
159
  [Events.FileSystemAdded]: FileSystemAddedEvent,
160
160
  [Events.FileSystemFilesChangedAddedRemoved]: FilesChangedEvent,
161
161
  [Events.IndexingTotalWorkCalculated]: IndexingTotalWorkCalculatedEvent,
@@ -598,6 +598,7 @@ export const DevtoolsExperiments: {
598
598
  'timelineEventInitiators': 24,
599
599
  'timelineInvalidationTracking': 26,
600
600
  'timelineShowAllEvents': 27,
601
+ 'timelineV8RuntimeCallStats': 28,
601
602
  'timelineWebGL': 29,
602
603
  'timelineReplayEvent': 30,
603
604
  'wasmDWARFDebugging': 31,
@@ -616,7 +617,8 @@ export const DevtoolsExperiments: {
616
617
  'syncSettings': 50,
617
618
  'groupAndHideIssuesByKind': 51,
618
619
  'cssTypeComponentLength': 52,
619
- '__lastValidEnumPosition': 52,
620
+ 'preciseChanges': 53,
621
+ '__lastValidEnumPosition': 53,
620
622
  };
621
623
 
622
624
  export const IssueExpanded: {
@@ -182,12 +182,15 @@ export function getLocalizedLanguageRegion(
182
182
  devtoolsLocale: DevToolsLocale): Platform.UIString.LocalizedString {
183
183
  // @ts-ignore TODO(crbug.com/1163928) Wait for Intl support.
184
184
  const locale = new Intl.Locale(localeString);
185
+ Platform.DCHECK(() => locale.language !== undefined);
186
+ Platform.DCHECK(() => locale.baseName !== undefined);
187
+ const localLanguage = locale.language || 'en';
188
+ const localBaseName = locale.baseName || 'en-US';
185
189
  // @ts-ignore TODO(crbug.com/1163928) Wait for Intl support.
186
190
  const devtoolsLoc = new Intl.Locale(devtoolsLocale.locale);
187
- const targetLanguage = locale.language === devtoolsLoc.language ? 'en' : locale.baseName;
188
- const languageInCurrentLocale =
189
- new Intl.DisplayNames([devtoolsLocale.locale], {type: 'language'}).of(locale.language);
190
- const languageInTargetLocale = new Intl.DisplayNames([targetLanguage], {type: 'language'}).of(locale.language);
191
+ const targetLanguage = localLanguage === devtoolsLoc.language ? 'en' : localBaseName;
192
+ const languageInCurrentLocale = new Intl.DisplayNames([devtoolsLocale.locale], {type: 'language'}).of(localLanguage);
193
+ const languageInTargetLocale = new Intl.DisplayNames([targetLanguage], {type: 'language'}).of(localLanguage);
191
194
 
192
195
  let wrappedRegionInCurrentLocale = '';
193
196
  let wrappedRegionInTargetLocale = '';
@@ -2417,51 +2417,6 @@
2417
2417
  "panels/application/BackForwardCacheStrings.ts | documentLoaded": {
2418
2418
  "message": "The document did not finish loading before navigating away."
2419
2419
  },
2420
- "panels/application/BackForwardCacheStrings.ts | embedderAppBannerManager": {
2421
- "message": "EmbedderAppBannerManager"
2422
- },
2423
- "panels/application/BackForwardCacheStrings.ts | embedderChromePasswordManagerClientBindCredentialManager": {
2424
- "message": "EmbedderChromePasswordManagerClientBindCredentialManager"
2425
- },
2426
- "panels/application/BackForwardCacheStrings.ts | embedderDomDistillerSelfDeletingRequestDelegate": {
2427
- "message": "EmbedderDomDistillerSelfDeletingRequestDelegate"
2428
- },
2429
- "panels/application/BackForwardCacheStrings.ts | embedderDomDistillerViewerSource": {
2430
- "message": "EmbedderDomDistillerViewerSource"
2431
- },
2432
- "panels/application/BackForwardCacheStrings.ts | embedderExtensionMessaging": {
2433
- "message": "EmbedderExtensionMessaging"
2434
- },
2435
- "panels/application/BackForwardCacheStrings.ts | embedderExtensionMessagingForOpenPort": {
2436
- "message": "EmbedderExtensionMessagingForOpenPort"
2437
- },
2438
- "panels/application/BackForwardCacheStrings.ts | embedderExtensions": {
2439
- "message": "EmbedderExtensions"
2440
- },
2441
- "panels/application/BackForwardCacheStrings.ts | embedderExtensionSentMessageToCachedFrame": {
2442
- "message": "EmbedderExtensionSentMessageToCachedFrame"
2443
- },
2444
- "panels/application/BackForwardCacheStrings.ts | embedderModalDialog": {
2445
- "message": "EmbedderModalDialog"
2446
- },
2447
- "panels/application/BackForwardCacheStrings.ts | embedderOfflinePage": {
2448
- "message": "EmbedderOfflinePage"
2449
- },
2450
- "panels/application/BackForwardCacheStrings.ts | embedderOomInterventionTabHelper": {
2451
- "message": "EmbedderOomInterventionTabHelper"
2452
- },
2453
- "panels/application/BackForwardCacheStrings.ts | embedderPermissionRequestManager": {
2454
- "message": "EmbedderPermissionRequestManager"
2455
- },
2456
- "panels/application/BackForwardCacheStrings.ts | embedderPopupBlockerTabHelper": {
2457
- "message": "EmbedderPopupBlockerTabHelper"
2458
- },
2459
- "panels/application/BackForwardCacheStrings.ts | embedderSafeBrowsingThreatDetails": {
2460
- "message": "EmbedderSafeBrowsingThreatDetails"
2461
- },
2462
- "panels/application/BackForwardCacheStrings.ts | embedderSafeBrowsingTriggeredPopupBlocker": {
2463
- "message": "EmbedderSafeBrowsingTriggeredPopupBlocker"
2464
- },
2465
2420
  "panels/application/BackForwardCacheStrings.ts | enteredBackForwardCacheBeforeServiceWorkerHostAdded": {
2466
2421
  "message": "A service worker was activated while the page was in back/forward cache."
2467
2422
  },
@@ -2417,51 +2417,6 @@
2417
2417
  "panels/application/BackForwardCacheStrings.ts | documentLoaded": {
2418
2418
  "message": "T̂h́ê d́ôćûḿêńt̂ d́îd́ n̂ót̂ f́îńîśĥ ĺôád̂ín̂ǵ b̂éf̂ór̂é n̂áv̂íĝát̂ín̂ǵ âẃâý."
2419
2419
  },
2420
- "panels/application/BackForwardCacheStrings.ts | embedderAppBannerManager": {
2421
- "message": "Êḿb̂éd̂d́êŕÂṕp̂B́âńn̂ér̂Ḿâńâǵêŕ"
2422
- },
2423
- "panels/application/BackForwardCacheStrings.ts | embedderChromePasswordManagerClientBindCredentialManager": {
2424
- "message": "Êḿb̂éd̂d́êŕĈh́r̂óm̂éP̂áŝśŵór̂d́M̂án̂áĝér̂Ćl̂íêńt̂B́îńd̂Ćr̂éd̂én̂t́îál̂Ḿâńâǵêŕ"
2425
- },
2426
- "panels/application/BackForwardCacheStrings.ts | embedderDomDistillerSelfDeletingRequestDelegate": {
2427
- "message": "Êḿb̂éd̂d́êŕD̂óm̂D́îśt̂íl̂ĺêŕŜél̂f́D̂él̂ét̂ín̂ǵR̂éq̂úêśt̂D́êĺêǵât́ê"
2428
- },
2429
- "panels/application/BackForwardCacheStrings.ts | embedderDomDistillerViewerSource": {
2430
- "message": "Êḿb̂éd̂d́êŕD̂óm̂D́îśt̂íl̂ĺêŕV̂íêẃêŕŜóûŕĉé"
2431
- },
2432
- "panels/application/BackForwardCacheStrings.ts | embedderExtensionMessaging": {
2433
- "message": "Êḿb̂éd̂d́êŕÊx́t̂én̂śîón̂Ḿêśŝáĝín̂ǵ"
2434
- },
2435
- "panels/application/BackForwardCacheStrings.ts | embedderExtensionMessagingForOpenPort": {
2436
- "message": "Êḿb̂éd̂d́êŕÊx́t̂én̂śîón̂Ḿêśŝáĝín̂ǵF̂ór̂Óp̂én̂Ṕôŕt̂"
2437
- },
2438
- "panels/application/BackForwardCacheStrings.ts | embedderExtensions": {
2439
- "message": "Êḿb̂éd̂d́êŕÊx́t̂én̂śîón̂ś"
2440
- },
2441
- "panels/application/BackForwardCacheStrings.ts | embedderExtensionSentMessageToCachedFrame": {
2442
- "message": "Êḿb̂éd̂d́êŕÊx́t̂én̂śîón̂Śêńt̂ḾêśŝáĝéT̂óĈáĉh́êd́F̂ŕâḿê"
2443
- },
2444
- "panels/application/BackForwardCacheStrings.ts | embedderModalDialog": {
2445
- "message": "Êḿb̂éd̂d́êŕM̂ód̂ál̂D́îál̂óĝ"
2446
- },
2447
- "panels/application/BackForwardCacheStrings.ts | embedderOfflinePage": {
2448
- "message": "Êḿb̂éd̂d́êŕÔf́f̂ĺîńêṔâǵê"
2449
- },
2450
- "panels/application/BackForwardCacheStrings.ts | embedderOomInterventionTabHelper": {
2451
- "message": "Êḿb̂éd̂d́êŕÔóm̂Ín̂t́êŕv̂én̂t́îón̂T́âb́Ĥél̂ṕêŕ"
2452
- },
2453
- "panels/application/BackForwardCacheStrings.ts | embedderPermissionRequestManager": {
2454
- "message": "Êḿb̂éd̂d́êŕP̂ér̂ḿîśŝíôńR̂éq̂úêśt̂Ḿâńâǵêŕ"
2455
- },
2456
- "panels/application/BackForwardCacheStrings.ts | embedderPopupBlockerTabHelper": {
2457
- "message": "Êḿb̂éd̂d́êŕP̂óp̂úp̂B́l̂óĉḱêŕT̂áb̂H́êĺp̂ér̂"
2458
- },
2459
- "panels/application/BackForwardCacheStrings.ts | embedderSafeBrowsingThreatDetails": {
2460
- "message": "Êḿb̂éd̂d́êŕŜáf̂éB̂ŕôẃŝín̂ǵT̂h́r̂éât́D̂ét̂áîĺŝ"
2461
- },
2462
- "panels/application/BackForwardCacheStrings.ts | embedderSafeBrowsingTriggeredPopupBlocker": {
2463
- "message": "Êḿb̂éd̂d́êŕŜáf̂éB̂ŕôẃŝín̂ǵT̂ŕîǵĝér̂éd̂ṔôṕûṕB̂ĺôćk̂ér̂"
2464
- },
2465
2420
  "panels/application/BackForwardCacheStrings.ts | enteredBackForwardCacheBeforeServiceWorkerHostAdded": {
2466
2421
  "message": "Â śêŕv̂íĉé ŵór̂ḱêŕ ŵáŝ áĉt́îv́ât́êd́ ŵh́îĺê t́ĥé p̂áĝé ŵáŝ ín̂ b́âćk̂/f́ôŕŵár̂d́ ĉáĉh́ê."
2467
2422
  },
@@ -306,6 +306,8 @@ export class MainImpl {
306
306
  Root.Runtime.experiments.register('timelineEventInitiators', 'Timeline: event initiators');
307
307
  Root.Runtime.experiments.register('timelineInvalidationTracking', 'Timeline: invalidation tracking', true);
308
308
  Root.Runtime.experiments.register('timelineShowAllEvents', 'Timeline: show all events', true);
309
+ Root.Runtime.experiments.register(
310
+ 'timelineV8RuntimeCallStats', 'Timeline: V8 Runtime Call Stats on Timeline', true);
309
311
  Root.Runtime.experiments.register('timelineWebGL', 'Timeline: WebGL-based flamechart');
310
312
  Root.Runtime.experiments.register('timelineReplayEvent', 'Timeline: Replay input events', true);
311
313
  Root.Runtime.experiments.register(
@@ -363,11 +365,15 @@ export class MainImpl {
363
365
  'Enable CSS <length> authoring tool in the Styles pane (https://goo.gle/length-feedback)', undefined,
364
366
  'https://developer.chrome.com/blog/new-in-devtools-96/#length');
365
367
 
368
+ // Display precise changes in the Changes tab.
369
+ Root.Runtime.experiments.register('preciseChanges', 'Display more precise changes in the Changes tab');
370
+
366
371
  Root.Runtime.experiments.enableExperimentsByDefault([
367
372
  'sourceOrderViewer',
368
373
  'hideIssuesFeature',
369
374
  'bfcacheDebugging',
370
375
  'cssTypeComponentLength',
376
+ 'preciseChanges',
371
377
  Root.Runtime.ExperimentName.SYNC_SETTINGS,
372
378
  ]);
373
379
 
@@ -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 Host from '../../core/host/host.js';
35
33
  import * as i18n from '../../core/i18n/i18n.js';
@@ -175,8 +173,7 @@ export class IsolatedFileSystemManager extends Common.ObjectWrapper.ObjectWrappe
175
173
  private innerAddFileSystem(fileSystem: Host.InspectorFrontendHostAPI.DevToolsFileSystem, dispatchEvent: boolean):
176
174
  Promise<IsolatedFileSystem|null> {
177
175
  const embedderPath = fileSystem.fileSystemPath;
178
- const fileSystemURL =
179
- Common.ParsedURL.ParsedURL.rawPathToUrlString(fileSystem.fileSystemPath as Platform.DevToolsPath.RawPathString);
176
+ const fileSystemURL = Common.ParsedURL.ParsedURL.rawPathToUrlString(fileSystem.fileSystemPath);
180
177
  const promise = IsolatedFileSystem.create(
181
178
  this, fileSystemURL, embedderPath, fileSystem.type, fileSystem.fileSystemName, fileSystem.rootURL);
182
179
  return promise.then(storeFileSystem.bind(this));
@@ -221,10 +218,9 @@ export class IsolatedFileSystemManager extends Common.ObjectWrapper.ObjectWrappe
221
218
  }
222
219
  }
223
220
 
224
- private onFileSystemRemoved(event: Common.EventTarget.EventTargetEvent<string>): void {
221
+ private onFileSystemRemoved(event: Common.EventTarget.EventTargetEvent<Platform.DevToolsPath.RawPathString>): void {
225
222
  const embedderPath = event.data;
226
- const fileSystemPath =
227
- Common.ParsedURL.ParsedURL.rawPathToUrlString(embedderPath as Platform.DevToolsPath.RawPathString);
223
+ const fileSystemPath = Common.ParsedURL.ParsedURL.rawPathToUrlString(embedderPath);
228
224
  const isolatedFileSystem = this.fileSystemsInternal.get(fileSystemPath);
229
225
  if (!isolatedFileSystem) {
230
226
  return;
@@ -245,11 +241,11 @@ export class IsolatedFileSystemManager extends Common.ObjectWrapper.ObjectWrappe
245
241
  this.dispatchEventToListeners(Events.FileSystemFilesChanged, urlPaths);
246
242
 
247
243
  function groupFilePathsIntoFileSystemPaths(
248
- this: IsolatedFileSystemManager, embedderPaths: string[]): Platform.MapUtilities.Multimap<string, string> {
244
+ this: IsolatedFileSystemManager,
245
+ embedderPaths: Platform.DevToolsPath.RawPathString[]): Platform.MapUtilities.Multimap<string, string> {
249
246
  const paths = new Platform.MapUtilities.Multimap<string, string>();
250
247
  for (const embedderPath of embedderPaths) {
251
- const filePath =
252
- Common.ParsedURL.ParsedURL.rawPathToUrlString(embedderPath as Platform.DevToolsPath.RawPathString);
248
+ const filePath = Common.ParsedURL.ParsedURL.rawPathToUrlString(embedderPath);
253
249
  for (const fileSystemPath of this.fileSystemsInternal.keys()) {
254
250
  const fileSystem = this.fileSystemsInternal.get(fileSystemPath);
255
251
  if (fileSystem && fileSystem.isFileExcluded(embedderPath)) {
@@ -59,6 +59,7 @@ export class TimelineJSProfileProcessor {
59
59
 
60
60
  static generateJSFrameEvents(events: SDK.TracingModel.Event[], config: {
61
61
  showAllEvents: boolean,
62
+ showRuntimeCallStats: boolean,
62
63
  showNativeFunctions: boolean,
63
64
  }): SDK.TracingModel.Event[] {
64
65
  function equalFrames(frame1: Protocol.Runtime.CallFrame, frame2: Protocol.Runtime.CallFrame): boolean {
@@ -84,7 +85,7 @@ export class TimelineJSProfileProcessor {
84
85
  const lockedJsStackDepth: number[] = [];
85
86
  let ordinal = 0;
86
87
  let fakeJSInvocation = false;
87
- const {showAllEvents, showNativeFunctions} = config;
88
+ const {showAllEvents, showRuntimeCallStats, showNativeFunctions} = config;
88
89
 
89
90
  function onStartEvent(e: SDK.TracingModel.Event): void {
90
91
  if (fakeJSInvocation) {
@@ -134,10 +135,15 @@ export class TimelineJSProfileProcessor {
134
135
  jsFramesStack.length = depth;
135
136
  }
136
137
 
138
+ function showNativeName(name: string): boolean {
139
+ return showRuntimeCallStats && Boolean(TimelineJSProfileProcessor.nativeGroup(name));
140
+ }
141
+
137
142
  function filterStackFrames(stack: Protocol.Runtime.CallFrame[]): void {
138
143
  if (showAllEvents) {
139
144
  return;
140
145
  }
146
+ let previousNativeFrameName: (string|null)|null = null;
141
147
  let j = 0;
142
148
  for (let i = 0; i < stack.length; ++i) {
143
149
  const frame = stack[i];
@@ -147,9 +153,16 @@ export class TimelineJSProfileProcessor {
147
153
  continue;
148
154
  }
149
155
  const isNativeRuntimeFrame = TimelineJSProfileProcessor.isNativeRuntimeFrame(frame);
150
- if (!isNativeRuntimeFrame) {
151
- stack[j++] = frame;
156
+ if (isNativeRuntimeFrame && !showNativeName(frame.functionName)) {
157
+ continue;
158
+ }
159
+ const nativeFrameName =
160
+ isNativeRuntimeFrame ? TimelineJSProfileProcessor.nativeGroup(frame.functionName) : null;
161
+ if (previousNativeFrameName && previousNativeFrameName === nativeFrameName) {
162
+ continue;
152
163
  }
164
+ previousNativeFrameName = nativeFrameName;
165
+ stack[j++] = frame;
153
166
  }
154
167
  stack.length = j;
155
168
  }
@@ -678,6 +678,7 @@ export class TimelineModelImpl {
678
678
  if (jsSamples || events.some(e => e.name === RecordType.JSSample)) {
679
679
  const jsFrameEvents = TimelineJSProfileProcessor.generateJSFrameEvents(events, {
680
680
  showAllEvents: Root.Runtime.experiments.isEnabled('timelineShowAllEvents'),
681
+ showRuntimeCallStats: Root.Runtime.experiments.isEnabled('timelineV8RuntimeCallStats'),
681
682
  showNativeFunctions: Common.Settings.Settings.instance().moduleSetting('showNativeFunctionsInJSProfile').get(),
682
683
  });
683
684
  if (jsFrameEvents && jsFrameEvents.length) {
@@ -5,9 +5,14 @@
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as Host from '../../core/host/host.js';
7
7
  import * as Diff from '../../third_party/diff/diff.js';
8
+ import * as FormatterModule from '../formatter/formatter.js';
8
9
  import * as Persistence from '../persistence/persistence.js';
9
10
  import * as Workspace from '../workspace/workspace.js';
10
11
 
12
+ interface DiffRequestOptions {
13
+ shouldFormatDiff: boolean;
14
+ }
15
+
11
16
  export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
12
17
  private readonly uiSourceCodeDiffs: WeakMap<Workspace.UISourceCode.UISourceCode, UISourceCodeDiff>;
13
18
  private readonly loadingUISourceCodes:
@@ -29,8 +34,9 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
29
34
  workspace.uiSourceCodes().forEach(this.updateModifiedState.bind(this));
30
35
  }
31
36
 
32
- requestDiff(uiSourceCode: Workspace.UISourceCode.UISourceCode): Promise<Diff.Diff.DiffArray|null> {
33
- return this.uiSourceCodeDiff(uiSourceCode).requestDiff();
37
+ requestDiff(uiSourceCode: Workspace.UISourceCode.UISourceCode, diffRequestOptions: DiffRequestOptions):
38
+ Promise<Diff.Diff.DiffArray|null> {
39
+ return this.uiSourceCodeDiff(uiSourceCode).requestDiff(diffRequestOptions);
34
40
  }
35
41
 
36
42
  subscribeToDiffChange(uiSourceCode: Workspace.UISourceCode.UISourceCode, callback: () => void, thisObj?: Object):
@@ -212,9 +218,9 @@ export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourc
212
218
  }
213
219
  }
214
220
 
215
- requestDiff(): Promise<Diff.Diff.DiffArray|null> {
221
+ requestDiff(diffRequestOptions: DiffRequestOptions): Promise<Diff.Diff.DiffArray|null> {
216
222
  if (!this.requestDiffPromise) {
217
- this.requestDiffPromise = this.innerRequestDiff();
223
+ this.requestDiffPromise = this.innerRequestDiff(diffRequestOptions);
218
224
  }
219
225
  return this.requestDiffPromise;
220
226
  }
@@ -231,12 +237,12 @@ export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourc
231
237
  return content.content || ('error' in content && content.error) || '';
232
238
  }
233
239
 
234
- private async innerRequestDiff(): Promise<Diff.Diff.DiffArray|null> {
240
+ private async innerRequestDiff({shouldFormatDiff}: DiffRequestOptions): Promise<Diff.Diff.DiffArray|null> {
235
241
  if (this.dispose) {
236
242
  return null;
237
243
  }
238
244
 
239
- const baseline = await this.originalContent();
245
+ let baseline = await this.originalContent();
240
246
  if (baseline === null) {
241
247
  return null;
242
248
  }
@@ -264,6 +270,14 @@ export class UISourceCodeDiff extends Common.ObjectWrapper.ObjectWrapper<UISourc
264
270
  if (current === null || baseline === null) {
265
271
  return null;
266
272
  }
273
+ if (shouldFormatDiff) {
274
+ baseline = (await FormatterModule.ScriptFormatter.format(
275
+ this.uiSourceCode.contentType(), this.uiSourceCode.mimeType(), baseline))
276
+ .formattedContent;
277
+ current = (await FormatterModule.ScriptFormatter.format(
278
+ this.uiSourceCode.contentType(), this.uiSourceCode.mimeType(), current))
279
+ .formattedContent;
280
+ }
267
281
  return Diff.Diff.DiffWrapper.lineDiff(baseline.split(/\r\n|\n|\r/), current.split(/\r\n|\n|\r/));
268
282
  }
269
283
  }
@@ -424,66 +424,6 @@ const UIStrings = {
424
424
  * @description Description text for not restored reason ContentMediaPlay.
425
425
  */
426
426
  contentMediaPlay: 'A media player was playing upon navigating away.',
427
- /**
428
- * @description Description text for not restored reason EmbedderPopupBlockerTabHelper.
429
- */
430
- embedderPopupBlockerTabHelper: 'EmbedderPopupBlockerTabHelper',
431
- /**
432
- * @description Description text for not restored reason EmbedderSafeBrowsingTriggeredPopupBlocker.
433
- */
434
- embedderSafeBrowsingTriggeredPopupBlocker: 'EmbedderSafeBrowsingTriggeredPopupBlocker',
435
- /**
436
- * @description Description text for not restored reason EmbedderSafeBrowsingThreatDetails.
437
- */
438
- embedderSafeBrowsingThreatDetails: 'EmbedderSafeBrowsingThreatDetails',
439
- /**
440
- * @description Description text for not restored reason EmbedderAppBannerManager.
441
- */
442
- embedderAppBannerManager: 'EmbedderAppBannerManager',
443
- /**
444
- * @description Description text for not restored reason EmbedderDomDistillerViewerSource.
445
- */
446
- embedderDomDistillerViewerSource: 'EmbedderDomDistillerViewerSource',
447
- /**
448
- * @description Description text for not restored reason EmbedderDomDistillerSelfDeletingRequestDelegate.
449
- */
450
- embedderDomDistillerSelfDeletingRequestDelegate: 'EmbedderDomDistillerSelfDeletingRequestDelegate',
451
- /**
452
- * @description Description text for not restored reason EmbedderOomInterventionTabHelper.
453
- */
454
- embedderOomInterventionTabHelper: 'EmbedderOomInterventionTabHelper',
455
- /**
456
- * @description Description text for not restored reason EmbedderOfflinePage.
457
- */
458
- embedderOfflinePage: 'EmbedderOfflinePage',
459
- /**
460
- * @description Description text for not restored reason EmbedderChromePasswordManagerClientBindCredentialManager.
461
- */
462
- embedderChromePasswordManagerClientBindCredentialManager: 'EmbedderChromePasswordManagerClientBindCredentialManager',
463
- /**
464
- * @description Description text for not restored reason EmbedderPermissionRequestManager.
465
- */
466
- embedderPermissionRequestManager: 'EmbedderPermissionRequestManager',
467
- /**
468
- * @description Description text for not restored reason EmbedderModalDialog.
469
- */
470
- embedderModalDialog: 'EmbedderModalDialog',
471
- /**
472
- * @description Description text for not restored reason EmbedderExtensions.
473
- */
474
- embedderExtensions: 'EmbedderExtensions',
475
- /**
476
- * @description Description text for not restored reason EmbedderExtensionMessaging.
477
- */
478
- embedderExtensionMessaging: 'EmbedderExtensionMessaging',
479
- /**
480
- * @description Description text for not restored reason EmbedderExtensionMessagingForOpenPort.
481
- */
482
- embedderExtensionMessagingForOpenPort: 'EmbedderExtensionMessagingForOpenPort',
483
- /**
484
- * @description Description text for not restored reason EmbedderExtensionSentMessageToCachedFrame.
485
- */
486
- embedderExtensionSentMessageToCachedFrame: 'EmbedderExtensionSentMessageToCachedFrame',
487
427
  };
488
428
 
489
429
  const str_ = i18n.i18n.registerUIStrings('panels/application/BackForwardCacheStrings.ts', UIStrings);
@@ -601,23 +541,23 @@ export const NotRestoredReasonDescription = {
601
541
  'ContentMediaSession': {name: i18nLazyString(UIStrings.contentMediaSession)},
602
542
  'ContentMediaSessionService': {name: i18nLazyString(UIStrings.contentMediaSessionService)},
603
543
  'ContentMediaPlay': {name: i18nLazyString(UIStrings.contentMediaPlay)},
604
- 'EmbedderPopupBlockerTabHelper': {name: i18nLazyString(UIStrings.embedderPopupBlockerTabHelper)},
544
+ 'EmbedderPopupBlockerTabHelper': {name: i18n.i18n.lockedLazyString('EmbedderPopupBlockerTabHelper')},
605
545
  'EmbedderSafeBrowsingTriggeredPopupBlocker':
606
- {name: i18nLazyString(UIStrings.embedderSafeBrowsingTriggeredPopupBlocker)},
607
- 'EmbedderSafeBrowsingThreatDetails': {name: i18nLazyString(UIStrings.embedderSafeBrowsingThreatDetails)},
608
- 'EmbedderAppBannerManager': {name: i18nLazyString(UIStrings.embedderAppBannerManager)},
609
- 'EmbedderDomDistillerViewerSource': {name: i18nLazyString(UIStrings.embedderDomDistillerViewerSource)},
546
+ {name: i18n.i18n.lockedLazyString('EmbedderSafeBrowsingTriggeredPopupBlocker')},
547
+ 'EmbedderSafeBrowsingThreatDetails': {name: i18n.i18n.lockedLazyString('EmbedderSafeBrowsingThreatDetails')},
548
+ 'EmbedderAppBannerManager': {name: i18n.i18n.lockedLazyString('EmbedderAppBannerManager')},
549
+ 'EmbedderDomDistillerViewerSource': {name: i18n.i18n.lockedLazyString('EmbedderDomDistillerViewerSource')},
610
550
  'EmbedderDomDistillerSelfDeletingRequestDelegate':
611
- {name: i18nLazyString(UIStrings.embedderDomDistillerSelfDeletingRequestDelegate)},
612
- 'EmbedderOomInterventionTabHelper': {name: i18nLazyString(UIStrings.embedderOomInterventionTabHelper)},
613
- 'EmbedderOfflinePage': {name: i18nLazyString(UIStrings.embedderOfflinePage)},
551
+ {name: i18n.i18n.lockedLazyString('EmbedderDomDistillerSelfDeletingRequestDelegate')},
552
+ 'EmbedderOomInterventionTabHelper': {name: i18n.i18n.lockedLazyString('EmbedderOomInterventionTabHelper')},
553
+ 'EmbedderOfflinePage': {name: i18n.i18n.lockedLazyString('EmbedderOfflinePage')},
614
554
  'EmbedderChromePasswordManagerClientBindCredentialManager':
615
- {name: i18nLazyString(UIStrings.embedderChromePasswordManagerClientBindCredentialManager)},
616
- 'EmbedderPermissionRequestManager': {name: i18nLazyString(UIStrings.embedderPermissionRequestManager)},
617
- 'EmbedderModalDialog': {name: i18nLazyString(UIStrings.embedderModalDialog)},
618
- 'EmbedderExtensions': {name: i18nLazyString(UIStrings.embedderExtensions)},
619
- 'EmbedderExtensionMessaging': {name: i18nLazyString(UIStrings.embedderExtensionMessaging)},
620
- 'EmbedderExtensionMessagingForOpenPort': {name: i18nLazyString(UIStrings.embedderExtensionMessagingForOpenPort)},
555
+ {name: i18n.i18n.lockedLazyString('EmbedderChromePasswordManagerClientBindCredentialManager')},
556
+ 'EmbedderPermissionRequestManager': {name: i18n.i18n.lockedLazyString('EmbedderPermissionRequestManager')},
557
+ 'EmbedderModalDialog': {name: i18n.i18n.lockedLazyString('EmbedderModalDialog')},
558
+ 'EmbedderExtensions': {name: i18n.i18n.lockedLazyString('EmbedderExtensions')},
559
+ 'EmbedderExtensionMessaging': {name: i18n.i18n.lockedLazyString('EmbedderExtensionMessaging')},
560
+ 'EmbedderExtensionMessagingForOpenPort': {name: i18n.i18n.lockedLazyString('EmbedderExtensionMessagingForOpenPort')},
621
561
  'EmbedderExtensionSentMessageToCachedFrame':
622
- {name: i18nLazyString(UIStrings.embedderExtensionSentMessageToCachedFrame)},
562
+ {name: i18n.i18n.lockedLazyString('EmbedderExtensionSentMessageToCachedFrame')},
623
563
  };
@@ -4,6 +4,7 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
+ import * as Root from '../../core/root/root.js';
7
8
  import * as Diff from '../../third_party/diff/diff.js';
8
9
  import * as DiffView from '../../ui/components/diff_view/diff_view.js';
9
10
  import * as UI from '../../ui/legacy/legacy.js';
@@ -166,7 +167,7 @@ export class ChangesView extends UI.Widget.VBox {
166
167
  this.registerCSSFiles([changesViewStyles]);
167
168
  }
168
169
 
169
- private refreshDiff(): void {
170
+ private async refreshDiff(): Promise<void> {
170
171
  if (!this.isShowing()) {
171
172
  return;
172
173
  }
@@ -180,12 +181,12 @@ export class ChangesView extends UI.Widget.VBox {
180
181
  this.hideDiff(i18nString(UIStrings.binaryData));
181
182
  return;
182
183
  }
183
- this.workspaceDiff.requestDiff(uiSourceCode).then((diff: Diff.Diff.DiffArray|null): void => {
184
- if (this.selectedUISourceCode !== uiSourceCode) {
185
- return;
186
- }
187
- this.renderDiffRows(diff);
188
- });
184
+ const diff = await this.workspaceDiff.requestDiff(
185
+ uiSourceCode, {shouldFormatDiff: Root.Runtime.experiments.isEnabled('preciseChanges')});
186
+ if (this.selectedUISourceCode !== uiSourceCode) {
187
+ return;
188
+ }
189
+ this.renderDiffRows(diff);
189
190
  }
190
191
 
191
192
  private hideDiff(message: string): void {
@@ -30,8 +30,6 @@ export class StyleEditorWidget extends UI.Widget.VBox {
30
30
  private section?: StylePropertiesSection;
31
31
  private editorContainer: HTMLElement;
32
32
 
33
- #propertyIndex = -1;
34
-
35
33
  constructor() {
36
34
  super(true);
37
35
  this.contentElement.tabIndex = 0;
@@ -73,14 +71,6 @@ export class StyleEditorWidget extends UI.Widget.VBox {
73
71
  this.editor?.addEventListener('propertydeselected', this.onPropertyDeselected);
74
72
  }
75
73
 
76
- setPropertyIndex(value: number): void {
77
- this.#propertyIndex = value;
78
- }
79
-
80
- getPropertyIndex(): number {
81
- return this.#propertyIndex;
82
- }
83
-
84
74
  unbindContext(): void {
85
75
  this.pane = undefined;
86
76
  this.section = undefined;
@@ -115,8 +105,8 @@ export class StyleEditorWidget extends UI.Widget.VBox {
115
105
  }
116
106
 
117
107
  static createTriggerButton(
118
- pane: StylesSidebarPane, section: StylePropertiesSection, editorClass: {new(): Editor}, buttonTitle: string,
119
- propertyIndex: number): HTMLElement {
108
+ pane: StylesSidebarPane, section: StylePropertiesSection, editorClass: {new(): Editor},
109
+ buttonTitle: string): HTMLElement {
120
110
  const triggerButton = createButton(buttonTitle);
121
111
 
122
112
  triggerButton.onclick = async(event): Promise<void> => {
@@ -125,7 +115,6 @@ export class StyleEditorWidget extends UI.Widget.VBox {
125
115
  const widget = StyleEditorWidget.instance();
126
116
  widget.setEditor(editorClass);
127
117
  widget.bindContext(pane, section);
128
- widget.setPropertyIndex(propertyIndex);
129
118
  await widget.render();
130
119
  const scrollerElement = triggerButton.enclosingNodeOrSelfWithClass('style-panes-wrapper');
131
120
  const onScroll = (): void => {
@@ -670,22 +670,19 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
670
670
  const propertyValue = this.property.trimmedValueWithoutImportant();
671
671
  if (propertyValue === 'flex' || propertyValue === 'inline-flex') {
672
672
  const button = StyleEditorWidget.createTriggerButton(
673
- this.parentPaneInternal, section, FlexboxEditor, i18nString(UIStrings.flexboxEditorButton),
674
- this.property.index);
673
+ this.parentPaneInternal, section, FlexboxEditor, i18nString(UIStrings.flexboxEditorButton));
675
674
  this.listItemElement.appendChild(button);
676
675
  const helper = this.parentPaneInternal.swatchPopoverHelper();
677
- if (helper.isShowing(StyleEditorWidget.instance()) &&
678
- this.property.index === StyleEditorWidget.instance().getPropertyIndex()) {
676
+ if (helper.isShowing(StyleEditorWidget.instance())) {
679
677
  helper.setAnchorElement(button);
680
678
  }
681
679
  }
682
680
  if (propertyValue === 'grid' || propertyValue === 'inline-grid') {
683
681
  const button = StyleEditorWidget.createTriggerButton(
684
- this.parentPaneInternal, section, GridEditor, i18nString(UIStrings.gridEditorButton), this.property.index);
682
+ this.parentPaneInternal, section, GridEditor, i18nString(UIStrings.gridEditorButton));
685
683
  this.listItemElement.appendChild(button);
686
684
  const helper = this.parentPaneInternal.swatchPopoverHelper();
687
- if (helper.isShowing(StyleEditorWidget.instance()) &&
688
- this.property.index === StyleEditorWidget.instance().getPropertyIndex()) {
685
+ if (helper.isShowing(StyleEditorWidget.instance())) {
689
686
  helper.setAnchorElement(button);
690
687
  }
691
688
  }
@@ -547,6 +547,9 @@ export class DeviceModeView extends UI.Widget.VBox {
547
547
  const link = document.createElement('a');
548
548
  link.download = fileName + '.png';
549
549
  canvas.toBlob(blob => {
550
+ if (blob === null) {
551
+ return;
552
+ }
550
553
  link.href = URL.createObjectURL(blob);
551
554
  link.click();
552
555
  });
@@ -21,7 +21,9 @@ function getReleaseNoteLang(): string {
21
21
  // @ts-ignore TODO(crbug.com/1163928) Wait for Intl support.
22
22
  const currentDevToolsLocale = new Intl.Locale(currentDevToolsUILanguage);
23
23
 
24
- return releaseNoteLangs.has(currentDevToolsLocale.language) ? currentDevToolsLocale.language : '';
24
+ return currentDevToolsLocale.language && releaseNoteLangs.has(currentDevToolsLocale.language) ?
25
+ currentDevToolsLocale.language :
26
+ '';
25
27
  }
26
28
 
27
29
  function getLocalizedReleaseNoteURL(url: string): string {
@@ -93,6 +93,9 @@ export class TimelineController implements SDK.TargetManager.SDKModelObserver<SD
93
93
  ];
94
94
  categoriesArray.push(TimelineModel.TimelineModel.TimelineModelImpl.Category.LatencyInfo);
95
95
 
96
+ if (Root.Runtime.experiments.isEnabled('timelineV8RuntimeCallStats') && options.enableJSSampling) {
97
+ categoriesArray.push(disabledByDefault('v8.runtime_stats_sampling'));
98
+ }
96
99
  if (!Root.Runtime.Runtime.queryParam('timelineTracingJSProfileDisabled') && options.enableJSSampling) {
97
100
  categoriesArray.push(disabledByDefault('v8.cpu_profiler'));
98
101
  }
@@ -1,7 +1,7 @@
1
1
  Name: Acorn, a tiny, fast JavaScript parser written in JavaScript.
2
2
  Short Name: acorn
3
3
  URL: https://github.com/acornjs/acorn
4
- Version: 8.4.1
4
+ Version: 8.6.0
5
5
  License: MIT
6
6
  License File: LICENSE
7
7
  Security Critical: no
@@ -10,5 +10,5 @@ Description:
10
10
  A tiny, fast JavaScript parser written in JavaScript.
11
11
 
12
12
  ```bash
13
- wget -qO- https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz | tar xzf -
13
+ wget -qO- https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz | tar xzf -
14
14
  ```