chrome-devtools-frontend 1.0.1652307 → 1.0.1654411
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/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
- package/docs/get_the_code.md +1 -2
- package/docs/ui_engineering.md +3 -1
- package/eslint.config.mjs +0 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +13 -8
- package/front_end/core/sdk/CSSMetadata.ts +23 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/EmulationModel.ts +4 -0
- package/front_end/core/sdk/ResourceTreeModel.ts +3 -2
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
- package/front_end/entrypoints/main/MainImpl.ts +0 -6
- package/front_end/foundation/Universe.ts +18 -0
- package/front_end/generated/InspectorBackendCommands.ts +6 -5
- package/front_end/generated/SupportedCSSProperties.js +122 -28
- package/front_end/generated/protocol.ts +58 -0
- package/front_end/models/ai_assistance/AiConversation.ts +2 -1
- package/front_end/models/ai_assistance/README.md +4 -3
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +11 -164
- package/front_end/models/ai_assistance/ai_assistance.ts +6 -2
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
- package/front_end/models/ai_assistance/tools/README.md +21 -1
- package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
- package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +7 -15
- package/front_end/models/bindings/NetworkProject.ts +4 -8
- package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
- package/front_end/models/emulation/DeviceModeModel.ts +24 -0
- package/front_end/models/emulation/EmulatedDevices.ts +108 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
- package/front_end/models/issues_manager/IssuesManager.ts +10 -6
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
- package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
- package/front_end/models/logs/LogManager.ts +25 -10
- package/front_end/models/logs/NetworkLog.ts +24 -19
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +14 -5
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +5 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
- package/front_end/models/persistence/PersistenceImpl.ts +4 -5
- package/front_end/models/trace/EntityMapper.ts +1 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +9 -9
- package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/IndexedDBViews.ts +38 -36
- package/front_end/panels/application/components/AdsView.ts +4 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/autofill/autofill-meta.ts +3 -2
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
- package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
- package/front_end/panels/elements/ElementsTreeOutline.ts +5 -0
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +64 -17
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
- package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
- package/front_end/panels/network/NetworkLogView.ts +28 -0
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
- package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
- package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
- package/front_end/panels/timeline/TimelinePanel.ts +32 -8
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +7 -6
- package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
- package/front_end/panels/timeline/components/MetricCard.ts +18 -18
- package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
- package/front_end/panels/timeline/components/metricCard.css +4 -4
- package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
- package/front_end/panels/whats_new/resources/WNDT.md +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
- package/front_end/ui/legacy/ListWidget.ts +12 -0
- package/front_end/ui/legacy/SplitWidget.ts +12 -11
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +23 -19
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
- package/front_end/ui/legacy/treeoutline.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +4 -3
|
@@ -123,9 +123,9 @@ const UIStrings = {
|
|
|
123
123
|
*/
|
|
124
124
|
recDynamicContentCLS: 'Dynamic content can influence what layout shifts happen.',
|
|
125
125
|
/**
|
|
126
|
-
* @description Column header for table cell values representing the
|
|
126
|
+
* @description Column header for table cell values representing the subpart/component/stage/section of a larger duration.
|
|
127
127
|
*/
|
|
128
|
-
|
|
128
|
+
subpart: 'Subpart',
|
|
129
129
|
/**
|
|
130
130
|
* @description Tooltip text for a link that goes to documentation explaining the Largest Contentful Paint (LCP) metric. "LCP" is an acronym and should not be translated.
|
|
131
131
|
*/
|
|
@@ -145,7 +145,7 @@ const UIStrings = {
|
|
|
145
145
|
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/MetricCard.ts', UIStrings);
|
|
146
146
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
147
147
|
|
|
148
|
-
export type
|
|
148
|
+
export type SubpartTable = Array<[string, Trace.Types.Timing.Milli, Trace.Types.Timing.Milli?]>;
|
|
149
149
|
|
|
150
150
|
export interface MetricCardData {
|
|
151
151
|
metric: 'LCP'|'CLS'|'INP';
|
|
@@ -153,7 +153,7 @@ export interface MetricCardData {
|
|
|
153
153
|
fieldValue?: number|string;
|
|
154
154
|
histogram?: CrUXManager.MetricResponse['histogram'];
|
|
155
155
|
tooltipContainer?: HTMLElement;
|
|
156
|
-
|
|
156
|
+
subparts?: SubpartTable;
|
|
157
157
|
warnings?: string[];
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -566,30 +566,30 @@ export class MetricCard extends HTMLElement {
|
|
|
566
566
|
// clang-format on
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
#
|
|
570
|
-
const hasFieldData =
|
|
569
|
+
#renderSubpartTable(subparts: SubpartTable): Lit.LitTemplate {
|
|
570
|
+
const hasFieldData = subparts.every(subpart => subpart[2] !== undefined);
|
|
571
571
|
|
|
572
572
|
// clang-format off
|
|
573
573
|
return html`
|
|
574
574
|
<hr class="divider">
|
|
575
|
-
<div class="
|
|
576
|
-
<div class="
|
|
577
|
-
<div role="columnheader" style="grid-column: 1">${i18nString(UIStrings.
|
|
578
|
-
<div role="columnheader" class="
|
|
575
|
+
<div class="subpart-table" role="table">
|
|
576
|
+
<div class="subpart-table-row subpart-table-header-row" role="row">
|
|
577
|
+
<div role="columnheader" style="grid-column: 1">${i18nString(UIStrings.subpart)}</div>
|
|
578
|
+
<div role="columnheader" class="subpart-table-value" style="grid-column: 2">${i18nString(UIStrings.localValue)}</div>
|
|
579
579
|
${hasFieldData ? html`
|
|
580
580
|
<div
|
|
581
581
|
role="columnheader"
|
|
582
|
-
class="
|
|
582
|
+
class="subpart-table-value"
|
|
583
583
|
style="grid-column: 3"
|
|
584
584
|
title=${i18nString(UIStrings.field75thPercentile)}>${i18nString(UIStrings.fieldP75)}</div>
|
|
585
585
|
` : nothing}
|
|
586
586
|
</div>
|
|
587
|
-
${
|
|
588
|
-
<div class="
|
|
589
|
-
<div role="cell">${
|
|
590
|
-
<div role="cell" class="
|
|
591
|
-
${
|
|
592
|
-
<div role="cell" class="
|
|
587
|
+
${subparts.map(subpart => html`
|
|
588
|
+
<div class="subpart-table-row" role="row">
|
|
589
|
+
<div role="cell">${subpart[0]}</div>
|
|
590
|
+
<div role="cell" class="subpart-table-value">${i18n.TimeUtilities.preciseMillisToString(subpart[1])}</div>
|
|
591
|
+
${subpart[2] !== undefined ? html`
|
|
592
|
+
<div role="cell" class="subpart-table-value">${i18n.TimeUtilities.preciseMillisToString(subpart[2])}</div>
|
|
593
593
|
` : nothing}
|
|
594
594
|
</div>
|
|
595
595
|
`)}
|
|
@@ -659,7 +659,7 @@ export class MetricCard extends HTMLElement {
|
|
|
659
659
|
${this.#renderDetailedCompareString()}
|
|
660
660
|
<hr class="divider">
|
|
661
661
|
${this.#renderFieldHistogram()}
|
|
662
|
-
${localValue && this.#data.
|
|
662
|
+
${localValue && this.#data.subparts ? this.#renderSubpartTable(this.#data.subparts) : nothing}
|
|
663
663
|
</div>
|
|
664
664
|
</div>
|
|
665
665
|
</div>
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.interaction {
|
|
178
|
-
--
|
|
178
|
+
--subpart-table-margin: 120px;
|
|
179
179
|
--details-indicator-width: 18px;
|
|
180
180
|
|
|
181
181
|
summary {
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
|
|
201
201
|
.interaction-type {
|
|
202
202
|
font-weight: var(--ref-typeface-weight-medium);
|
|
203
|
-
width: calc(var(--
|
|
203
|
+
width: calc(var(--subpart-table-margin) - var(--details-indicator-width));
|
|
204
204
|
flex-shrink: 0;
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -344,18 +344,18 @@ devtools-link {
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
-
.
|
|
347
|
+
.subpart-table {
|
|
348
348
|
border-top: 1px solid var(--sys-color-divider);
|
|
349
349
|
padding: 7px 4px;
|
|
350
|
-
margin-left: var(--
|
|
350
|
+
margin-left: var(--subpart-table-margin);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
.
|
|
353
|
+
.subpart-table-row {
|
|
354
354
|
display: flex;
|
|
355
355
|
justify-content: space-between;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
.
|
|
358
|
+
.subpart-table-header-row {
|
|
359
359
|
font-weight: var(--ref-typeface-weight-medium);
|
|
360
360
|
margin-bottom: 4px;
|
|
361
361
|
}
|
|
@@ -196,20 +196,20 @@ details.environment-recs[open] > summary::before {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.
|
|
199
|
+
.subpart-table {
|
|
200
200
|
display: grid;
|
|
201
201
|
column-gap: var(--sys-size-3);
|
|
202
202
|
white-space: nowrap;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
.
|
|
205
|
+
.subpart-table-row {
|
|
206
206
|
display: contents;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
.
|
|
209
|
+
.subpart-table-value {
|
|
210
210
|
text-align: right;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
.
|
|
213
|
+
.subpart-table-header-row {
|
|
214
214
|
font-weight: var(--ref-typeface-weight-medium);
|
|
215
215
|
}
|
|
@@ -45,15 +45,15 @@ let releaseNote: ReleaseNote = {
|
|
|
45
45
|
markdownLinks: [
|
|
46
46
|
{
|
|
47
47
|
key: 'devtools-for-agents',
|
|
48
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
48
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-150/#devtools-for-agents',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
key: 'ai-assistance',
|
|
52
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
52
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-150/#ai-assistance',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
key: 'css-container-function',
|
|
56
|
-
link: 'https://developer.chrome.com/blog/new-in-devtools-
|
|
56
|
+
link: 'https://developer.chrome.com/blog/new-in-devtools-150/#css-container-function',
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
videoLinks: [
|
|
@@ -9,7 +9,7 @@ The agent walkthrough in the updated AI assistance panel now renders rich widget
|
|
|
9
9
|
for performance network tracks, timeline event summaries, network requests,
|
|
10
10
|
syntax-highlighted source code, and inspected file lists.
|
|
11
11
|
|
|
12
|
-
### [
|
|
12
|
+
### [@container and @function](css-container-function)
|
|
13
13
|
|
|
14
14
|
You can now directly edit `@container` and `@function`
|
|
15
15
|
rules within the Styles tab, allowing for seamless experimentation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: Internal
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 059c884787b1bc15faa5afe5250f7d3a7e0ef64a
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -244,6 +244,7 @@ export class InspectorDrawerView {
|
|
|
244
244
|
const wasDrawerVisible = this.isVisibleForEvents();
|
|
245
245
|
this.tabbedPane.setAutoSelectFirstItemOnShow(!hasTargetDrawer);
|
|
246
246
|
this.#splitWidget.showBoth();
|
|
247
|
+
this.#updatePresentation(this.isMinimized());
|
|
247
248
|
this.#dispatchPaneVisibilityChangedIfNeeded(wasDrawerVisible);
|
|
248
249
|
}
|
|
249
250
|
|
|
@@ -251,8 +252,8 @@ export class InspectorDrawerView {
|
|
|
251
252
|
const wasDrawerVisible = this.isVisibleForEvents();
|
|
252
253
|
const wasMinimized = this.isMinimized();
|
|
253
254
|
this.#splitWidget.hideSidebar(!wasMinimized);
|
|
255
|
+
this.#updatePresentation(false);
|
|
254
256
|
if (wasMinimized) {
|
|
255
|
-
this.#updatePresentation(false);
|
|
256
257
|
this.#splitWidget.setSidebarMinimized(false);
|
|
257
258
|
this.#splitWidget.setResizable(true);
|
|
258
259
|
}
|
|
@@ -341,11 +342,12 @@ export class InspectorDrawerView {
|
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
#updatePresentation(minimized: boolean): void {
|
|
345
|
+
const requireVerticalMinimumWidth =
|
|
346
|
+
this.#splitWidget.isVertical() && this.#splitWidget.sidebarIsShowing() && !minimized;
|
|
347
|
+
this.#setInspectorMinimumSize(requireVerticalMinimumWidth ? this.#minimumSizes.inspectorWidthWhenVertical :
|
|
348
|
+
this.#minimumSizes.inspectorWidthWhenHorizontal,
|
|
349
|
+
this.#minimumSizes.inspectorHeight);
|
|
344
350
|
const drawerIsVertical = this.#splitWidget.isVertical();
|
|
345
|
-
this.#setInspectorMinimumSize(
|
|
346
|
-
drawerIsVertical ? this.#minimumSizes.inspectorWidthWhenVertical :
|
|
347
|
-
this.#minimumSizes.inspectorWidthWhenHorizontal,
|
|
348
|
-
this.#minimumSizes.inspectorHeight);
|
|
349
351
|
this.updatePresentation({
|
|
350
352
|
isVertical: drawerIsVertical,
|
|
351
353
|
isMinimized: minimized,
|
|
@@ -64,6 +64,7 @@ export class ListWidget<T> extends VBox {
|
|
|
64
64
|
private editElement: HTMLElement|null;
|
|
65
65
|
private emptyPlaceholder: Element|null;
|
|
66
66
|
private isTable: boolean;
|
|
67
|
+
private headerElement: Element|null = null;
|
|
67
68
|
constructor(delegate: Delegate<T>, delegatesFocus = true, isTable = false) {
|
|
68
69
|
super({useShadowDom: true, delegatesFocus});
|
|
69
70
|
this.registerRequiredCSS(listWidgetStyles);
|
|
@@ -100,10 +101,21 @@ export class ListWidget<T> extends VBox {
|
|
|
100
101
|
this.elements = [];
|
|
101
102
|
this.lastSeparator = false;
|
|
102
103
|
this.list.removeChildren();
|
|
104
|
+
if (this.headerElement) {
|
|
105
|
+
this.list.appendChild(this.headerElement);
|
|
106
|
+
}
|
|
103
107
|
this.updatePlaceholder();
|
|
104
108
|
this.stopEditing();
|
|
105
109
|
}
|
|
106
110
|
|
|
111
|
+
setHeader(header: Element): void {
|
|
112
|
+
if (this.headerElement) {
|
|
113
|
+
this.headerElement.remove();
|
|
114
|
+
}
|
|
115
|
+
this.headerElement = header;
|
|
116
|
+
this.list.insertBefore(header, this.list.firstChild);
|
|
117
|
+
}
|
|
118
|
+
|
|
107
119
|
updateItem(index: number, newItem: T, editable: boolean, focusable = true, controlLabels: {
|
|
108
120
|
edit?: string,
|
|
109
121
|
delete?: string,
|
|
@@ -54,6 +54,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
54
54
|
#showMode: ShowMode = ShowMode.BOTH;
|
|
55
55
|
#savedShowMode: ShowMode;
|
|
56
56
|
#autoAdjustOrientation = false;
|
|
57
|
+
readonly #zoomManager = ZoomManager.instance();
|
|
57
58
|
|
|
58
59
|
constructor(
|
|
59
60
|
isVertical: boolean,
|
|
@@ -401,7 +402,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
401
402
|
}
|
|
402
403
|
|
|
403
404
|
setSidebarSize(size: number): void {
|
|
404
|
-
const sizeDIP =
|
|
405
|
+
const sizeDIP = this.#zoomManager.cssToDIP(size);
|
|
405
406
|
this.#savedSidebarSizeDIP = sizeDIP;
|
|
406
407
|
this.#saveSetting();
|
|
407
408
|
this.#setSidebarSizeDIP(sizeDIP, false, true);
|
|
@@ -409,12 +410,12 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
409
410
|
|
|
410
411
|
sidebarSize(): number {
|
|
411
412
|
const sizeDIP = Math.max(0, this.#sidebarSizeDIP);
|
|
412
|
-
return
|
|
413
|
+
return this.#zoomManager.dipToCSS(sizeDIP);
|
|
413
414
|
}
|
|
414
415
|
|
|
415
416
|
totalSize(): number {
|
|
416
417
|
const sizeDIP = Math.max(0, this.#totalSizeDIP());
|
|
417
|
-
return
|
|
418
|
+
return this.#zoomManager.dipToCSS(sizeDIP);
|
|
418
419
|
}
|
|
419
420
|
|
|
420
421
|
/**
|
|
@@ -426,7 +427,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
426
427
|
this.#totalSizeCSS = this.#isVertical ? width : height;
|
|
427
428
|
this.#totalSizeOtherDimensionCSS = this.#isVertical ? height : width;
|
|
428
429
|
}
|
|
429
|
-
return
|
|
430
|
+
return this.#zoomManager.cssToDIP(this.#totalSizeCSS);
|
|
430
431
|
}
|
|
431
432
|
|
|
432
433
|
#updateShowMode(showMode: ShowMode): void {
|
|
@@ -457,7 +458,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
457
458
|
this.#removeAllLayoutProperties();
|
|
458
459
|
|
|
459
460
|
// this.#totalSizeDIP is available below since we successfully applied constraints.
|
|
460
|
-
const sizeCSS =
|
|
461
|
+
const sizeCSS = this.#zoomManager.dipToCSS(sizeDIP);
|
|
461
462
|
const sidebarSizeValue = sizeCSS + 'px';
|
|
462
463
|
const mainSizeValue = (this.#totalSizeCSS - sizeCSS) + 'px';
|
|
463
464
|
// With `box-sizing: border-box` on the sidebar (set in splitWidget.css),
|
|
@@ -519,8 +520,8 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
519
520
|
animatedMarginPropertyName = this.#secondIsSidebar ? 'margin-bottom' : 'margin-top';
|
|
520
521
|
}
|
|
521
522
|
|
|
522
|
-
const marginFrom = reverse ? '0' : '-' +
|
|
523
|
-
const marginTo = reverse ? '-' +
|
|
523
|
+
const marginFrom = reverse ? '0' : '-' + this.#zoomManager.dipToCSS(this.#sidebarSizeDIP) + 'px';
|
|
524
|
+
const marginTo = reverse ? '-' + this.#zoomManager.dipToCSS(this.#sidebarSizeDIP) + 'px' : '0';
|
|
524
525
|
|
|
525
526
|
// This order of things is important.
|
|
526
527
|
// 1. Resize main element early and force layout.
|
|
@@ -587,7 +588,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
587
588
|
|
|
588
589
|
#applyConstraints(sidebarSize: number, userAction?: boolean): number {
|
|
589
590
|
const totalSize = this.#totalSizeDIP();
|
|
590
|
-
const zoomFactor = this.#constraintsInDip ? 1 :
|
|
591
|
+
const zoomFactor = this.#constraintsInDip ? 1 : this.#zoomManager.zoomFactor();
|
|
591
592
|
|
|
592
593
|
let constraints: Geometry.Constraints =
|
|
593
594
|
this.#sidebarWidget ? this.#sidebarWidget.constraints() : new Geometry.Constraints();
|
|
@@ -653,12 +654,12 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
653
654
|
override wasShown(): void {
|
|
654
655
|
super.wasShown();
|
|
655
656
|
this.#forceUpdateLayout();
|
|
656
|
-
|
|
657
|
+
this.#zoomManager.addEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);
|
|
657
658
|
}
|
|
658
659
|
|
|
659
660
|
override willHide(): void {
|
|
660
661
|
super.willHide();
|
|
661
|
-
|
|
662
|
+
this.#zoomManager.removeEventListener(ZoomManagerEvents.ZOOM_CHANGED, this.onZoomChanged, this);
|
|
662
663
|
}
|
|
663
664
|
|
|
664
665
|
override onResize(): void {
|
|
@@ -711,7 +712,7 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
711
712
|
|
|
712
713
|
#onResizeUpdate(event: Common.EventTarget.EventTargetEvent<ResizeUpdatePositionEvent>): void {
|
|
713
714
|
const offset = event.data.currentPosition - event.data.startPosition;
|
|
714
|
-
const offsetDIP =
|
|
715
|
+
const offsetDIP = this.#zoomManager.cssToDIP(offset);
|
|
715
716
|
const newSizeDIP =
|
|
716
717
|
this.#secondIsSidebar ? this.#resizeStartSizeDIP - offsetDIP : this.#resizeStartSizeDIP + offsetDIP;
|
|
717
718
|
const constrainedSizeDIP = this.#applyConstraints(newSizeDIP, true);
|
|
@@ -291,7 +291,7 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
291
291
|
|
|
292
292
|
#findNextExistingNode(element: Element): DataGridElementNode|null {
|
|
293
293
|
for (let e = element.nextElementSibling; e; e = e.nextElementSibling) {
|
|
294
|
-
const nextNode =
|
|
294
|
+
const nextNode = getNode(e);
|
|
295
295
|
if (nextNode) {
|
|
296
296
|
return nextNode;
|
|
297
297
|
}
|
|
@@ -302,7 +302,7 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
302
302
|
override addNodes(nodes: NodeList): void {
|
|
303
303
|
for (const element of this.#getDataRows(nodes)) {
|
|
304
304
|
const parentRow = element.parentElement?.closest('td')?.closest('tr');
|
|
305
|
-
const parentDataGridNode = parentRow ?
|
|
305
|
+
const parentDataGridNode = parentRow ? getNode(parentRow) : undefined;
|
|
306
306
|
const parentNode = parentDataGridNode || this.#dataGrid.rootNode();
|
|
307
307
|
const nextNode = this.#findNextExistingNode(element);
|
|
308
308
|
const index = nextNode ? parentNode.children.indexOf(nextNode) : parentNode.children.length;
|
|
@@ -333,9 +333,9 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
333
333
|
|
|
334
334
|
override removeNodes(nodes: NodeList): void {
|
|
335
335
|
for (const element of this.#getDataRows(nodes)) {
|
|
336
|
-
const node =
|
|
336
|
+
const node = getNode(element);
|
|
337
337
|
if (node) {
|
|
338
|
-
|
|
338
|
+
removeNode(node);
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
}
|
|
@@ -345,7 +345,7 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
345
345
|
node = node.parentNode;
|
|
346
346
|
}
|
|
347
347
|
const dataRow = node instanceof HTMLElement ? node.closest('tr') : null;
|
|
348
|
-
const dataGridNode = dataRow ?
|
|
348
|
+
const dataGridNode = dataRow ? getNode(dataRow) : null;
|
|
349
349
|
if (dataGridNode && dataRow) {
|
|
350
350
|
if (attributeName === 'selected') {
|
|
351
351
|
if (hasBooleanAttribute(dataRow, 'selected')) {
|
|
@@ -372,7 +372,7 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
372
372
|
|
|
373
373
|
#updateCreationNode(): void {
|
|
374
374
|
if (this.#usedCreationNode) {
|
|
375
|
-
|
|
375
|
+
removeNode(this.#usedCreationNode);
|
|
376
376
|
this.#usedCreationNode = null;
|
|
377
377
|
this.#dataGrid.creationNode = undefined;
|
|
378
378
|
}
|
|
@@ -380,7 +380,7 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
380
380
|
if (!placeholder) {
|
|
381
381
|
this.#dataGrid.creationNode?.remove();
|
|
382
382
|
this.#dataGrid.creationNode = undefined;
|
|
383
|
-
} else if (!
|
|
383
|
+
} else if (!getNode(placeholder)) {
|
|
384
384
|
this.#dataGrid.creationNode?.remove();
|
|
385
385
|
const node = new DataGridElementNode(placeholder, this);
|
|
386
386
|
this.#dataGrid.creationNode = node;
|
|
@@ -447,24 +447,21 @@ export class DataGridElement extends UI.UIUtils.HTMLElementWithLightDOMTemplate
|
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
const elementToNode = new WeakMap<Element, DataGridElementNode>();
|
|
451
|
+
|
|
450
452
|
class DataGridElementNode extends SortableDataGridNode<DataGridElementNode> {
|
|
451
|
-
static #elementToNode = new WeakMap<Element, DataGridElementNode>();
|
|
452
453
|
#configElement: Element;
|
|
453
454
|
#dataGridElement: DataGridElement;
|
|
454
455
|
#addedClasses = new Set<string>();
|
|
455
456
|
constructor(configElement: Element, dataGridElement: DataGridElement) {
|
|
456
457
|
super();
|
|
457
458
|
this.#configElement = configElement;
|
|
458
|
-
|
|
459
|
+
elementToNode.set(configElement, this);
|
|
459
460
|
this.#dataGridElement = dataGridElement;
|
|
460
461
|
this.#updateData();
|
|
461
462
|
this.isCreationNode = hasBooleanAttribute(this.#configElement, 'placeholder');
|
|
462
463
|
}
|
|
463
464
|
|
|
464
|
-
static get(configElement: Element|undefined): DataGridElementNode|undefined {
|
|
465
|
-
return configElement && DataGridElementNode.#elementToNode.get(configElement);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
465
|
get configElement(): Element {
|
|
469
466
|
return this.#configElement;
|
|
470
467
|
}
|
|
@@ -576,11 +573,6 @@ class DataGridElementNode extends SortableDataGridNode<DataGridElementNode> {
|
|
|
576
573
|
return cell;
|
|
577
574
|
}
|
|
578
575
|
|
|
579
|
-
static remove(node: DataGridElementNode): void {
|
|
580
|
-
DataGridElementNode.#elementToNode.delete(node.#configElement);
|
|
581
|
-
node.remove();
|
|
582
|
-
}
|
|
583
|
-
|
|
584
576
|
override deselect(): void {
|
|
585
577
|
super.deselect();
|
|
586
578
|
if (this.isCreationNode) {
|
|
@@ -633,7 +625,7 @@ class IfExpandedDirective extends Lit.Directive.Directive {
|
|
|
633
625
|
if (!(element instanceof HTMLElement)) {
|
|
634
626
|
return false;
|
|
635
627
|
}
|
|
636
|
-
const node =
|
|
628
|
+
const node = getNode(element.closest('tr') ?? undefined);
|
|
637
629
|
if (!node) {
|
|
638
630
|
return false;
|
|
639
631
|
}
|
|
@@ -641,3 +633,15 @@ class IfExpandedDirective extends Lit.Directive.Directive {
|
|
|
641
633
|
}
|
|
642
634
|
}
|
|
643
635
|
export const ifExpanded = Lit.Directive.directive(IfExpandedDirective);
|
|
636
|
+
|
|
637
|
+
function getNode(element: Element|undefined): DataGridElementNode|undefined {
|
|
638
|
+
return element ? elementToNode.get(element) : undefined;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
function removeNode(node: DataGridElementNode): void {
|
|
642
|
+
const configElement = node.configElement;
|
|
643
|
+
if (configElement) {
|
|
644
|
+
elementToNode.delete(configElement);
|
|
645
|
+
}
|
|
646
|
+
node.remove();
|
|
647
|
+
}
|
|
@@ -81,7 +81,14 @@ export class CustomPreviewSection {
|
|
|
81
81
|
return document.createTextNode(String(jsonML));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
if (jsonML[0] !== 'object') {
|
|
85
|
+
return this.renderElement(jsonML);
|
|
86
|
+
}
|
|
87
|
+
if (jsonML.length !== 2) {
|
|
88
|
+
Common.Console.Console.instance().error('Broken formatter: object reference must contain exactly two elements');
|
|
89
|
+
return document.createElement('span');
|
|
90
|
+
}
|
|
91
|
+
return this.layoutObjectTag(jsonML);
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
|