chrome-devtools-frontend 1.0.1521880 → 1.0.1522585
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/docs/ui_engineering.md +76 -0
- package/front_end/core/host/GdpClient.ts +116 -66
- package/front_end/core/root/Runtime.ts +1 -0
- package/front_end/core/sdk/EnhancedTracesParser.ts +13 -6
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +82 -32
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +7 -1
- package/front_end/generated/Deprecation.ts +4 -4
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +10 -6
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +559 -0
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +42 -4
- package/front_end/models/badges/UserBadges.ts +14 -16
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/trace/LanternComputationData.ts +1 -0
- package/front_end/models/trace/handlers/NetworkRequestsHandler.ts +10 -0
- package/front_end/models/trace/insights/DocumentLatency.ts +9 -10
- package/front_end/models/trace/types/TraceEvents.ts +6 -5
- package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -2
- package/front_end/panels/application/IndexedDBViews.ts +1 -0
- package/front_end/panels/application/ReportingApiTreeElement.ts +1 -2
- package/front_end/panels/application/ReportingApiView.ts +18 -20
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -0
- package/front_end/panels/application/components/EndpointsGrid.ts +51 -59
- package/front_end/panels/application/components/ReportsGrid.ts +86 -107
- package/front_end/panels/application/components/StorageMetadataView.ts +30 -4
- package/front_end/panels/application/components/endpointsGrid.css +30 -0
- package/front_end/panels/application/components/reportsGrid.css +34 -0
- package/front_end/panels/application/components/storageMetadataView.css +9 -0
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +19 -27
- package/front_end/panels/common/BadgeNotification.ts +10 -3
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +31 -32
- package/front_end/panels/search/SearchResultsPane.ts +14 -13
- package/front_end/panels/search/SearchView.ts +3 -20
- package/front_end/panels/settings/components/SyncSection.ts +8 -6
- package/front_end/panels/sources/SearchSourcesView.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +17 -0
- package/front_end/panels/timeline/TimelinePanel.ts +5 -0
- package/front_end/panels/timeline/TimelineUIUtils.ts +12 -3
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +21 -9
- package/front_end/panels/timeline/timelineDetailsView.css +5 -0
- package/front_end/panels/whats_new/ReleaseNoteText.ts +15 -11
- package/front_end/panels/whats_new/resources/WNDT.md +9 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/diff/README.chromium +0 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +13 -4
- package/front_end/ui/legacy/Treeoutline.ts +6 -9
- package/front_end/ui/legacy/UIUtils.ts +4 -17
- package/front_end/ui/legacy/Widget.ts +0 -5
- package/front_end/ui/legacy/XElement.ts +0 -33
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +38 -21
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +29 -0
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +3 -2
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/application/components/reportingApiGrid.css +0 -31
- package/front_end/ui/legacy/XWidget.ts +0 -133
@@ -149,8 +149,7 @@ interface DialogParsedTrace {
|
|
149
149
|
}
|
150
150
|
|
151
151
|
export class Dialog {
|
152
|
-
private
|
153
|
-
private readonly widget: UI.XWidget.XWidget;
|
152
|
+
private readonly widget: UI.Widget.Widget;
|
154
153
|
private index: number;
|
155
154
|
private dialog: UI.Dialog.Dialog|null = null;
|
156
155
|
|
@@ -173,21 +172,32 @@ export class Dialog {
|
|
173
172
|
UI.Tooltip.Tooltip.install(prevButton, i18nString(UIStrings.previousFrame));
|
174
173
|
const nextButton = UI.UIUtils.createTextButton('\u25B6', this.onNextFrame.bind(this));
|
175
174
|
UI.Tooltip.Tooltip.install(nextButton, i18nString(UIStrings.nextFrame));
|
176
|
-
this.
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
175
|
+
this.widget = new UI.Widget.Widget({classes: ['film-strip-image-dialog']});
|
176
|
+
this.widget.registerRequiredCSS(filmStripViewStyles);
|
177
|
+
|
178
|
+
const imageBox = document.createElement('div');
|
179
|
+
imageBox.classList.add('image-box');
|
180
|
+
|
181
|
+
const image = document.createElement('img');
|
182
|
+
image.setAttribute('data-film-strip-dialog-img', '');
|
183
|
+
imageBox.append(image);
|
184
|
+
|
185
|
+
const buttonBox = document.createElement('div');
|
186
|
+
buttonBox.classList.add('button-box');
|
187
|
+
|
188
|
+
const timeBox = document.createElement('div');
|
189
|
+
timeBox.classList.add('time-box');
|
190
|
+
|
191
|
+
buttonBox.append(prevButton);
|
192
|
+
buttonBox.append(timeBox);
|
193
|
+
buttonBox.append(nextButton);
|
194
|
+
|
195
|
+
this.widget.contentElement.append(imageBox);
|
196
|
+
this.widget.contentElement.append(buttonBox);
|
197
|
+
|
198
|
+
this.widget.element.tabIndex = 0;
|
199
|
+
this.widget.contentElement.append();
|
200
|
+
this.widget.contentElement.addEventListener('keydown', this.keyDown.bind(this), false);
|
191
201
|
this.dialog = null;
|
192
202
|
|
193
203
|
void this.render();
|
@@ -210,8 +220,8 @@ export class Dialog {
|
|
210
220
|
private resize(): void {
|
211
221
|
if (!this.dialog) {
|
212
222
|
this.dialog = new UI.Dialog.Dialog();
|
213
|
-
this.
|
214
|
-
this.dialog.setDefaultFocusedElement(this.widget);
|
223
|
+
this.widget.show(this.dialog.contentElement);
|
224
|
+
this.dialog.setDefaultFocusedElement(this.widget.element);
|
215
225
|
this.dialog.show();
|
216
226
|
}
|
217
227
|
this.dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
|
@@ -273,8 +283,15 @@ export class Dialog {
|
|
273
283
|
private render(): void {
|
274
284
|
const frame = this.#data.frames[this.index];
|
275
285
|
const timestamp = Trace.Helpers.Timing.microToMilli(frame.screenshotEvent.ts);
|
276
|
-
|
277
|
-
|
286
|
+
const timeBox = this.widget.contentElement.querySelector('.time-box');
|
287
|
+
if (timeBox) {
|
288
|
+
timeBox.textContent = i18n.TimeUtilities.millisToString(timestamp - this.#zeroTime());
|
289
|
+
}
|
290
|
+
|
291
|
+
const image = this.widget.contentElement.querySelector('img');
|
292
|
+
if (!image) {
|
293
|
+
return;
|
294
|
+
}
|
278
295
|
image.setAttribute('data-frame-index', this.index.toString());
|
279
296
|
const imgData = Trace.Handlers.ModelHandlers.Screenshots.screenshotImageDataUri(frame.screenshotEvent);
|
280
297
|
FilmStripView.setImageData(image, imgData);
|
@@ -59,3 +59,32 @@
|
|
59
59
|
.film-strip-view .frame:focus .thumbnail img {
|
60
60
|
box-shadow: none;
|
61
61
|
}
|
62
|
+
|
63
|
+
.film-strip-image-dialog {
|
64
|
+
display: flex;
|
65
|
+
flex-direction: column;
|
66
|
+
width: 100%;
|
67
|
+
|
68
|
+
.image-box {
|
69
|
+
overflow: auto;
|
70
|
+
margin: var(--sys-size-7) var(--sys-size-8) var(--sys-size-8)
|
71
|
+
var(--sys-size-8);
|
72
|
+
border: var(--sys-size-1) solid var(--sys-color-divider);
|
73
|
+
}
|
74
|
+
|
75
|
+
img {
|
76
|
+
max-height: 80vh;
|
77
|
+
max-width: 80vw;
|
78
|
+
}
|
79
|
+
|
80
|
+
.time-box {
|
81
|
+
margin: 0 var(--sys-size-3);
|
82
|
+
}
|
83
|
+
|
84
|
+
.button-box {
|
85
|
+
display: flex;
|
86
|
+
align-items: center;
|
87
|
+
justify-content: center;
|
88
|
+
margin: var(--sys-size-6) 0 var(--sys-size-5);
|
89
|
+
}
|
90
|
+
}
|
@@ -5,6 +5,7 @@
|
|
5
5
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
6
6
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
7
7
|
import * as Lit from '../../../lit/lit.js';
|
8
|
+
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
8
9
|
import * as UI from '../../legacy.js';
|
9
10
|
|
10
11
|
import xmlTreeStyles from './xmlTree.css.js';
|
@@ -29,7 +30,7 @@ function* attributes(element: Element): Generator<Attr> {
|
|
29
30
|
}
|
30
31
|
|
31
32
|
function hasNonTextChildren(node: Node): boolean {
|
32
|
-
return node.childNodes.
|
33
|
+
return Boolean(node.childNodes.values().find(node => node.nodeType !== Node.TEXT_NODE));
|
33
34
|
}
|
34
35
|
|
35
36
|
function textView(treeNode: XMLTreeViewNode, closeTag: boolean): string {
|
@@ -249,7 +250,7 @@ export class XMLView extends UI.Widget.Widget implements UI.SearchableView.Searc
|
|
249
250
|
#nextJump: SearchResult|undefined;
|
250
251
|
|
251
252
|
constructor(target?: HTMLElement, view: View = DEFAULT_VIEW) {
|
252
|
-
super(target, {jslog: 'xml-view'
|
253
|
+
super(target, {jslog: `${VisualLogging.pane('xml-view')}`, classes: ['shadow-xml-view', 'source-code']});
|
253
254
|
this.#view = view;
|
254
255
|
}
|
255
256
|
|
@@ -52,7 +52,6 @@ import * as ViewManager from './ViewManager.js';
|
|
52
52
|
import * as Widget from './Widget.js';
|
53
53
|
import * as XElement from './XElement.js';
|
54
54
|
import * as XLink from './XLink.js';
|
55
|
-
import * as XWidget from './XWidget.js';
|
56
55
|
import * as ZoomManager from './ZoomManager.js';
|
57
56
|
|
58
57
|
export {
|
@@ -106,6 +105,5 @@ export {
|
|
106
105
|
Widget,
|
107
106
|
XElement,
|
108
107
|
XLink,
|
109
|
-
XWidget,
|
110
108
|
ZoomManager,
|
111
109
|
};
|
package/package.json
CHANGED
@@ -1,31 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2021 The Chromium Authors
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
4
|
-
* found in the LICENSE file.
|
5
|
-
*/
|
6
|
-
|
7
|
-
:host {
|
8
|
-
overflow: auto;
|
9
|
-
height: 100%;
|
10
|
-
}
|
11
|
-
|
12
|
-
.reporting-container {
|
13
|
-
height: 100%;
|
14
|
-
display: flex;
|
15
|
-
flex-direction: column;
|
16
|
-
}
|
17
|
-
|
18
|
-
.reporting-header {
|
19
|
-
font-size: 15px;
|
20
|
-
background-color: var(--sys-color-surface2);
|
21
|
-
padding: 1px 4px;
|
22
|
-
flex-shrink: 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
devtools-data-grid {
|
26
|
-
flex: auto;
|
27
|
-
}
|
28
|
-
|
29
|
-
.inline-icon {
|
30
|
-
vertical-align: text-bottom;
|
31
|
-
}
|
@@ -1,133 +0,0 @@
|
|
1
|
-
// Copyright 2017 The Chromium Authors
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
3
|
-
// found in the LICENSE file.
|
4
|
-
|
5
|
-
import {XElement} from './XElement.js';
|
6
|
-
|
7
|
-
let observer: ResizeObserver|null = null;
|
8
|
-
|
9
|
-
const storedScrollPositions = new WeakMap<Element, {
|
10
|
-
scrollLeft: number,
|
11
|
-
scrollTop: number,
|
12
|
-
}>();
|
13
|
-
|
14
|
-
export class XWidget extends XElement {
|
15
|
-
private visible: boolean;
|
16
|
-
defaultFocusedElement: Element|null;
|
17
|
-
private elementsToRestoreScrollPositionsFor: Element[];
|
18
|
-
private onShownCallback!: (() => void)|null;
|
19
|
-
private onHiddenCallback!: (() => void)|null;
|
20
|
-
private onResizedCallback!: (() => void)|null;
|
21
|
-
|
22
|
-
constructor() {
|
23
|
-
super();
|
24
|
-
this.style.setProperty('display', 'flex');
|
25
|
-
this.style.setProperty('flex-direction', 'column');
|
26
|
-
this.style.setProperty('align-items', 'stretch');
|
27
|
-
this.style.setProperty('justify-content', 'flex-start');
|
28
|
-
this.style.setProperty('contain', 'layout style');
|
29
|
-
|
30
|
-
this.visible = false;
|
31
|
-
this.defaultFocusedElement = null;
|
32
|
-
this.elementsToRestoreScrollPositionsFor = [];
|
33
|
-
|
34
|
-
if (!observer) {
|
35
|
-
observer = new ResizeObserver(entries => {
|
36
|
-
for (const entry of entries) {
|
37
|
-
const widget = (entry.target as XWidget);
|
38
|
-
if (widget.visible && widget.onResizedCallback) {
|
39
|
-
widget.onResizedCallback.call(null);
|
40
|
-
}
|
41
|
-
}
|
42
|
-
});
|
43
|
-
}
|
44
|
-
|
45
|
-
observer.observe(this);
|
46
|
-
|
47
|
-
this.setElementsToRestoreScrollPositionsFor([this]);
|
48
|
-
}
|
49
|
-
|
50
|
-
isShowing(): boolean {
|
51
|
-
return this.visible;
|
52
|
-
}
|
53
|
-
|
54
|
-
setElementsToRestoreScrollPositionsFor(elements: Element[]): void {
|
55
|
-
for (const element of this.elementsToRestoreScrollPositionsFor) {
|
56
|
-
element.removeEventListener('scroll', XWidget.storeScrollPosition, {capture: false});
|
57
|
-
}
|
58
|
-
this.elementsToRestoreScrollPositionsFor = elements;
|
59
|
-
for (const element of this.elementsToRestoreScrollPositionsFor) {
|
60
|
-
element.addEventListener('scroll', XWidget.storeScrollPosition, {passive: true, capture: false});
|
61
|
-
}
|
62
|
-
}
|
63
|
-
|
64
|
-
restoreScrollPositions(): void {
|
65
|
-
for (const element of this.elementsToRestoreScrollPositionsFor) {
|
66
|
-
const storedPositions = storedScrollPositions.get(element);
|
67
|
-
if (storedPositions) {
|
68
|
-
element.scrollTop = storedPositions.scrollTop;
|
69
|
-
element.scrollLeft = storedPositions.scrollLeft;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
|
74
|
-
private static storeScrollPosition(event: Event): void {
|
75
|
-
const element = (event.currentTarget as Element);
|
76
|
-
storedScrollPositions.set(element, {scrollLeft: element.scrollLeft, scrollTop: element.scrollTop});
|
77
|
-
}
|
78
|
-
|
79
|
-
setDefaultFocusedElement(element: Element|null): void {
|
80
|
-
if (element && !this.isSelfOrAncestor(element)) {
|
81
|
-
throw new Error('Default focus must be descendant');
|
82
|
-
}
|
83
|
-
this.defaultFocusedElement = element;
|
84
|
-
}
|
85
|
-
|
86
|
-
override focus(): void {
|
87
|
-
if (!this.visible) {
|
88
|
-
return;
|
89
|
-
}
|
90
|
-
|
91
|
-
let element;
|
92
|
-
if (this.defaultFocusedElement && this.isSelfOrAncestor(this.defaultFocusedElement)) {
|
93
|
-
element = this.defaultFocusedElement;
|
94
|
-
} else if (this.tabIndex !== -1) {
|
95
|
-
element = this;
|
96
|
-
} else {
|
97
|
-
let child = this.traverseNextNode(this);
|
98
|
-
while (child) {
|
99
|
-
if ((child instanceof XWidget) && child.visible) {
|
100
|
-
element = child;
|
101
|
-
break;
|
102
|
-
}
|
103
|
-
child = child.traverseNextNode(this);
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
if (!element || element.hasFocus()) {
|
108
|
-
return;
|
109
|
-
}
|
110
|
-
if (element === this) {
|
111
|
-
HTMLElement.prototype.focus.call(this);
|
112
|
-
} else {
|
113
|
-
(element as HTMLElement).focus();
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
connectedCallback(): void {
|
118
|
-
this.visible = true;
|
119
|
-
this.restoreScrollPositions();
|
120
|
-
if (this.onShownCallback) {
|
121
|
-
this.onShownCallback.call(null);
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
disconnectedCallback(): void {
|
126
|
-
this.visible = false;
|
127
|
-
if (this.onHiddenCallback) {
|
128
|
-
this.onHiddenCallback.call(null);
|
129
|
-
}
|
130
|
-
}
|
131
|
-
}
|
132
|
-
|
133
|
-
customElements.define('x-widget', XWidget);
|