豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 2fac722

Browse files
szuendDevtools-frontend LUCI CQ
authored andcommitted
[ui] Render <tfoot> in lit in StackTracePreviewContent
R=pfaffe@chromium.org Bug: 483576322 Change-Id: I5007ad785babb8e3cda53eb7d53ca23bc95f0d50 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7595294 Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
1 parent 3aaeec2 commit 2fac722

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

front_end/ui/legacy/components/utils/JSPresentationUtils.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
3737
import * as SDK from '../../../../core/sdk/sdk.js';
3838
import * as StackTrace from '../../../../models/stack_trace/stack_trace.js';
3939
import * as Workspace from '../../../../models/workspace/workspace.js';
40-
import {Directives, html, render} from '../../../lit/lit.js';
40+
import {Directives, html, nothing, render} from '../../../lit/lit.js';
4141
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
4242
import * as UI from '../../legacy.js';
4343

@@ -119,6 +119,26 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
119119
<style>${jsUtilsStyles}</style>
120120
<table class=${classMap(classes)}>
121121
${renderStackTraceTable(input)}
122+
${input.stackTrace ? html`
123+
<tfoot>
124+
<tr class="show-all-link">
125+
<td></td>
126+
<td colspan="3">
127+
<span class="link" @click=${input.onShowMore}>
128+
<span class="css-inserted-text" data-inserted-text=${i18nString(UIStrings.showMoreFrames)}></span>
129+
</span>
130+
</td>
131+
</tr>
132+
<tr class="show-less-link">
133+
<td></td>
134+
<td colspan="3">
135+
<span class="link" @click=${input.onShowLess}>
136+
<span class="css-inserted-text" data-inserted-text=${i18nString(UIStrings.showLess)}></span>
137+
</span>
138+
</td>
139+
</tr>
140+
</tfoot>
141+
` : nothing}
122142
</table>
123143
`, target);
124144
// clang-format on
@@ -195,26 +215,6 @@ function renderStackTraceTable(options: ViewInput): DocumentFragment {
195215
}
196216
}
197217

198-
const tableSection = container.createChild('tfoot');
199-
const showAllRow = tableSection.createChild('tr', 'show-all-link');
200-
showAllRow.createChild('td');
201-
const cell = showAllRow.createChild('td');
202-
cell.colSpan = 4;
203-
const showAllLink = cell.createChild('span', 'link');
204-
// Don't directly put the text of the link in the DOM, as it will likely be
205-
// invisible and it may be confusing if it is copied to the clipboard.
206-
showAllLink.createChild('span', 'css-inserted-text')
207-
.setAttribute('data-inserted-text', i18nString(UIStrings.showMoreFrames));
208-
showAllLink.addEventListener('click', options.onShowMore);
209-
const showLessRow = tableSection.createChild('tr', 'show-less-link');
210-
showLessRow.createChild('td');
211-
const showLesscell = showLessRow.createChild('td');
212-
showLesscell.colSpan = 4;
213-
const showLessLink = showLesscell.createChild('span', 'link');
214-
showLessLink.createChild('span', 'css-inserted-text')
215-
.setAttribute('data-inserted-text', i18nString(UIStrings.showLess));
216-
showLessLink.addEventListener('click', options.onShowLess);
217-
218218
return container;
219219
}
220220

0 commit comments

Comments
 (0)