chrome-devtools-frontend 1.0.1524741 → 1.0.1526203
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/policy/slow-close.md +22 -19
- package/front_end/core/common/Settings.ts +1 -1
- package/front_end/core/sdk/PreloadingModel.ts +3 -0
- package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
- package/front_end/{models/source_map_scopes → core/sdk}/ScopeTreeCache.ts +8 -7
- package/front_end/core/sdk/SourceMapScopesInfo.ts +57 -0
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +7 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +15 -12
- package/front_end/generated/InspectorBackendCommands.js +4 -4
- package/front_end/generated/SupportedCSSProperties.js +0 -19
- package/front_end/generated/protocol-mapping.d.ts +1 -1
- package/front_end/generated/protocol-proxy-api.d.ts +1 -1
- package/front_end/generated/protocol.ts +9 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +43 -8
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +50 -32
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +29 -29
- package/front_end/models/formatter/FormatterWorkerPool.ts +1 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +3 -8
- package/front_end/models/source_map_scopes/NamesResolver.ts +1 -3
- package/front_end/models/source_map_scopes/source_map_scopes.ts +0 -2
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +1 -1
- package/front_end/models/trace/insights/CLSCulprits.ts +2 -1
- package/front_end/models/trace/insights/Cache.ts +2 -1
- package/front_end/models/trace/insights/DOMSize.ts +2 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +2 -1
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +2 -1
- package/front_end/models/trace/insights/FontDisplay.ts +2 -1
- package/front_end/models/trace/insights/ForcedReflow.ts +2 -1
- package/front_end/models/trace/insights/INPBreakdown.ts +2 -1
- package/front_end/models/trace/insights/ImageDelivery.ts +2 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +2 -1
- package/front_end/models/trace/insights/LCPDiscovery.ts +2 -1
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +2 -1
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +2 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +2 -1
- package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -1
- package/front_end/models/trace/insights/ThirdParties.ts +2 -1
- package/front_end/models/trace/insights/Viewport.ts +2 -1
- package/front_end/models/trace/insights/types.ts +2 -1
- package/front_end/panels/application/ReportingApiView.ts +8 -7
- package/front_end/panels/application/StorageView.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingString.ts +2 -0
- package/front_end/panels/changes/ChangesSidebar.ts +10 -3
- package/front_end/panels/changes/ChangesView.ts +69 -69
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/panels/changes/changesView.css +4 -0
- package/front_end/panels/console/ConsolePrompt.ts +24 -4
- package/front_end/panels/lighthouse/LighthouseController.ts +5 -0
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +43 -46
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +254 -153
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +28 -21
- package/front_end/panels/timeline/TimelinePanel.ts +10 -8
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/Button.ts +17 -0
- package/front_end/ui/components/docs/linear_memory_inspector/basic.ts +21 -9
- package/front_end/ui/components/highlighting/HighlightManager.ts +21 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +22 -5
- package/front_end/ui/legacy/SearchableView.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +48 -5
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -2
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +28 -0
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +18 -20
- package/package.json +22 -22
|
@@ -63,6 +63,10 @@ interface ButtonState {
|
|
|
63
63
|
jslogContext?: string;
|
|
64
64
|
longClickable?: boolean;
|
|
65
65
|
inverseColorTheme?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Sets aria-label on the internal <button> element.
|
|
68
|
+
*/
|
|
69
|
+
accessibleLabel?: string;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
interface CommonButtonData {
|
|
@@ -84,6 +88,10 @@ interface CommonButtonData {
|
|
|
84
88
|
jslogContext?: string;
|
|
85
89
|
longClickable?: boolean;
|
|
86
90
|
inverseColorTheme?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Sets aria-label on the internal <button> element.
|
|
93
|
+
*/
|
|
94
|
+
accessibleLabel?: string;
|
|
87
95
|
}
|
|
88
96
|
|
|
89
97
|
export type ButtonData = CommonButtonData&(|{
|
|
@@ -143,6 +151,9 @@ export class Button extends HTMLElement {
|
|
|
143
151
|
if ('size' in data && data.size) {
|
|
144
152
|
this.#props.size = data.size;
|
|
145
153
|
}
|
|
154
|
+
if (data.accessibleLabel) {
|
|
155
|
+
this.#props.accessibleLabel = data.accessibleLabel;
|
|
156
|
+
}
|
|
146
157
|
|
|
147
158
|
this.#props.active = Boolean(data.active);
|
|
148
159
|
this.#props.spinner = Boolean('spinner' in data ? data.spinner : false);
|
|
@@ -187,6 +198,11 @@ export class Button extends HTMLElement {
|
|
|
187
198
|
this.#render();
|
|
188
199
|
}
|
|
189
200
|
|
|
201
|
+
set accessibleLabel(label: string) {
|
|
202
|
+
this.#props.accessibleLabel = label;
|
|
203
|
+
this.#render();
|
|
204
|
+
}
|
|
205
|
+
|
|
190
206
|
set reducedFocusRing(reducedFocusRing: boolean) {
|
|
191
207
|
this.#props.reducedFocusRing = reducedFocusRing;
|
|
192
208
|
this.#render();
|
|
@@ -357,6 +373,7 @@ export class Button extends HTMLElement {
|
|
|
357
373
|
.disabled=${this.#props.disabled}
|
|
358
374
|
class=${classMap(classes)}
|
|
359
375
|
aria-pressed=${ifDefined(this.#props.toggled)}
|
|
376
|
+
aria-label=${ifDefined(this.#props.accessibleLabel)}
|
|
360
377
|
jslog=${ifDefined(jslog)}>
|
|
361
378
|
${hasIcon ? html`
|
|
362
379
|
<devtools-icon name=${ifDefined(this.#props.toggled ? this.#props.toggledIconName : this.#props.iconName)}>
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import * as LinearMemoryInspectorComponents from '../../../../panels/linear_memory_inspector/components/components.js';
|
|
6
6
|
import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
7
|
+
import * as UI from '../../../legacy/legacy.js';
|
|
8
|
+
import * as Lit from '../../../lit/lit.js';
|
|
7
9
|
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
10
|
|
|
9
11
|
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
12
|
await FrontendHelpers.initializeGlobalVars();
|
|
11
13
|
|
|
14
|
+
const {render, html} = Lit;
|
|
15
|
+
const {widgetConfig} = UI.Widget;
|
|
16
|
+
|
|
12
17
|
const array = [];
|
|
13
18
|
const string = 'Hello this is a string from the memory buffer!';
|
|
14
19
|
|
|
@@ -21,12 +26,19 @@ for (let i = -1000; i < 1000; ++i) {
|
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
const memory = new Uint8Array(array);
|
|
24
|
-
|
|
25
|
-
document.getElementById('container')
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
|
|
30
|
+
const container = document.getElementById('container');
|
|
31
|
+
if (container) {
|
|
32
|
+
render(
|
|
33
|
+
html`
|
|
34
|
+
<devtools-widget .widgetConfig=${
|
|
35
|
+
widgetConfig(LinearMemoryInspectorComponents.LinearMemoryInspector.LinearMemoryInspector, {
|
|
36
|
+
memory,
|
|
37
|
+
address: 0,
|
|
38
|
+
memoryOffset: 0,
|
|
39
|
+
outerMemoryLength: memory.length,
|
|
40
|
+
})}>
|
|
41
|
+
</devtools-widget>
|
|
42
|
+
`,
|
|
43
|
+
container);
|
|
44
|
+
}
|
|
@@ -10,7 +10,15 @@ export class RangeWalker {
|
|
|
10
10
|
#eof: boolean;
|
|
11
11
|
|
|
12
12
|
constructor(readonly root: Node) {
|
|
13
|
-
|
|
13
|
+
const nodeFilter = {
|
|
14
|
+
acceptNode(node: Node): number {
|
|
15
|
+
if (['STYLE', 'SCRIPT'].includes(node.parentNode?.nodeName ?? '')) {
|
|
16
|
+
return NodeFilter.FILTER_REJECT;
|
|
17
|
+
}
|
|
18
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
this.#treeWalker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, nodeFilter);
|
|
14
22
|
this.#eof = !this.#treeWalker.firstChild();
|
|
15
23
|
}
|
|
16
24
|
|
|
@@ -57,6 +65,18 @@ export class RangeWalker {
|
|
|
57
65
|
range.setEnd(endNode, offsetInEndNode);
|
|
58
66
|
return range;
|
|
59
67
|
}
|
|
68
|
+
|
|
69
|
+
goToTextNode(node: Text): void {
|
|
70
|
+
while (this.#treeWalker.currentNode !== node) {
|
|
71
|
+
if (!this.#next()) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get offset(): number {
|
|
78
|
+
return this.#offset;
|
|
79
|
+
}
|
|
60
80
|
}
|
|
61
81
|
|
|
62
82
|
export const HIGHLIGHT_REGISTRY = 'highlighted-search-result';
|
|
@@ -479,12 +479,23 @@ export class Tooltip extends HTMLElement {
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
|
|
482
|
+
#globalKeyDown = (event: KeyboardEvent): void => {
|
|
483
|
+
if (!this.open || event.key !== 'Escape') {
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
this.#openedViaHotkey = false;
|
|
488
|
+
this.toggle();
|
|
489
|
+
event.consume(true);
|
|
490
|
+
};
|
|
491
|
+
|
|
482
492
|
#keyDown = (event: KeyboardEvent): void => {
|
|
483
|
-
//
|
|
484
|
-
//
|
|
485
|
-
//
|
|
486
|
-
|
|
487
|
-
|
|
493
|
+
// This supports the scenario where the user uses Alt+ArrowDown in hotkey
|
|
494
|
+
// mode to toggle the visibility.
|
|
495
|
+
// Note that the "Escape to close" scenario is handled in the global
|
|
496
|
+
// keydown function so we capture Escape presses even if the tooltip does
|
|
497
|
+
// not have focus.
|
|
498
|
+
const shouldToggleVisibility = (this.useHotkey && event.altKey && event.key === 'ArrowDown');
|
|
488
499
|
|
|
489
500
|
if (shouldToggleVisibility) {
|
|
490
501
|
this.#openedViaHotkey = !this.open;
|
|
@@ -494,6 +505,7 @@ export class Tooltip extends HTMLElement {
|
|
|
494
505
|
};
|
|
495
506
|
|
|
496
507
|
#registerEventListeners(): void {
|
|
508
|
+
document.body.addEventListener('keydown', this.#globalKeyDown);
|
|
497
509
|
if (this.#anchor) {
|
|
498
510
|
// We bind the keydown listener regardless of if use-hotkey is enabled
|
|
499
511
|
// as we always want to support ESC to close.
|
|
@@ -525,6 +537,11 @@ export class Tooltip extends HTMLElement {
|
|
|
525
537
|
if (this.#timeout) {
|
|
526
538
|
window.clearTimeout(this.#timeout);
|
|
527
539
|
}
|
|
540
|
+
|
|
541
|
+
// Should always exist when this component is used, but in test
|
|
542
|
+
// environments on Chromium this isn't always the case, hence the body? check.
|
|
543
|
+
document.body?.removeEventListener('keydown', this.#globalKeyDown);
|
|
544
|
+
|
|
528
545
|
if (this.#anchor) {
|
|
529
546
|
this.#anchor.removeEventListener('click', this.toggle);
|
|
530
547
|
this.#anchor.removeEventListener('mouseenter', this.showTooltip);
|
|
@@ -139,7 +139,7 @@ function createClearButton(jslogContext: string): Buttons.Button.Button {
|
|
|
139
139
|
return button;
|
|
140
140
|
}
|
|
141
141
|
export class SearchableView extends VBox {
|
|
142
|
-
|
|
142
|
+
protected searchProvider: Searchable;
|
|
143
143
|
private replaceProvider: Replaceable|null;
|
|
144
144
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
145
145
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5,10 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
import type * as Platform from '../../../../core/platform/platform.js';
|
|
7
7
|
import type * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
8
|
-
import * as UI from '
|
|
8
|
+
import * as UI from '../../legacy.js';
|
|
9
9
|
|
|
10
10
|
import dataGridStyles from './dataGrid.css.js';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Align,
|
|
13
|
+
type ColumnDescriptor,
|
|
14
|
+
DataType,
|
|
15
|
+
Events as DataGridEvents,
|
|
16
|
+
Order,
|
|
17
|
+
type ResizeMethod
|
|
18
|
+
} from './DataGrid.js';
|
|
12
19
|
import {SortableDataGrid, SortableDataGridNode} from './SortableDataGrid.js';
|
|
13
20
|
|
|
14
21
|
const DUMMY_COLUMN_ID = 'dummy'; // SortableDataGrid.create requires at least one column.
|
|
@@ -36,12 +43,14 @@ const DUMMY_COLUMN_ID = 'dummy'; // SortableDataGrid.create requires at least o
|
|
|
36
43
|
* Under the hood it uses SortableDataGrid, which extends ViewportDataGrid so only
|
|
37
44
|
* visible rows are layed out and sorting is provided out of the box.
|
|
38
45
|
*
|
|
39
|
-
* @property filters
|
|
40
|
-
* @attribute
|
|
46
|
+
* @property filters Set of text filters to be applied to the data grid.
|
|
47
|
+
* @attribute inline If true, the data grid will render inline instead of taking a full container height.
|
|
48
|
+
* @attribute resize Column resize method, one of 'nearest' (default), 'first' or 'last'.
|
|
49
|
+
* @attribute striped If true, the data grid will have striped rows.
|
|
41
50
|
* @attribute displayName
|
|
42
51
|
*/
|
|
43
52
|
class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
44
|
-
static readonly observedAttributes = ['striped', 'name', 'inline'];
|
|
53
|
+
static readonly observedAttributes = ['striped', 'name', 'inline', 'resize'];
|
|
45
54
|
|
|
46
55
|
#dataGrid = SortableDataGrid.create([DUMMY_COLUMN_ID], [], '') as SortableDataGrid<DataGridElementNode>;
|
|
47
56
|
#resizeObserver = new ResizeObserver(() => {
|
|
@@ -69,6 +78,9 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
69
78
|
e => (e.data as DataGridElementNode).configElement.dispatchEvent(new CustomEvent('select')));
|
|
70
79
|
this.#dataGrid.addEventListener(
|
|
71
80
|
DataGridEvents.DESELECTED_NODE, () => this.dispatchEvent(new CustomEvent('deselect')));
|
|
81
|
+
this.#dataGrid.addEventListener(
|
|
82
|
+
DataGridEvents.OPENED_NODE,
|
|
83
|
+
e => (e.data as DataGridElementNode).configElement.dispatchEvent(new CustomEvent('open')));
|
|
72
84
|
this.#dataGrid.addEventListener(DataGridEvents.SORTING_CHANGED, () => this.dispatchEvent(new CustomEvent('sort', {
|
|
73
85
|
detail: {columnId: this.#dataGrid.sortColumnId(), ascending: this.#dataGrid.isSortOrderAscending()}
|
|
74
86
|
})));
|
|
@@ -111,6 +123,9 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
111
123
|
case 'inline':
|
|
112
124
|
this.#dataGrid.renderInline();
|
|
113
125
|
break;
|
|
126
|
+
case 'resize':
|
|
127
|
+
this.#dataGrid.setResizeMethod(newValue as ResizeMethod);
|
|
128
|
+
break;
|
|
114
129
|
}
|
|
115
130
|
}
|
|
116
131
|
|
|
@@ -138,6 +153,14 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
138
153
|
return this.getAttribute('name');
|
|
139
154
|
}
|
|
140
155
|
|
|
156
|
+
set resizeMethod(resizeMethod: ResizeMethod) {
|
|
157
|
+
this.setAttribute('resize', resizeMethod);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
get resizeMethod(): ResizeMethod {
|
|
161
|
+
return this.getAttribute('resize') as ResizeMethod;
|
|
162
|
+
}
|
|
163
|
+
|
|
141
164
|
set filters(filters: TextUtils.TextUtils.ParsedFilter[]) {
|
|
142
165
|
this.#dataGrid.setFilters(filters);
|
|
143
166
|
this.#dataGrid.element.setAttribute('aria-rowcount', String(this.#dataGrid.getNumberOfRows()));
|
|
@@ -178,11 +201,15 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
178
201
|
if (editable) {
|
|
179
202
|
hasEditableColumn = true;
|
|
180
203
|
}
|
|
204
|
+
const sort = column.getAttribute('sort') === 'descending' ? Order.Descending :
|
|
205
|
+
column.getAttribute('sort') === 'ascending' ? Order.Ascending :
|
|
206
|
+
undefined;
|
|
181
207
|
const columnDescriptor = {
|
|
182
208
|
id,
|
|
183
209
|
title: title as Platform.UIString.LocalizedString,
|
|
184
210
|
titleDOMFragment,
|
|
185
211
|
sortable,
|
|
212
|
+
sort,
|
|
186
213
|
fixedWidth,
|
|
187
214
|
width,
|
|
188
215
|
align,
|
|
@@ -235,6 +262,18 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
235
262
|
.filter(node => node.querySelector('td') && !hasBooleanAttribute(node, 'placeholder'));
|
|
236
263
|
}
|
|
237
264
|
|
|
265
|
+
#getStyleElements(nodes: NodeList): HTMLElement[] {
|
|
266
|
+
return [...nodes].flatMap(node => {
|
|
267
|
+
if (node instanceof HTMLStyleElement) {
|
|
268
|
+
return [node];
|
|
269
|
+
}
|
|
270
|
+
if (node instanceof HTMLElement) {
|
|
271
|
+
return [...node.querySelectorAll<HTMLStyleElement>('style')];
|
|
272
|
+
}
|
|
273
|
+
return [] as HTMLElement[];
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
238
277
|
#findNextExistingNode(element: Element): DataGridElementNode|null {
|
|
239
278
|
for (let e = element.nextElementSibling; e; e = e.nextElementSibling) {
|
|
240
279
|
const nextNode = DataGridElementNode.get(e);
|
|
@@ -270,6 +309,9 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
270
309
|
node.setHighlighted(true);
|
|
271
310
|
}
|
|
272
311
|
}
|
|
312
|
+
for (const element of this.#getStyleElements(nodes)) {
|
|
313
|
+
this.#shadowRoot.appendChild(element.cloneNode(true));
|
|
314
|
+
}
|
|
273
315
|
}
|
|
274
316
|
|
|
275
317
|
override removeNodes(nodes: NodeList): void {
|
|
@@ -304,6 +346,7 @@ class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate {
|
|
|
304
346
|
dataGridNode.refresh();
|
|
305
347
|
}
|
|
306
348
|
}
|
|
349
|
+
this.#dataGrid.dispatchEventToListeners(DataGridEvents.SORTING_CHANGED);
|
|
307
350
|
}
|
|
308
351
|
|
|
309
352
|
#updateCreationNode(): void {
|
|
@@ -23,7 +23,7 @@ import {TimelineGrid} from './TimelineGrid.js';
|
|
|
23
23
|
/**
|
|
24
24
|
* Set as the `details` value on the fake context menu event we dispatch to
|
|
25
25
|
* trigger a context menu on an event on a keyboard space key press.
|
|
26
|
-
* {@
|
|
26
|
+
* {@link FlameChart.onContextMenu} for more details and explanation.
|
|
27
27
|
*/
|
|
28
28
|
const KEYBOARD_FAKED_CONTEXT_MENU_DETAIL = -1;
|
|
29
29
|
|
|
@@ -2347,7 +2347,7 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
2347
2347
|
}
|
|
2348
2348
|
|
|
2349
2349
|
/**
|
|
2350
|
-
* Draws decorations onto events. {@
|
|
2350
|
+
* Draws decorations onto events. {@link FlameChartDecoration}.
|
|
2351
2351
|
*/
|
|
2352
2352
|
#drawDecorations(context: CanvasRenderingContext2D, timelineData: FlameChartTimelineData, indexes: number[]): void {
|
|
2353
2353
|
const {entryTotalTimes, entryStartTimes, entryLevels} = timelineData;
|
|
@@ -20,6 +20,7 @@ const UIStrings = {
|
|
|
20
20
|
} as const;
|
|
21
21
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/source_frame/JSONView.ts', UIStrings);
|
|
22
22
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
23
|
+
|
|
23
24
|
export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Searchable {
|
|
24
25
|
private initialized: boolean;
|
|
25
26
|
private readonly parsedJSON: ParsedJSON;
|
|
@@ -67,6 +68,10 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
|
|
|
67
68
|
return searchableView;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
setSearchableView(searchableView: UI.SearchableView.SearchableView): void {
|
|
72
|
+
this.searchableView = searchableView;
|
|
73
|
+
}
|
|
74
|
+
|
|
70
75
|
private static parseJSON(text: string|null): Promise<ParsedJSON|null> {
|
|
71
76
|
let returnObj: ParsedJSON<string>|null = null;
|
|
72
77
|
if (text) {
|
|
@@ -280,3 +285,26 @@ export class ParsedJSON<T extends unknown = unknown> {
|
|
|
280
285
|
this.suffix = suffix;
|
|
281
286
|
}
|
|
282
287
|
}
|
|
288
|
+
|
|
289
|
+
export class SearchableJsonView extends UI.SearchableView.SearchableView {
|
|
290
|
+
#jsonView: JSONView;
|
|
291
|
+
|
|
292
|
+
constructor(element: HTMLElement) {
|
|
293
|
+
const jsonView = new JSONView(new ParsedJSON('', '', ''));
|
|
294
|
+
super(jsonView, null, undefined, element);
|
|
295
|
+
this.#jsonView = jsonView;
|
|
296
|
+
this.setPlaceholder(i18nString(UIStrings.find));
|
|
297
|
+
jsonView.setSearchableView(this);
|
|
298
|
+
jsonView.show(this.element);
|
|
299
|
+
jsonView.element.tabIndex = 0;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
set jsonObject(obj: Object) {
|
|
303
|
+
const jsonView = new JSONView(new ParsedJSON(obj, '', ''));
|
|
304
|
+
this.#jsonView.detach();
|
|
305
|
+
this.#jsonView = jsonView;
|
|
306
|
+
this.searchProvider = jsonView;
|
|
307
|
+
jsonView.show(this.element);
|
|
308
|
+
this.requestUpdate();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
@@ -16,20 +16,22 @@ const MEMORY_TRANSFER_MIN_CHUNK_SIZE = 1000;
|
|
|
16
16
|
* known upfront.
|
|
17
17
|
*/
|
|
18
18
|
class LinearMemoryInspectorView extends UI.Widget.VBox {
|
|
19
|
-
#memory = new Uint8Array([0]);
|
|
19
|
+
#memory: Uint8Array = new Uint8Array([0]);
|
|
20
20
|
#address = 0;
|
|
21
21
|
#inspector = new LinearMemoryInspectorComponents.LinearMemoryInspector.LinearMemoryInspector();
|
|
22
22
|
|
|
23
23
|
constructor() {
|
|
24
24
|
super();
|
|
25
|
-
this.#inspector.addEventListener(
|
|
25
|
+
this.#inspector.contentElement.addEventListener(
|
|
26
26
|
LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent.eventName,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
(event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent) =>
|
|
28
|
+
this.#memoryRequested(event));
|
|
29
|
+
this.#inspector.contentElement.addEventListener(
|
|
30
|
+
LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent.eventName,
|
|
31
|
+
(event: LinearMemoryInspectorComponents.LinearMemoryInspector.AddressChangedEvent) => {
|
|
30
32
|
this.#address = event.data;
|
|
31
33
|
});
|
|
32
|
-
this.
|
|
34
|
+
this.#inspector.show(this.contentElement);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
override wasShown(): void {
|
|
@@ -51,13 +53,11 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
|
|
|
51
53
|
const memoryChunkStart = Math.max(0, this.#address - MEMORY_TRANSFER_MIN_CHUNK_SIZE / 2);
|
|
52
54
|
const memoryChunkEnd = memoryChunkStart + MEMORY_TRANSFER_MIN_CHUNK_SIZE;
|
|
53
55
|
const memory = this.#memory.slice(memoryChunkStart, memoryChunkEnd);
|
|
54
|
-
this.#inspector.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
hideValueInspector: true,
|
|
60
|
-
};
|
|
56
|
+
this.#inspector.memory = memory;
|
|
57
|
+
this.#inspector.address = this.#address;
|
|
58
|
+
this.#inspector.memoryOffset = memoryChunkStart;
|
|
59
|
+
this.#inspector.outerMemoryLength = this.#memory.length;
|
|
60
|
+
this.#inspector.hideValueInspector = true;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
#memoryRequested(event: LinearMemoryInspectorComponents.LinearMemoryInspector.MemoryRequestEvent): void {
|
|
@@ -80,13 +80,11 @@ class LinearMemoryInspectorView extends UI.Widget.VBox {
|
|
|
80
80
|
const chunkEnd = Math.max(end, start + MEMORY_TRANSFER_MIN_CHUNK_SIZE);
|
|
81
81
|
const memory = this.#memory.slice(start, chunkEnd);
|
|
82
82
|
|
|
83
|
-
this.#inspector.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
hideValueInspector: true,
|
|
89
|
-
};
|
|
83
|
+
this.#inspector.memory = memory;
|
|
84
|
+
this.#inspector.address = address;
|
|
85
|
+
this.#inspector.memoryOffset = start;
|
|
86
|
+
this.#inspector.outerMemoryLength = this.#memory.length;
|
|
87
|
+
this.#inspector.hideValueInspector = true;
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
|
package/package.json
CHANGED
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
38
38
|
"@rollup/plugin-terser": "0.4.4",
|
|
39
|
-
"@rollup/wasm-node": "4.
|
|
40
|
-
"@stylistic/eslint-plugin": "5.
|
|
39
|
+
"@rollup/wasm-node": "4.52.1",
|
|
40
|
+
"@stylistic/eslint-plugin": "5.4.0",
|
|
41
41
|
"@types/chai": "4.3.15",
|
|
42
|
-
"@types/codemirror": "5.60.
|
|
42
|
+
"@types/codemirror": "5.60.16",
|
|
43
43
|
"@types/emscripten": "1.39.4",
|
|
44
44
|
"@types/estree": "1.0.8",
|
|
45
45
|
"@types/filesystem": "0.0.36",
|
|
@@ -51,20 +51,20 @@
|
|
|
51
51
|
"@types/webidl2": "24.4.3",
|
|
52
52
|
"@types/yargs": "17.0.33",
|
|
53
53
|
"@types/yargs-unparser": "2.0.3",
|
|
54
|
-
"@typescript-eslint/rule-tester": "8.
|
|
55
|
-
"@typescript-eslint/utils": "8.
|
|
54
|
+
"@typescript-eslint/rule-tester": "8.45.0",
|
|
55
|
+
"@typescript-eslint/utils": "8.45.0",
|
|
56
56
|
"@web/rollup-plugin-import-meta-assets": "2.3.0",
|
|
57
57
|
"chai": "4.3.4",
|
|
58
|
-
"cssnano": "7.1.
|
|
58
|
+
"cssnano": "7.1.1",
|
|
59
59
|
"cssnano-preset-lite": "4.0.4",
|
|
60
60
|
"esbuild": "0.25.1",
|
|
61
|
-
"eslint": "9.
|
|
61
|
+
"eslint": "9.36.0",
|
|
62
62
|
"eslint-plugin-eslint-plugin": "7.0.0",
|
|
63
63
|
"eslint-plugin-import": "2.32.0",
|
|
64
|
-
"eslint-plugin-jsdoc": "
|
|
64
|
+
"eslint-plugin-jsdoc": "60.5.0",
|
|
65
65
|
"eslint-plugin-mocha": "10.5.0",
|
|
66
66
|
"glob": "7.1.7",
|
|
67
|
-
"globals": "16.
|
|
67
|
+
"globals": "16.4.0",
|
|
68
68
|
"js-yaml": "4.1.0",
|
|
69
69
|
"karma": "6.4.4",
|
|
70
70
|
"karma-chai": "0.1.0",
|
|
@@ -77,30 +77,30 @@
|
|
|
77
77
|
"karma-spec-reporter": "0.0.36",
|
|
78
78
|
"license-checker": "25.0.1",
|
|
79
79
|
"lit-analyzer": "2.0.3",
|
|
80
|
-
"mocha": "11.7.
|
|
81
|
-
"ora": "
|
|
80
|
+
"mocha": "11.7.2",
|
|
81
|
+
"ora": "9.0.0",
|
|
82
82
|
"postcss": "8.5.6",
|
|
83
|
-
"puppeteer-core": "24.
|
|
84
|
-
"rollup-plugin-sourcemaps2": "0.5.
|
|
83
|
+
"puppeteer-core": "24.22.3",
|
|
84
|
+
"rollup-plugin-sourcemaps2": "0.5.4",
|
|
85
85
|
"sinon": "21.0.0",
|
|
86
86
|
"source-map-support": "0.5.21",
|
|
87
|
-
"stylelint": "16.
|
|
87
|
+
"stylelint": "16.24.0",
|
|
88
88
|
"stylelint-config-standard": "39.0.0",
|
|
89
89
|
"svgo": "3.3.2",
|
|
90
|
-
"terser": "5.
|
|
90
|
+
"terser": "5.44.0",
|
|
91
91
|
"ts-lit-plugin": "2.0.2",
|
|
92
92
|
"typescript": "5.9.2",
|
|
93
|
-
"typescript-eslint": "8.
|
|
94
|
-
"uuid": "
|
|
93
|
+
"typescript-eslint": "8.45.0",
|
|
94
|
+
"uuid": "13.0.0",
|
|
95
95
|
"webidl2": "24.5.0",
|
|
96
96
|
"yargs": "17.7.2"
|
|
97
97
|
},
|
|
98
98
|
"overrides": {
|
|
99
|
-
"@typescript-eslint/types": "8.
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
"
|
|
99
|
+
"@typescript-eslint/types": "8.45.0",
|
|
100
|
+
"@es-joy/jsdoccomment": "0.64.0",
|
|
101
|
+
"stylelint": {
|
|
102
|
+
"flat-cache": "6.1.12"
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
-
"version": "1.0.
|
|
105
|
+
"version": "1.0.1526203"
|
|
106
106
|
}
|