chrome-devtools-frontend 1.0.952284 → 1.0.952865
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.
- package/config/gni/devtools_grd_files.gni +3 -0
- package/front_end/.eslintrc.js +1 -1
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/af.json +158 -176
- package/front_end/core/i18n/locales/am.json +163 -181
- package/front_end/core/i18n/locales/ar.json +162 -180
- package/front_end/core/i18n/locales/as.json +163 -181
- package/front_end/core/i18n/locales/az.json +161 -179
- package/front_end/core/i18n/locales/be.json +160 -178
- package/front_end/core/i18n/locales/bg.json +159 -177
- package/front_end/core/i18n/locales/bn.json +166 -184
- package/front_end/core/i18n/locales/bs.json +161 -179
- package/front_end/core/i18n/locales/ca.json +159 -177
- package/front_end/core/i18n/locales/cs.json +159 -177
- package/front_end/core/i18n/locales/cy.json +164 -182
- package/front_end/core/i18n/locales/da.json +158 -176
- package/front_end/core/i18n/locales/de.json +160 -178
- package/front_end/core/i18n/locales/el.json +158 -176
- package/front_end/core/i18n/locales/en-GB.json +158 -176
- package/front_end/core/i18n/locales/en-US.json +3 -0
- package/front_end/core/i18n/locales/en-XL.json +3 -0
- package/front_end/core/i18n/locales/es-419.json +160 -178
- package/front_end/core/i18n/locales/es.json +156 -174
- package/front_end/core/i18n/locales/et.json +161 -179
- package/front_end/core/i18n/locales/eu.json +159 -177
- package/front_end/core/i18n/locales/fa.json +166 -184
- package/front_end/core/i18n/locales/fi.json +161 -179
- package/front_end/core/i18n/locales/fil.json +162 -180
- package/front_end/core/i18n/locales/fr-CA.json +159 -177
- package/front_end/core/i18n/locales/fr.json +158 -176
- package/front_end/core/i18n/locales/gl.json +160 -178
- package/front_end/core/i18n/locales/gu.json +179 -197
- package/front_end/core/i18n/locales/he.json +160 -178
- package/front_end/core/i18n/locales/hi.json +166 -184
- package/front_end/core/i18n/locales/hr.json +161 -179
- package/front_end/core/i18n/locales/hu.json +161 -179
- package/front_end/core/i18n/locales/hy.json +157 -175
- package/front_end/core/i18n/locales/id.json +160 -178
- package/front_end/core/i18n/locales/is.json +163 -181
- package/front_end/core/i18n/locales/it.json +162 -180
- package/front_end/core/i18n/locales/ja.json +160 -178
- package/front_end/core/i18n/locales/ka.json +161 -179
- package/front_end/core/i18n/locales/kk.json +164 -182
- package/front_end/core/i18n/locales/km.json +160 -178
- package/front_end/core/i18n/locales/kn.json +162 -180
- package/front_end/core/i18n/locales/ko.json +162 -180
- package/front_end/core/i18n/locales/ky.json +160 -178
- package/front_end/core/i18n/locales/lo.json +159 -177
- package/front_end/core/i18n/locales/lt.json +159 -177
- package/front_end/core/i18n/locales/lv.json +162 -180
- package/front_end/core/i18n/locales/mk.json +162 -180
- package/front_end/core/i18n/locales/ml.json +160 -178
- package/front_end/core/i18n/locales/mn.json +164 -182
- package/front_end/core/i18n/locales/mr.json +163 -181
- package/front_end/core/i18n/locales/ms.json +163 -181
- package/front_end/core/i18n/locales/my.json +164 -182
- package/front_end/core/i18n/locales/ne.json +160 -178
- package/front_end/core/i18n/locales/nl.json +160 -178
- package/front_end/core/i18n/locales/no.json +281 -299
- package/front_end/core/i18n/locales/or.json +165 -183
- package/front_end/core/i18n/locales/pa.json +159 -177
- package/front_end/core/i18n/locales/pl.json +163 -181
- package/front_end/core/i18n/locales/pt-PT.json +160 -178
- package/front_end/core/i18n/locales/pt.json +159 -177
- package/front_end/core/i18n/locales/ro.json +161 -179
- package/front_end/core/i18n/locales/ru.json +159 -177
- package/front_end/core/i18n/locales/si.json +161 -179
- package/front_end/core/i18n/locales/sk.json +158 -176
- package/front_end/core/i18n/locales/sl.json +160 -178
- package/front_end/core/i18n/locales/sq.json +279 -297
- package/front_end/core/i18n/locales/sr-Latn.json +160 -178
- package/front_end/core/i18n/locales/sr.json +160 -178
- package/front_end/core/i18n/locales/sv.json +159 -177
- package/front_end/core/i18n/locales/sw.json +164 -182
- package/front_end/core/i18n/locales/ta.json +160 -178
- package/front_end/core/i18n/locales/te.json +165 -183
- package/front_end/core/i18n/locales/th.json +158 -176
- package/front_end/core/i18n/locales/tr.json +162 -180
- package/front_end/core/i18n/locales/uk.json +160 -178
- package/front_end/core/i18n/locales/ur.json +160 -178
- package/front_end/core/i18n/locales/uz.json +160 -178
- package/front_end/core/i18n/locales/vi.json +162 -180
- package/front_end/core/i18n/locales/zh-HK.json +160 -178
- package/front_end/core/i18n/locales/zh-TW.json +161 -179
- package/front_end/core/i18n/locales/zh.json +162 -180
- package/front_end/core/i18n/locales/zu.json +164 -182
- package/front_end/core/root/Runtime.ts +4 -12
- package/front_end/core/sdk/PageResourceLoader.ts +2 -1
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +3 -3
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +2 -2
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +9 -9
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +11 -11
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +40 -40
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +14 -14
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +15 -15
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +29 -29
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +2 -2
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +12 -12
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +26 -29
- package/front_end/entrypoints/main/MainImpl.ts +38 -38
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +10 -10
- package/front_end/entrypoints/node_app/NodeMain.ts +3 -3
- package/front_end/legacy/legacy-defs.d.ts +0 -21
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
- package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +86 -25
- package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -1
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/third_party/diff/DiffWrapper.ts +7 -0
- package/front_end/ui/components/data_grid/DataGrid.ts +2 -2
- package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
- package/front_end/ui/legacy/SearchableView.ts +13 -4
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -12
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +22 -7
- package/package.json +1 -1
- package/config/gni/all_devtools_files.gni +0 -255
- package/scripts/build/devtools_file_hashes.py +0 -82
- package/scripts/devtools_run/devtools_run_cli +0 -49
- package/scripts/devtools_run/package.json +0 -13
- package/scripts/unzip.py +0 -20
- package/scripts/visualize_deps/jquery_svg.html +0 -57
- package/scripts/visualize_deps/run_visualize.js +0 -119
|
@@ -115,6 +115,7 @@ export class PerformanceMonitorImpl extends UI.Widget.HBox implements
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
this.registerCSSFiles([performanceMonitorStyles]);
|
|
118
|
+
this.controlPane.instantiateMetricData();
|
|
118
119
|
SDK.TargetManager.TargetManager.instance().addEventListener(
|
|
119
120
|
SDK.TargetManager.Events.SuspendStateChanged, this.suspendStateChanged, this);
|
|
120
121
|
this.model.enable();
|
|
@@ -437,8 +438,9 @@ export class ControlPane extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
437
438
|
element: Element;
|
|
438
439
|
private readonly enabledChartsSetting: Common.Settings.Setting<string[]>;
|
|
439
440
|
private readonly enabledCharts: Set<string>;
|
|
440
|
-
|
|
441
|
-
private
|
|
441
|
+
|
|
442
|
+
private chartsInfo: ChartInfo[] = [];
|
|
443
|
+
private indicators: Map<string, MetricIndicator> = new Map();
|
|
442
444
|
|
|
443
445
|
constructor(parent: Element) {
|
|
444
446
|
super();
|
|
@@ -447,7 +449,9 @@ export class ControlPane extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
447
449
|
this.enabledChartsSetting = Common.Settings.Settings.instance().createSetting(
|
|
448
450
|
'perfmonActiveIndicators2', ['TaskDuration', 'JSHeapTotalSize', 'Nodes']);
|
|
449
451
|
this.enabledCharts = new Set(this.enabledChartsSetting.get());
|
|
452
|
+
}
|
|
450
453
|
|
|
454
|
+
instantiateMetricData(): void {
|
|
451
455
|
const defaults = {
|
|
452
456
|
color: undefined,
|
|
453
457
|
format: undefined,
|
|
@@ -457,55 +461,112 @@ export class ControlPane extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
457
461
|
stacked: undefined,
|
|
458
462
|
};
|
|
459
463
|
|
|
464
|
+
// Get ThemeSupport instance here just to make things a little less verbose.
|
|
465
|
+
const themeSupport = ThemeSupport.ThemeSupport.instance();
|
|
460
466
|
this.chartsInfo = [
|
|
461
467
|
{
|
|
462
468
|
...defaults,
|
|
463
469
|
title: i18nString(UIStrings.cpuUsage),
|
|
464
470
|
metrics: [
|
|
465
|
-
{
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
471
|
+
{
|
|
472
|
+
name: 'TaskDuration',
|
|
473
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-cpu-task-duration', this.element),
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
name: 'ScriptDuration',
|
|
477
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-cpu-script-duration', this.element),
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: 'LayoutDuration',
|
|
481
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-cpu-layout-duration', this.element),
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: 'RecalcStyleDuration',
|
|
485
|
+
color:
|
|
486
|
+
themeSupport.getComputedValue('--override-color-perf-monitor-cpu-recalc-style-duration', this.element),
|
|
487
|
+
},
|
|
469
488
|
],
|
|
470
489
|
format: Format.Percent,
|
|
471
490
|
smooth: true,
|
|
472
491
|
stacked: true,
|
|
473
|
-
color: '
|
|
492
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-cpu', this.element),
|
|
474
493
|
max: 1,
|
|
475
494
|
currentMax: undefined,
|
|
476
495
|
},
|
|
477
496
|
{
|
|
478
497
|
...defaults,
|
|
479
498
|
title: i18nString(UIStrings.jsHeapSize),
|
|
480
|
-
metrics: [
|
|
499
|
+
metrics: [
|
|
500
|
+
{
|
|
501
|
+
name: 'JSHeapTotalSize',
|
|
502
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-jsheap-total-size', this.element),
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
name: 'JSHeapUsedSize',
|
|
506
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-jsheap-used-size', this.element),
|
|
507
|
+
},
|
|
508
|
+
],
|
|
481
509
|
format: Format.Bytes,
|
|
482
|
-
color: '
|
|
510
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-jsheap'),
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
...defaults,
|
|
514
|
+
title: i18nString(UIStrings.domNodes),
|
|
515
|
+
metrics: [
|
|
516
|
+
{
|
|
517
|
+
name: 'Nodes',
|
|
518
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-dom-nodes', this.element),
|
|
519
|
+
},
|
|
520
|
+
],
|
|
483
521
|
},
|
|
484
|
-
{...defaults, title: i18nString(UIStrings.domNodes), metrics: [{name: 'Nodes', color: 'green'}]},
|
|
485
522
|
{
|
|
486
523
|
...defaults,
|
|
487
524
|
title: i18nString(UIStrings.jsEventListeners),
|
|
488
|
-
metrics: [
|
|
525
|
+
metrics: [
|
|
526
|
+
{
|
|
527
|
+
name: 'JSEventListeners',
|
|
528
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-js-event-listeners', this.element),
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
...defaults,
|
|
534
|
+
title: i18nString(UIStrings.documents),
|
|
535
|
+
metrics: [{
|
|
536
|
+
name: 'Documents',
|
|
537
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-documents', this.element),
|
|
538
|
+
}],
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
...defaults,
|
|
542
|
+
title: i18nString(UIStrings.documentFrames),
|
|
543
|
+
metrics: [{
|
|
544
|
+
name: 'Frames',
|
|
545
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-document-frames', this.element),
|
|
546
|
+
}],
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
...defaults,
|
|
550
|
+
title: i18nString(UIStrings.layoutsSec),
|
|
551
|
+
metrics: [{
|
|
552
|
+
name: 'LayoutCount',
|
|
553
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-layout-count', this.element),
|
|
554
|
+
}],
|
|
489
555
|
},
|
|
490
|
-
{...defaults, title: i18nString(UIStrings.documents), metrics: [{name: 'Documents', color: 'darkblue'}]},
|
|
491
|
-
{...defaults, title: i18nString(UIStrings.documentFrames), metrics: [{name: 'Frames', color: 'darkcyan'}]},
|
|
492
|
-
{...defaults, title: i18nString(UIStrings.layoutsSec), metrics: [{name: 'LayoutCount', color: 'hotpink'}]},
|
|
493
556
|
{
|
|
494
557
|
...defaults,
|
|
495
558
|
title: i18nString(UIStrings.styleRecalcsSec),
|
|
496
|
-
metrics: [
|
|
559
|
+
metrics: [
|
|
560
|
+
{
|
|
561
|
+
name: 'RecalcStyleCount',
|
|
562
|
+
color: themeSupport.getComputedValue('--override-color-perf-monitor-recalc-style-count', this.element),
|
|
563
|
+
},
|
|
564
|
+
],
|
|
497
565
|
},
|
|
498
566
|
];
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
info.color, ThemeSupport.ThemeSupport.ColorUsage.Foreground);
|
|
503
|
-
}
|
|
504
|
-
for (const metric of info.metrics) {
|
|
505
|
-
metric.color = ThemeSupport.ThemeSupport.instance().patchColorText(
|
|
506
|
-
metric.color, ThemeSupport.ThemeSupport.ColorUsage.Foreground);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
567
|
+
|
|
568
|
+
// Clear any existing child elements.
|
|
569
|
+
this.element.removeChildren();
|
|
509
570
|
|
|
510
571
|
this.indicators = new Map();
|
|
511
572
|
for (const chartInfo of this.chartsInfo) {
|
|
@@ -6,6 +6,38 @@
|
|
|
6
6
|
|
|
7
7
|
.perfmon-pane {
|
|
8
8
|
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
--override-color-perf-monitor-cpu: rgb(227 33 33);
|
|
11
|
+
--override-color-perf-monitor-cpu-task-duration: rgb(154 154 154);
|
|
12
|
+
--override-color-perf-monitor-cpu-script-duration: rgb(255 165 0);
|
|
13
|
+
--override-color-perf-monitor-cpu-layout-duration: rgb(138 43 226);
|
|
14
|
+
--override-color-perf-monitor-cpu-recalc-style-duration: rgb(238 130 238);
|
|
15
|
+
--override-color-perf-monitor-jsheap: rgb(0 0 255);
|
|
16
|
+
--override-color-perf-monitor-jsheap-total-size: rgb(153 153 255);
|
|
17
|
+
--override-color-perf-monitor-jsheap-used-size: rgb(0 0 255);
|
|
18
|
+
--override-color-perf-monitor-dom-nodes: rgb(11 154 11);
|
|
19
|
+
--override-color-perf-monitor-js-event-listeners: rgb(154 205 50);
|
|
20
|
+
--override-color-perf-monitor-documents: rgb(0 0 139);
|
|
21
|
+
--override-color-perf-monitor-document-frames: rgb(0 139 139);
|
|
22
|
+
--override-color-perf-monitor-layout-count: rgb(255 105 180);
|
|
23
|
+
--override-color-perf-monitor-recalc-style-count: rgb(255 20 147);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host-context(.-theme-with-dark-background) .perfmon-pane {
|
|
27
|
+
--override-color-perf-monitor-cpu: rgb(242 113 113);
|
|
28
|
+
--override-color-perf-monitor-cpu-task-duration: rgb(201 201 201);
|
|
29
|
+
--override-color-perf-monitor-cpu-script-duration: rgb(255 165 0);
|
|
30
|
+
--override-color-perf-monitor-cpu-layout-duration: rgb(124 29 212);
|
|
31
|
+
--override-color-perf-monitor-cpu-recalc-style-duration: rgb(179 49 179);
|
|
32
|
+
--override-color-perf-monitor-jsheap: rgb(153 153 255);
|
|
33
|
+
--override-color-perf-monitor-jsheap-total-size: rgb(153 153 255);
|
|
34
|
+
--override-color-perf-monitor-jsheap-used-size: rgb(0 0 255);
|
|
35
|
+
--override-color-perf-monitor-dom-nodes: rgb(127 255 127);
|
|
36
|
+
--override-color-perf-monitor-js-event-listeners: rgb(154 205 50);
|
|
37
|
+
--override-color-perf-monitor-documents: rgb(116 116 255);
|
|
38
|
+
--override-color-perf-monitor-document-frames: rgb(116 255 255);
|
|
39
|
+
--override-color-perf-monitor-layout-count: rgb(255 105 180);
|
|
40
|
+
--override-color-perf-monitor-recalc-style-count: rgb(235 0 127);
|
|
9
41
|
}
|
|
10
42
|
|
|
11
43
|
.perfmon-pane.suspended {
|
|
@@ -398,7 +398,7 @@ export class ProtocolMonitorImpl extends UI.Widget.VBox {
|
|
|
398
398
|
responseIcon.data = {iconName: 'ic_response', color: 'var(--color-text-disabled)', width: '16px', height: '16px'};
|
|
399
399
|
const newRow: DataGrid.DataGridUtils.Row = {
|
|
400
400
|
cells: [
|
|
401
|
-
{columnId: 'method', value: message.method},
|
|
401
|
+
{columnId: 'method', value: message.method, title: message.method},
|
|
402
402
|
{columnId: 'request', value: '', renderer: DataGrid.DataGridRenderers.codeBlockRenderer},
|
|
403
403
|
{
|
|
404
404
|
columnId: 'response',
|
|
@@ -439,7 +439,7 @@ export class ProtocolMonitorImpl extends UI.Widget.VBox {
|
|
|
439
439
|
'--override-data-grid-row-background-color': 'var(--override-data-grid-sent-message-row-background-color)',
|
|
440
440
|
},
|
|
441
441
|
cells: [
|
|
442
|
-
{columnId: 'method', value: message.method},
|
|
442
|
+
{columnId: 'method', value: message.method, title: message.method},
|
|
443
443
|
{
|
|
444
444
|
columnId: 'request',
|
|
445
445
|
value: JSON.stringify(message.params),
|
|
@@ -518,7 +518,7 @@ export class TimelineFlameChartView extends UI.Widget.VBox implements PerfUI.Fla
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
performSearch(searchConfig: UI.SearchableView.SearchConfig, shouldJump: boolean, jumpBackwards?: boolean): void {
|
|
521
|
-
this.searchRegex = searchConfig.toSearchRegex();
|
|
521
|
+
this.searchRegex = searchConfig.toSearchRegex().regex;
|
|
522
522
|
this.updateSearchResults(shouldJump, jumpBackwards);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
@@ -525,7 +525,7 @@ export class TimelineTreeView extends UI.Widget.VBox implements UI.SearchableVie
|
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
527
|
const searchRegex = searchConfig.toSearchRegex();
|
|
528
|
-
this.searchResults = this.root.searchTree(event => TimelineUIUtils.testContentMatching(event, searchRegex));
|
|
528
|
+
this.searchResults = this.root.searchTree(event => TimelineUIUtils.testContentMatching(event, searchRegex.regex));
|
|
529
529
|
this.searchableView.updateSearchMatchesCount(this.searchResults.length);
|
|
530
530
|
}
|
|
531
531
|
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
|
|
7
|
+
declare global {
|
|
8
|
+
class diff_match_patch {
|
|
9
|
+
diff_main(text1: string, text2: string): Array<{0: number, 1: string}>;
|
|
10
|
+
diff_cleanupSemantic(diff: Array<{0: number, 1: string}>): void;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
export const DiffWrapper = {
|
|
8
15
|
charDiff: function(text1: string, text2: string, cleanup?: boolean): {0: number, 1: string}[] {
|
|
9
16
|
const differ = new diff_match_patch();
|
|
@@ -16,7 +16,7 @@ const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
|
|
|
16
16
|
|
|
17
17
|
import {addColumnVisibilityCheckboxes, addSortableColumnItems} from './DataGridContextMenuUtils.js';
|
|
18
18
|
import type {CellPosition, Column, Row, SortState} from './DataGridUtils.js';
|
|
19
|
-
import {calculateColumnWidthPercentageFromWeighting, calculateFirstFocusableCell, getRowEntryForColumnId, handleArrowKeyNavigation, renderCellValue, SortDirection} from './DataGridUtils.js';
|
|
19
|
+
import {calculateColumnWidthPercentageFromWeighting, calculateFirstFocusableCell, getCellTitleFromCellContent, getRowEntryForColumnId, handleArrowKeyNavigation, renderCellValue, SortDirection} from './DataGridUtils.js';
|
|
20
20
|
|
|
21
21
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
22
22
|
const UIStrings = {
|
|
@@ -794,7 +794,7 @@ export class DataGrid extends HTMLElement {
|
|
|
794
794
|
style=${LitHtml.Directives.ifDefined(col.styles ? LitHtml.Directives.styleMap(col.styles) : undefined)}
|
|
795
795
|
tabindex=${cellIsFocusableCell ? '0' : '-1'}
|
|
796
796
|
aria-colindex=${columnIndex + 1}
|
|
797
|
-
title=${cell.title || String(cell.value)
|
|
797
|
+
title=${cell.title || getCellTitleFromCellContent(String(cell.value))}
|
|
798
798
|
data-row-index=${tableRowIndex}
|
|
799
799
|
data-col-index=${columnIndex}
|
|
800
800
|
data-grid-value-cell-for-column=${col.id}
|
|
@@ -597,6 +597,11 @@ export interface Replaceable {
|
|
|
597
597
|
replaceAllWith(searchConfig: SearchConfig, replacement: string): void;
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
+
export interface SearchRegexResult {
|
|
601
|
+
regex: RegExp;
|
|
602
|
+
fromQuery: boolean;
|
|
603
|
+
}
|
|
604
|
+
|
|
600
605
|
export class SearchConfig {
|
|
601
606
|
query: string;
|
|
602
607
|
caseSensitive: boolean;
|
|
@@ -608,20 +613,21 @@ export class SearchConfig {
|
|
|
608
613
|
this.isRegex = isRegex;
|
|
609
614
|
}
|
|
610
615
|
|
|
611
|
-
toSearchRegex(global?: boolean):
|
|
616
|
+
toSearchRegex(global?: boolean): SearchRegexResult {
|
|
612
617
|
let modifiers = this.caseSensitive ? '' : 'i';
|
|
613
618
|
if (global) {
|
|
614
619
|
modifiers += 'g';
|
|
615
620
|
}
|
|
616
621
|
const query = this.isRegex ? '/' + this.query + '/' : this.query;
|
|
617
622
|
|
|
618
|
-
let regex;
|
|
623
|
+
let regex: RegExp|undefined;
|
|
624
|
+
let fromQuery = false;
|
|
619
625
|
|
|
620
626
|
// First try creating regex if user knows the / / hint.
|
|
621
627
|
try {
|
|
622
628
|
if (/^\/.+\/$/.test(query)) {
|
|
623
629
|
regex = new RegExp(query.substring(1, query.length - 1), modifiers);
|
|
624
|
-
|
|
630
|
+
fromQuery = true;
|
|
625
631
|
}
|
|
626
632
|
} catch (e) {
|
|
627
633
|
// Silent catch.
|
|
@@ -632,6 +638,9 @@ export class SearchConfig {
|
|
|
632
638
|
regex = Platform.StringUtilities.createPlainTextSearchRegex(query, modifiers);
|
|
633
639
|
}
|
|
634
640
|
|
|
635
|
-
return
|
|
641
|
+
return {
|
|
642
|
+
regex,
|
|
643
|
+
fromQuery,
|
|
644
|
+
};
|
|
636
645
|
}
|
|
637
646
|
}
|
|
@@ -231,7 +231,7 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
|
|
|
231
231
|
let newIndex: number = this.currentSearchFocusIndex;
|
|
232
232
|
const previousSearchFocusElement = this.currentSearchTreeElements[newIndex];
|
|
233
233
|
this.searchCanceled();
|
|
234
|
-
this.searchRegex = searchConfig.toSearchRegex(true);
|
|
234
|
+
this.searchRegex = searchConfig.toSearchRegex(true).regex;
|
|
235
235
|
|
|
236
236
|
let element: UI.TreeOutline.TreeElement|null;
|
|
237
237
|
for (element = this.treeOutline.rootElement(); element; element = element.traverseNextTreeElement(false)) {
|
|
@@ -120,7 +120,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
120
120
|
private delayedFindSearchMatches: (() => void)|null;
|
|
121
121
|
private currentSearchResultIndex: number;
|
|
122
122
|
private searchResults: SearchMatch[];
|
|
123
|
-
private searchRegex:
|
|
123
|
+
private searchRegex: UI.SearchableView.SearchRegexResult|null;
|
|
124
124
|
private loadError: boolean;
|
|
125
125
|
private muteChangeEventsForSetContent: boolean;
|
|
126
126
|
private readonly sourcePosition: UI.Toolbar.ToolbarText;
|
|
@@ -830,7 +830,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
830
830
|
}
|
|
831
831
|
|
|
832
832
|
jumpToSearchResult(index: number): void {
|
|
833
|
-
if (!this.loaded || !this.searchResults.length) {
|
|
833
|
+
if (!this.loaded || !this.searchResults.length || !this.searchRegex) {
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
836
|
this.currentSearchResultIndex = (index + this.searchResults.length) % this.searchResults.length;
|
|
@@ -840,7 +840,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
840
840
|
const editor = this.textEditor;
|
|
841
841
|
const range = this.searchResults[this.currentSearchResultIndex];
|
|
842
842
|
editor.dispatch({
|
|
843
|
-
effects: setActiveSearch.of(new ActiveSearch(this.searchRegex
|
|
843
|
+
effects: setActiveSearch.of(new ActiveSearch(this.searchRegex, range)),
|
|
844
844
|
selection: {anchor: range.from, head: range.to},
|
|
845
845
|
scrollIntoView: true,
|
|
846
846
|
userEvent: 'select.search',
|
|
@@ -853,7 +853,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
853
853
|
return;
|
|
854
854
|
}
|
|
855
855
|
|
|
856
|
-
const insert =
|
|
856
|
+
const insert = this.searchRegex?.fromQuery ? range.insertPlaceholders(replacement) : replacement;
|
|
857
857
|
const editor = this.textEditor;
|
|
858
858
|
const changes = editor.state.changes({from: range.from, to: range.to, insert});
|
|
859
859
|
editor.dispatch(
|
|
@@ -869,7 +869,7 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
869
869
|
return;
|
|
870
870
|
}
|
|
871
871
|
|
|
872
|
-
const isRegExp = regex.
|
|
872
|
+
const isRegExp = regex.fromQuery;
|
|
873
873
|
const changes = ranges.map(
|
|
874
874
|
match =>
|
|
875
875
|
({from: match.from, to: match.to, insert: isRegExp ? match.insertPlaceholders(replacement) : replacement}));
|
|
@@ -877,13 +877,13 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
877
877
|
this.textEditor.dispatch({changes, scrollIntoView: true, userEvent: 'input.replace.all'});
|
|
878
878
|
}
|
|
879
879
|
|
|
880
|
-
private collectRegexMatches(
|
|
880
|
+
private collectRegexMatches({regex}: UI.SearchableView.SearchRegexResult): SearchMatch[] {
|
|
881
881
|
const ranges = [];
|
|
882
882
|
let pos = 0;
|
|
883
883
|
for (const line of this.textEditor.state.doc.iterLines()) {
|
|
884
|
-
|
|
884
|
+
regex.lastIndex = 0;
|
|
885
885
|
for (;;) {
|
|
886
|
-
const match =
|
|
886
|
+
const match = regex.exec(line);
|
|
887
887
|
if (!match) {
|
|
888
888
|
break;
|
|
889
889
|
}
|
|
@@ -1022,7 +1022,8 @@ const config = {
|
|
|
1022
1022
|
};
|
|
1023
1023
|
|
|
1024
1024
|
class ActiveSearch {
|
|
1025
|
-
constructor(
|
|
1025
|
+
constructor(
|
|
1026
|
+
readonly regexp: UI.SearchableView.SearchRegexResult, readonly currentRange: {from: number, to: number}|null) {
|
|
1026
1027
|
}
|
|
1027
1028
|
|
|
1028
1029
|
map(change: CodeMirror.ChangeDesc): ActiveSearch {
|
|
@@ -1036,7 +1037,7 @@ class ActiveSearch {
|
|
|
1036
1037
|
return Boolean(
|
|
1037
1038
|
a === b ||
|
|
1038
1039
|
a && b && a.currentRange?.from === b.currentRange?.from && a.currentRange?.to === b.currentRange?.to &&
|
|
1039
|
-
a.regexp.source === b.regexp.source && a.regexp.flags === b.regexp.flags);
|
|
1040
|
+
a.regexp.regex.source === b.regexp.regex.source && a.regexp.regex.flags === b.regexp.regex.flags);
|
|
1040
1041
|
}
|
|
1041
1042
|
}
|
|
1042
1043
|
|
|
@@ -1084,9 +1085,9 @@ const searchHighlighter = CodeMirror.ViewPlugin.fromClass(class {
|
|
|
1084
1085
|
let pos = from;
|
|
1085
1086
|
for (const part of doc.iterRange(from, to)) {
|
|
1086
1087
|
if (part !== '\n') {
|
|
1087
|
-
active.regexp.lastIndex = 0;
|
|
1088
|
+
active.regexp.regex.lastIndex = 0;
|
|
1088
1089
|
for (;;) {
|
|
1089
|
-
const match = active.regexp.exec(part);
|
|
1090
|
+
const match = active.regexp.regex.exec(part);
|
|
1090
1091
|
if (!match) {
|
|
1091
1092
|
break;
|
|
1092
1093
|
}
|
|
@@ -78,7 +78,7 @@ export class XMLView extends UI.Widget.Widget implements UI.SearchableView.Searc
|
|
|
78
78
|
if (!this.searchConfig) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const regex = this.searchConfig.toSearchRegex(true);
|
|
81
|
+
const {regex} = this.searchConfig.toSearchRegex(true);
|
|
82
82
|
const previousFocusElement = this.currentSearchTreeElements[this.currentSearchFocusIndex];
|
|
83
83
|
if (previousFocusElement) {
|
|
84
84
|
previousFocusElement.setSearchRegex(regex);
|
|
@@ -119,7 +119,7 @@ export class XMLView extends UI.Widget.Widget implements UI.SearchableView.Searc
|
|
|
119
119
|
const previousSearchFocusElement = this.currentSearchTreeElements[newIndex];
|
|
120
120
|
this.innerSearchCanceled();
|
|
121
121
|
this.currentSearchTreeElements = [];
|
|
122
|
-
const regex = this.searchConfig.toSearchRegex(true);
|
|
122
|
+
const {regex} = this.searchConfig.toSearchRegex(true);
|
|
123
123
|
|
|
124
124
|
for (let element: (UI.TreeOutline.TreeElement|null) =
|
|
125
125
|
(this.treeOutline.rootElement() as UI.TreeOutline.TreeElement | null);
|
|
@@ -41,7 +41,7 @@ import inspectorSyntaxHighlightDarkStyles from '../inspectorSyntaxHighlightDark.
|
|
|
41
41
|
|
|
42
42
|
let themeSupportInstance: ThemeSupport;
|
|
43
43
|
|
|
44
|
-
const themeValuesCache = new Map<string, string
|
|
44
|
+
const themeValuesCache = new Map<CSSStyleDeclaration, Map<string, string>>();
|
|
45
45
|
|
|
46
46
|
export class ThemeSupport {
|
|
47
47
|
private readonly themeNameInternal: string;
|
|
@@ -96,20 +96,35 @@ export class ThemeSupport {
|
|
|
96
96
|
return themeSupportInstance;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
getComputedValue(variableName: string): string {
|
|
100
|
-
const computedRoot = this.computedRoot();
|
|
101
|
-
|
|
99
|
+
getComputedValue(variableName: string, target: Element|null = null): string {
|
|
100
|
+
const computedRoot = target ? window.getComputedStyle(target) : this.computedRoot();
|
|
102
101
|
if (typeof computedRoot === 'symbol') {
|
|
103
102
|
throw new Error(`Computed value for property (${variableName}) could not be found on :root.`);
|
|
104
103
|
}
|
|
105
104
|
|
|
105
|
+
// Since we might query the same variable name from various targets we need to support
|
|
106
|
+
// per-target caching of computed values. Here we attempt to locate the particular computed
|
|
107
|
+
// value cache for the target. If no target was specified we use the default computed root,
|
|
108
|
+
// which belongs to the document element.
|
|
109
|
+
let computedRootCache = themeValuesCache.get(computedRoot);
|
|
110
|
+
if (!computedRootCache) {
|
|
111
|
+
computedRootCache = new Map<string, string>();
|
|
112
|
+
themeValuesCache.set(computedRoot, computedRootCache);
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
// Since theme changes trigger a reload, we can avoid repeatedly looking up color values
|
|
107
116
|
// dynamically. Instead we can look up the first time and cache them for future use,
|
|
108
117
|
// knowing that the cache will be invalidated by virtue of a reload when the theme changes.
|
|
109
|
-
let cachedValue =
|
|
118
|
+
let cachedValue = computedRootCache.get(variableName);
|
|
110
119
|
if (!cachedValue) {
|
|
111
|
-
cachedValue = computedRoot.getPropertyValue(variableName);
|
|
112
|
-
|
|
120
|
+
cachedValue = computedRoot.getPropertyValue(variableName).trim();
|
|
121
|
+
|
|
122
|
+
// If we receive back an empty value (nothing has been set) we don't store it for the future.
|
|
123
|
+
// This means that subsequent requests will continue to query the styles in case the value
|
|
124
|
+
// has been set.
|
|
125
|
+
if (cachedValue) {
|
|
126
|
+
computedRootCache.set(variableName, cachedValue);
|
|
127
|
+
}
|
|
113
128
|
}
|
|
114
129
|
|
|
115
130
|
return cachedValue;
|
package/package.json
CHANGED