Skip to content

Commit 49dc9ac

Browse files
Adam RaineDevtools-frontend LUCI CQ
authored andcommitted
[DOMSize] Use NodeLink for dom stats node refs
Bug: 394124938 Change-Id: I6001174995c05981a61f03d0f3fc1bb1d13dab04 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6226255 Reviewed-by: Connor Clark <[email protected]> Commit-Queue: Adam Raine <[email protected]> Auto-Submit: Adam Raine <[email protected]>
1 parent f35511b commit 49dc9ac

File tree

1 file changed

+26
-2
lines changed
  • front_end/panels/timeline/components/insights

1 file changed

+26
-2
lines changed

front_end/panels/timeline/components/insights/DOMSize.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import '../../../../ui/components/icon_button/icon_button.js';
66
import './Table.js';
7+
import './NodeLink.js';
78

89
import * as i18n from '../../../../core/i18n/i18n.js';
910
import type {DOMSizeInsightModel} from '../../../../models/trace/insights/DOMSize.js';
@@ -12,6 +13,7 @@ import * as Lit from '../../../../ui/lit/lit.js';
1213
import type * as Overlays from '../../overlays/overlays.js';
1314

1415
import {BaseInsightComponent} from './BaseInsightComponent.js';
16+
import type * as NodeLink from './NodeLink.js';
1517
import type {TableData} from './Table.js';
1618

1719
const UIStrings = {
@@ -68,12 +70,34 @@ export class DOMSize extends BaseInsightComponent<DOMSizeInsightModel> {
6870

6971
if (domStatsData.maxDepth) {
7072
const {nodeId, nodeName} = domStatsData.maxDepth;
71-
rows.push({values: [i18nString(UIStrings.maxDOMDepth), this.renderNode(nodeId, nodeName)]});
73+
// clang-format off
74+
const template = html`
75+
<devtools-performance-node-link
76+
.data=${{
77+
backendNodeId: nodeId,
78+
frame: domStatsData.frame,
79+
fallbackText: nodeName,
80+
} as NodeLink.NodeLinkData}>
81+
</devtools-performance-node-link>
82+
`;
83+
// clang-format on
84+
rows.push({values: [i18nString(UIStrings.maxDOMDepth), template]});
7285
}
7386

7487
if (domStatsData.maxChildren) {
7588
const {nodeId, nodeName} = domStatsData.maxChildren;
76-
rows.push({values: [i18nString(UIStrings.maxChildren), this.renderNode(nodeId, nodeName)]});
89+
// clang-format off
90+
const template = html`
91+
<devtools-performance-node-link
92+
.data=${{
93+
backendNodeId: nodeId,
94+
frame: domStatsData.frame,
95+
fallbackText: nodeName,
96+
} as NodeLink.NodeLinkData}>
97+
</devtools-performance-node-link>
98+
`;
99+
// clang-format on
100+
rows.push({values: [i18nString(UIStrings.maxChildren), template]});
77101
}
78102

79103
if (!rows.length) {

0 commit comments

Comments
 (0)