chrome-devtools-frontend 1.0.999279 → 1.0.999791
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/front_end/core/dom_extension/DOMExtension.ts +0 -10
- package/front_end/core/i18n/locales/en-US.json +0 -9
- package/front_end/core/i18n/locales/en-XL.json +0 -9
- package/front_end/panels/timeline/TimelineEventOverview.ts +0 -60
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -9
- package/front_end/panels/timeline/TimelineHistoryManager.ts +0 -2
- package/front_end/panels/timeline/TimelinePanel.ts +0 -2
- package/front_end/panels/timeline/TimelineUIUtils.ts +0 -6
- package/front_end/panels/timeline/timeline-legacy.ts +0 -3
- package/front_end/panels/timeline/timelinePanel.css +0 -6
- package/package.json +1 -1
- package/scripts/reformat-clang-js-ts.js +60 -0
@@ -532,16 +532,6 @@ Node.prototype.setTextContentTruncatedIfNeeded = function(text: string|Node, pla
|
|
532
532
|
return false;
|
533
533
|
};
|
534
534
|
|
535
|
-
Document.prototype.deepActiveElement = function(): Element|null {
|
536
|
-
let activeElement: Element|(Element | null) = this.activeElement;
|
537
|
-
while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) {
|
538
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
539
|
-
}
|
540
|
-
return activeElement;
|
541
|
-
};
|
542
|
-
|
543
|
-
DocumentFragment.prototype.deepActiveElement = Document.prototype.deepActiveElement;
|
544
|
-
|
545
535
|
Element.prototype.hasFocus = function(): boolean {
|
546
536
|
const root = this.getComponentRoot();
|
547
537
|
return Boolean(root) && this.isSelfOrAncestor(root.activeElement);
|
@@ -10238,9 +10238,6 @@
|
|
10238
10238
|
"panels/timeline/TimelineEventOverview.ts | cpu": {
|
10239
10239
|
"message": "CPU"
|
10240
10240
|
},
|
10241
|
-
"panels/timeline/TimelineEventOverview.ts | fps": {
|
10242
|
-
"message": "FPS"
|
10243
|
-
},
|
10244
10241
|
"panels/timeline/TimelineEventOverview.ts | heap": {
|
10245
10242
|
"message": "HEAP"
|
10246
10243
|
},
|
@@ -10307,9 +10304,6 @@
|
|
10307
10304
|
"panels/timeline/TimelineFlameChartDataProvider.ts | rasterizerThreadS": {
|
10308
10305
|
"message": "Rasterizer Thread {PH1}"
|
10309
10306
|
},
|
10310
|
-
"panels/timeline/TimelineFlameChartDataProvider.ts | sFfps": {
|
10311
|
-
"message": "{PH1} ~ {PH2} fps"
|
10312
|
-
},
|
10313
10307
|
"panels/timeline/TimelineFlameChartDataProvider.ts | sSelfS": {
|
10314
10308
|
"message": "{PH1} (self {PH2})"
|
10315
10309
|
},
|
@@ -10823,9 +10817,6 @@
|
|
10823
10817
|
"panels/timeline/TimelineUIUtils.ts | forcedReflow": {
|
10824
10818
|
"message": "Forced reflow"
|
10825
10819
|
},
|
10826
|
-
"panels/timeline/TimelineUIUtils.ts | fps": {
|
10827
|
-
"message": "FPS"
|
10828
|
-
},
|
10829
10820
|
"panels/timeline/TimelineUIUtils.ts | frame": {
|
10830
10821
|
"message": "Frame"
|
10831
10822
|
},
|
@@ -10238,9 +10238,6 @@
|
|
10238
10238
|
"panels/timeline/TimelineEventOverview.ts | cpu": {
|
10239
10239
|
"message": "ĈṔÛ"
|
10240
10240
|
},
|
10241
|
-
"panels/timeline/TimelineEventOverview.ts | fps": {
|
10242
|
-
"message": "F̂ṔŜ"
|
10243
|
-
},
|
10244
10241
|
"panels/timeline/TimelineEventOverview.ts | heap": {
|
10245
10242
|
"message": "ĤÉÂṔ"
|
10246
10243
|
},
|
@@ -10307,9 +10304,6 @@
|
|
10307
10304
|
"panels/timeline/TimelineFlameChartDataProvider.ts | rasterizerThreadS": {
|
10308
10305
|
"message": "R̂áŝt́êŕîźêŕ T̂h́r̂éâd́ {PH1}"
|
10309
10306
|
},
|
10310
|
-
"panels/timeline/TimelineFlameChartDataProvider.ts | sFfps": {
|
10311
|
-
"message": "{PH1} ~ {PH2} f̂ṕŝ"
|
10312
|
-
},
|
10313
10307
|
"panels/timeline/TimelineFlameChartDataProvider.ts | sSelfS": {
|
10314
10308
|
"message": "{PH1} (ŝél̂f́ {PH2})"
|
10315
10309
|
},
|
@@ -10823,9 +10817,6 @@
|
|
10823
10817
|
"panels/timeline/TimelineUIUtils.ts | forcedReflow": {
|
10824
10818
|
"message": "F̂ór̂ćêd́ r̂éf̂ĺôẃ"
|
10825
10819
|
},
|
10826
|
-
"panels/timeline/TimelineUIUtils.ts | fps": {
|
10827
|
-
"message": "F̂ṔŜ"
|
10828
|
-
},
|
10829
10820
|
"panels/timeline/TimelineUIUtils.ts | frame": {
|
10830
10821
|
"message": "F̂ŕâḿê"
|
10831
10822
|
},
|
@@ -53,10 +53,6 @@ const UIStrings = {
|
|
53
53
|
/**
|
54
54
|
*@description Text in Timeline Event Overview of the Performance panel
|
55
55
|
*/
|
56
|
-
fps: 'FPS',
|
57
|
-
/**
|
58
|
-
*@description Text in Timeline Event Overview of the Performance panel
|
59
|
-
*/
|
60
56
|
heap: 'HEAP',
|
61
57
|
/**
|
62
58
|
*@description Heap size label text content in Timeline Event Overview of the Performance panel
|
@@ -485,62 +481,6 @@ export class TimelineFilmStripOverview extends TimelineEventOverview {
|
|
485
481
|
static readonly Padding = 2;
|
486
482
|
}
|
487
483
|
|
488
|
-
export class TimelineEventOverviewFrames extends TimelineEventOverview {
|
489
|
-
constructor() {
|
490
|
-
super('framerate', i18nString(UIStrings.fps));
|
491
|
-
}
|
492
|
-
|
493
|
-
update(): void {
|
494
|
-
super.update();
|
495
|
-
if (!this.model) {
|
496
|
-
return;
|
497
|
-
}
|
498
|
-
const frames = this.model.frames();
|
499
|
-
if (!frames.length) {
|
500
|
-
return;
|
501
|
-
}
|
502
|
-
const height = this.height();
|
503
|
-
const padding = Number(window.devicePixelRatio);
|
504
|
-
const baseFrameDurationMs = 1e3 / 60;
|
505
|
-
const visualHeight = height - 2 * padding;
|
506
|
-
const timeOffset = this.model.timelineModel().minimumRecordTime();
|
507
|
-
const timeSpan = this.model.timelineModel().maximumRecordTime() - timeOffset;
|
508
|
-
const scale = this.width() / timeSpan;
|
509
|
-
const baseY = height - padding;
|
510
|
-
const ctx = this.context();
|
511
|
-
const bottomY = baseY + 10 * window.devicePixelRatio;
|
512
|
-
let x = 0;
|
513
|
-
let y: number = bottomY;
|
514
|
-
|
515
|
-
const lineWidth = window.devicePixelRatio;
|
516
|
-
const offset = lineWidth & 1 ? 0.5 : 0;
|
517
|
-
const tickDepth = 1.5 * window.devicePixelRatio;
|
518
|
-
ctx.beginPath();
|
519
|
-
ctx.moveTo(0, y);
|
520
|
-
for (let i = 0; i < frames.length; ++i) {
|
521
|
-
const frame = frames[i];
|
522
|
-
x = Math.round((frame.startTime - timeOffset) * scale) + offset;
|
523
|
-
ctx.lineTo(x, y);
|
524
|
-
ctx.lineTo(x, y + tickDepth);
|
525
|
-
y = frame.idle ? bottomY :
|
526
|
-
Math.round(baseY - visualHeight * Math.min(baseFrameDurationMs / frame.duration, 1)) - offset;
|
527
|
-
ctx.lineTo(x, y + tickDepth);
|
528
|
-
ctx.lineTo(x, y);
|
529
|
-
}
|
530
|
-
const lastFrame = frames[frames.length - 1];
|
531
|
-
if (lastFrame) {
|
532
|
-
x = Math.round((lastFrame.startTime + lastFrame.duration - timeOffset) * scale) + offset;
|
533
|
-
}
|
534
|
-
ctx.lineTo(x, y);
|
535
|
-
ctx.lineTo(x, bottomY);
|
536
|
-
ctx.fillStyle = 'hsl(110, 50%, 88%)';
|
537
|
-
ctx.strokeStyle = 'hsl(110, 50%, 60%)';
|
538
|
-
ctx.lineWidth = lineWidth;
|
539
|
-
ctx.fill();
|
540
|
-
ctx.stroke();
|
541
|
-
}
|
542
|
-
}
|
543
|
-
|
544
484
|
export class TimelineEventOverviewMemory extends TimelineEventOverview {
|
545
485
|
private heapSizeLabel: HTMLElement;
|
546
486
|
constructor() {
|
@@ -131,12 +131,6 @@ const UIStrings = {
|
|
131
131
|
occurrencesS: 'Occurrences: {PH1}',
|
132
132
|
/**
|
133
133
|
*@description Text in Timeline Flame Chart Data Provider of the Performance panel
|
134
|
-
*@example {10ms} PH1
|
135
|
-
*@example {100.0} PH2
|
136
|
-
*/
|
137
|
-
sFfps: '{PH1} ~ {PH2} fps',
|
138
|
-
/**
|
139
|
-
*@description Text in Timeline Flame Chart Data Provider of the Performance panel
|
140
134
|
*/
|
141
135
|
idleFrame: 'Idle Frame',
|
142
136
|
/**
|
@@ -1005,9 +999,7 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
|
|
1005
999
|
|
1006
1000
|
} else if (type === EntryType.Frame) {
|
1007
1001
|
const frame = (this.entryData[entryIndex] as TimelineModel.TimelineFrameModel.TimelineFrame);
|
1008
|
-
time =
|
1009
|
-
UIStrings.sFfps,
|
1010
|
-
{PH1: i18n.TimeUtilities.preciseMillisToString(frame.duration, 1), PH2: (1000 / frame.duration).toFixed(0)});
|
1002
|
+
time = i18n.TimeUtilities.preciseMillisToString(frame.duration, 1);
|
1011
1003
|
|
1012
1004
|
if (frame.idle) {
|
1013
1005
|
title = i18nString(UIStrings.idleFrame);
|
@@ -12,7 +12,6 @@ import timelineHistoryManagerStyles from './timelineHistoryManager.css.js';
|
|
12
12
|
import type {PerformanceModel} from './PerformanceModel.js';
|
13
13
|
import {
|
14
14
|
TimelineEventOverviewCPUActivity,
|
15
|
-
TimelineEventOverviewFrames,
|
16
15
|
TimelineEventOverviewNetwork,
|
17
16
|
TimelineEventOverviewResponsiveness,
|
18
17
|
} from './TimelineEventOverview.js';
|
@@ -86,7 +85,6 @@ export class TimelineHistoryManager {
|
|
86
85
|
|
87
86
|
this.allOverviews = [
|
88
87
|
{constructor: TimelineEventOverviewResponsiveness, height: 3},
|
89
|
-
{constructor: TimelineEventOverviewFrames, height: 16},
|
90
88
|
{constructor: TimelineEventOverviewCPUActivity, height: 20},
|
91
89
|
{constructor: TimelineEventOverviewNetwork, height: 8},
|
92
90
|
];
|
@@ -60,7 +60,6 @@ import type {TimelineEventOverview} from './TimelineEventOverview.js';
|
|
60
60
|
import {
|
61
61
|
TimelineEventOverviewCoverage,
|
62
62
|
TimelineEventOverviewCPUActivity,
|
63
|
-
TimelineEventOverviewFrames,
|
64
63
|
TimelineEventOverviewInput,
|
65
64
|
TimelineEventOverviewMemory,
|
66
65
|
TimelineEventOverviewNetwork,
|
@@ -710,7 +709,6 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
|
|
710
709
|
if (Root.Runtime.experiments.isEnabled('inputEventsOnTimelineOverview')) {
|
711
710
|
this.overviewControls.push(new TimelineEventOverviewInput());
|
712
711
|
}
|
713
|
-
this.overviewControls.push(new TimelineEventOverviewFrames());
|
714
712
|
this.overviewControls.push(new TimelineEventOverviewCPUActivity());
|
715
713
|
this.overviewControls.push(new TimelineEventOverviewNetwork());
|
716
714
|
if (this.showScreenshotsSetting.get() && this.performanceModel &&
|
@@ -1069,10 +1069,6 @@ const UIStrings = {
|
|
1069
1069
|
*/
|
1070
1070
|
frame: 'Frame',
|
1071
1071
|
/**
|
1072
|
-
*@description Text in Timeline Event Overview of the Performance panel
|
1073
|
-
*/
|
1074
|
-
fps: 'FPS',
|
1075
|
-
/**
|
1076
1072
|
*@description Text in Timeline UIUtils of the Performance panel
|
1077
1073
|
*/
|
1078
1074
|
cpuTime: 'CPU time',
|
@@ -3089,8 +3085,6 @@ export class TimelineUIUtils {
|
|
3089
3085
|
|
3090
3086
|
const duration = TimelineUIUtils.frameDuration(frame);
|
3091
3087
|
contentHelper.appendElementRow(i18nString(UIStrings.duration), duration, frame.hasWarnings());
|
3092
|
-
const durationInMillis = frame.endTime - frame.startTime;
|
3093
|
-
contentHelper.appendTextRow(i18nString(UIStrings.fps), Math.floor(1000 / durationInMillis));
|
3094
3088
|
contentHelper.appendTextRow(i18nString(UIStrings.cpuTime), i18n.TimeUtilities.millisToString(frame.cpuTime, true));
|
3095
3089
|
if (filmStripFrame) {
|
3096
3090
|
const filmStripPreview = document.createElement('div');
|
@@ -74,9 +74,6 @@ Timeline.TimelineEventOverviewResponsiveness = TimelineModule.TimelineEventOverv
|
|
74
74
|
/** @constructor */
|
75
75
|
Timeline.TimelineFilmStripOverview = TimelineModule.TimelineEventOverview.TimelineFilmStripOverview;
|
76
76
|
|
77
|
-
/** @constructor */
|
78
|
-
Timeline.TimelineEventOverviewFrames = TimelineModule.TimelineEventOverview.TimelineEventOverviewFrames;
|
79
|
-
|
80
77
|
/** @constructor */
|
81
78
|
Timeline.TimelineEventOverviewMemory = TimelineModule.TimelineEventOverview.TimelineEventOverviewMemory;
|
82
79
|
|
@@ -111,11 +111,6 @@
|
|
111
111
|
flex-basis: 8px;
|
112
112
|
}
|
113
113
|
|
114
|
-
#timeline-overview-framerate {
|
115
|
-
flex-basis: 16px;
|
116
|
-
margin-top: 0 !important; /* stylelint-disable-line declaration-no-important */
|
117
|
-
}
|
118
|
-
|
119
114
|
#timeline-overview-filmstrip {
|
120
115
|
flex-basis: 30px;
|
121
116
|
}
|
@@ -124,7 +119,6 @@
|
|
124
119
|
flex-basis: 20px;
|
125
120
|
}
|
126
121
|
|
127
|
-
#timeline-overview-framerate::before,
|
128
122
|
#timeline-overview-network::before,
|
129
123
|
#timeline-overview-cpu-activity::before {
|
130
124
|
content: "";
|
package/package.json
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Run this script to re-format all .js and .ts files found
|
7
|
+
* node scripts/reformat-clang-js-ts.js --directory=front_end
|
8
|
+
* The script starts in the given directory and recursively finds all `.js` and `.ts` files to reformat.
|
9
|
+
* Any `.clang-format` with `DisableFormat: true` is respected; those
|
10
|
+
* directories will not be used.
|
11
|
+
**/
|
12
|
+
|
13
|
+
const fs = require('fs');
|
14
|
+
const path = require('path');
|
15
|
+
const childProcess = require('child_process');
|
16
|
+
|
17
|
+
const yargs = require('yargs')
|
18
|
+
.option('dry-run', {
|
19
|
+
type: 'boolean',
|
20
|
+
default: false,
|
21
|
+
desc: 'Logs which files will be formatted, but doesn\'t write to disk',
|
22
|
+
})
|
23
|
+
.option('directory', {type: 'string', demandOption: true, desc: 'The starting directory to run in.'})
|
24
|
+
.strict()
|
25
|
+
.argv;
|
26
|
+
|
27
|
+
const startingDirectory = path.join(process.cwd(), yargs.directory);
|
28
|
+
|
29
|
+
const filesToFormat = [];
|
30
|
+
function processDirectory(dir) {
|
31
|
+
const contents = fs.readdirSync(dir);
|
32
|
+
|
33
|
+
if (contents.includes('.clang-format')) {
|
34
|
+
const clangFormatConfig = fs.readFileSync(path.join(dir, '.clang-format'), 'utf8');
|
35
|
+
if (clangFormatConfig.includes('DisableFormat: true')) {
|
36
|
+
return;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
for (const item of contents) {
|
40
|
+
const fullPath = path.join(dir, item);
|
41
|
+
if (fs.lstatSync(fullPath).isDirectory()) {
|
42
|
+
processDirectory(fullPath);
|
43
|
+
} else if (['.ts', '.js'].includes(path.extname(fullPath))) {
|
44
|
+
filesToFormat.push(fullPath);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
processDirectory(startingDirectory);
|
50
|
+
filesToFormat.forEach((file, index) => {
|
51
|
+
console.log(`Formatting ${index + 1}/${filesToFormat.length}`, path.relative(process.cwd(), file));
|
52
|
+
|
53
|
+
if (yargs.dryRun) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
const out = String(childProcess.execSync(`clang-format -i ${file}`));
|
57
|
+
if (out.trim() !== '') {
|
58
|
+
console.log(out);
|
59
|
+
}
|
60
|
+
});
|