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

Commit 58ea91a

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
Prefer use of attribute instead of binding in devtools-link
As discussed on a previous CL we would prefer to use direct attribute rather then binding to the object Bug: 456407878 Change-Id: I5356a3135ed6eb3a84694f7fb897e5bf1aee69eb Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7510905 Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org> Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
1 parent 5756f3b commit 58ea91a

28 files changed

+62
-63
lines changed

front_end/panels/ai_assistance/PatchWidget.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
205205
class="link"
206206
title="${UIStringsNotTranslate.viewUploadedFiles} ${UIStringsNotTranslate.opensInNewTab}"
207207
href="data:text/plain;charset=utf-8,${encodeURIComponent(input.sources)}"
208-
.jslogContext=${'files-used-in-patching'}>
208+
jslogcontext="files-used-in-patching">
209209
${UIStringsNotTranslate.viewUploadedFiles}
210210
</devtools-link>`;
211211
}
@@ -296,8 +296,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
296296
return html`
297297
<div class="footer">
298298
<div class="left-side">
299-
<devtools-link class="link disclaimer-link" href="https://support.google.com/legal/answer/13505487" .jslogContext=${
300-
'code-disclaimer'}>
299+
<devtools-link class="link disclaimer-link" href="https://support.google.com/legal/answer/13505487" jslogcontext="code-disclaimer">
301300
${lockedString(UIStringsNotTranslate.codeDisclaimer)}
302301
</devtools-link>
303302
${renderSourcesLink()}
@@ -575,7 +574,7 @@ export class PatchWidget extends UI.Widget.Widget {
575574
content: html`<devtools-link
576575
href=${CODE_SNIPPET_WARNING_URL}
577576
class="link devtools-link"
578-
.jslogContext=${'code-snippets-explainer.patch-widget'}
577+
jslogcontext="code-snippets-explainer.patch-widget"
579578
>${lockedString(UIStringsNotTranslate.freDisclaimerTextUseWithCaution)}</devtools-link>`,
580579
// clang-format on
581580
}

front_end/panels/ai_assistance/SelectWorkspaceDialog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const SELECT_WORKSPACE_DIALOG_DEFAULT_VIEW: View = (input, _output, targe
9393
<devtools-link
9494
class="devtools-link"
9595
href="https://goo.gle/devtools-automatic-workspace-folders"
96-
.jslogContext=${'automatic-workspaces-documentation'}
96+
jslogcontext="automatic-workspaces-documentation"
9797
>com.chrome.devtools.json</devtools-link>
9898
file to automatically connect your project to DevTools.
9999
</div>

front_end/panels/application/AppManifestView.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ function renderIdentity(identityData: IdentitySectionData, onCopy: () => void, o
644644
jslog=${VisualLogging.action('help').track({hover: true})}>
645645
</devtools-icon>
646646
<devtools-link href="https://developer.chrome.com/blog/pwa-manifest-id/"
647-
.jslogContext=${'learn-more'}
647+
jslogcontext="learn-more"
648648
${ref(setFocusOnSection(i18nString(UIStrings.identity), output))}>
649649
${i18nString(UIStrings.learnMore)}
650650
</devtools-link>
@@ -766,7 +766,7 @@ function renderIcons(
766766
<div class="report-row">
767767
${i18nTemplate(str_, UIStrings.needHelpReadOurS, {
768768
PH1: html`
769-
<devtools-link href="https://web.dev/maskable-icon/" .jslogContext=${'learn-more'}>
769+
<devtools-link href="https://web.dev/maskable-icon/" jslogcontext="learn-more">
770770
${i18nString(UIStrings.documentationOnMaskableIcons)}
771771
</devtools-link>`,
772772
})}
@@ -866,7 +866,7 @@ function renderWindowControlsSection(
866866
PH2: html`<code>
867867
<devtools-link
868868
href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override"
869-
.jslogContext=${'display-override'}
869+
jslogcontext="display-override"
870870
${ref(setFocusOnSection(i18nString(UIStrings.windowControlsOverlay), output))}>
871871
display-override
872872
</devtools-link>
@@ -882,7 +882,7 @@ function renderWindowControlsSection(
882882
${i18nTemplate(str_, UIStrings.wcoNotFound, {PH1: html`<code>
883883
<devtools-link
884884
href="https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override"
885-
.jslogContext=${'display-override'}
885+
jslogcontext="display-override"
886886
${ref(setFocusOnSection(i18nString(UIStrings.windowControlsOverlay), output))}>
887887
display-override
888888
</devtools-link>
@@ -891,7 +891,7 @@ function renderWindowControlsSection(
891891
<div class="report-row">
892892
${i18nTemplate(str_, UIStrings.wcoNeedHelpReadMore, {PH1: html`<devtools-link
893893
href="https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/window-controls-overlay"
894-
.jslogContext=${'customize-pwa-tittle-bar'}>
894+
jslogcontext="customize-pwa-tittle-bar">
895895
${i18nString(UIStrings.customizePwaTitleBar)}
896896
</devtools-link>`})}
897897
</div>

front_end/panels/application/FrameDetailsView.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ function renderOriginTrial(trials: Protocol.Page.OriginTrial[]|null): LitTemplat
324324
<span class="report-section">
325325
${i18nString(UIStrings.originTrialsExplanation)}
326326
<devtools-link href="https://developer.chrome.com/docs/web-platform/origin-trials/" class="link"
327-
.jslogContext=${'learn-more.origin-trials'}>
327+
jslogcontext="learn-more.origin-trials">
328328
${i18nString(UIStrings.learnMore)}
329329
</devtools-link>
330330
</span>
@@ -738,7 +738,7 @@ function renderApiAvailabilitySection(frame: SDK.ResourceTreeModel.ResourceTreeF
738738
${i18nString(UIStrings.availabilityOfCertainApisDepends)}
739739
<devtools-link
740740
href="https://web.dev/why-coop-coep/" class="link"
741-
.jslogContext=${'learn-more.coop-coep'}>
741+
jslogcontext="learn-more.coop-coep">
742742
${i18nString(UIStrings.learnMore)}
743743
</devtools-link>
744744
</span>
@@ -815,8 +815,7 @@ function renderMeasureMemoryAvailability(frame: SDK.ResourceTreeModel.ResourceTr
815815
<devtools-report-key>${i18nString(UIStrings.measureMemory)}</devtools-report-key>
816816
<devtools-report-value>
817817
<span title=${tooltipText}>${
818-
availabilityText}</span>\xA0<devtools-link class="link" href="https://web.dev/monitor-total-page-memory-usage/" .jslogContext=${
819-
'learn-more.monitor-memory-usage'}>${
818+
availabilityText}</span>\xA0<devtools-link class="link" href="https://web.dev/monitor-total-page-memory-usage/" jslogcontext="learn-more.monitor-memory-usage">${
820819
i18nString(UIStrings.learnMore)}</devtools-link>
821820
</devtools-report-value>
822821
`;

front_end/panels/application/components/BounceTrackingMitigationsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const renderMainFrameInformation = (input: ViewInput): Lit.LitTemplate => {
159159
</devtools-report-divider>
160160
<devtools-report-section>
161161
<devtools-link href="https://privacycg.github.io/nav-tracking-mitigations/#bounce-tracking-mitigations" class="link"
162-
.jslogContext=${'learn-more'}>
162+
jslogcontext="learn-more">
163163
${i18nString(UIStrings.learnMore)}
164164
</devtools-link>
165165
</devtools-report-section>

front_end/panels/application/components/ProtocolHandlersView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function renderStatusMessage(
8282
name=${protocolHandlers.length > 0 ? 'check-circle' : 'info'}>
8383
</devtools-icon>
8484
${uiI18n.getFormatLocalizedStringTemplate(str_, statusString, {PH1: html`
85-
<devtools-link href=${manifestLink} .jslogContext=${'manifest'}>${i18nString(UIStrings.manifest)}</devtools-link>
85+
<devtools-link href=${manifestLink} jslogcontext="manifest">${i18nString(UIStrings.manifest)}</devtools-link>
8686
` })}
8787
</div>`;
8888
// clang-format on
@@ -144,7 +144,7 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
144144
${renderStatusMessage(input.protocolHandler, input.manifestLink)}
145145
<div class="protocol-handlers-row">
146146
${i18nTemplate(UIStrings.needHelpReadOur, {PH1: html`
147-
<devtools-link href=${PROTOCOL_DOCUMENT_URL} class="devtools-link" autofocus .jslogContext=${'learn-more'}>
147+
<devtools-link href=${PROTOCOL_DOCUMENT_URL} class="devtools-link" autofocus jslogcontext="learn-more">
148148
${i18nString(UIStrings.protocolHandlerRegistrations)}
149149
</devtools-link>`})}
150150
</div>

front_end/panels/application/components/ReportsGrid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
8282
<style>${reportsGridStyles}</style>
8383
<span class="status-header">${i18nString(UIStrings.status)}</span>
8484
<devtools-link href="https://web.dev/reporting-api/#report-status"
85-
.jslogContext=${'report-status'}>
85+
jslogcontext="report-status">
8686
<devtools-icon class="inline-icon medium" name="help" style="color: var(--icon-link);"
8787
></devtools-icon>
8888
</devtools-link>
@@ -112,7 +112,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
112112
<devtools-link
113113
class="devtools-link"
114114
href=${REPORTING_API_EXPLANATION_URL}
115-
.jslogContext=${'learn-more'}
115+
jslogcontext="learn-more"
116116
>${i18nString(UIStrings.learnMore)}</devtools-link>
117117
</div>
118118
</div>

front_end/panels/application/preloading/PreloadingView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class PreloadingRuleSetView extends UI.Widget.VBox {
257257
<devtools-link
258258
class="devtools-link"
259259
href=${SPECULATION_EXPLANATION_URL}
260-
.jslogContext=${'learn-more'}
260+
jslogcontext="learn-more"
261261
>${i18nString(UIStrings.learnMore)}</devtools-link>
262262
</div>
263263
</div>
@@ -434,7 +434,7 @@ export class PreloadingAttemptView extends UI.Widget.VBox {
434434
<devtools-link
435435
class="devtools-link"
436436
href=${SPECULATION_EXPLANATION_URL}
437-
.jslogContext=${'learn-more'}
437+
jslogcontext="learn-more"
438438
>${i18nString(UIStrings.learnMore)}</devtools-link>
439439
</div>
440440
</div>

front_end/panels/application/preloading/components/UsedPreloadingView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function renderMismatchedSections(data: MismatchedData): LitTemplate {
262262
<devtools-link
263263
class="link devtools-link"
264264
href=${data.pageURL}
265-
.jslogContext=${'current-url'}
265+
jslogcontext="current-url"
266266
>${data.pageURL}</devtools-link>
267267
</devtools-report-section>
268268
@@ -412,7 +412,7 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
412412
<devtools-link
413413
class="link devtools-link"
414414
href=${'https://developer.chrome.com/blog/prerender-pages/'}
415-
.jslogContext=${'learn-more'}
415+
jslogcontext="learn-more"
416416
>${i18nString(UIStrings.learnMore)}</devtools-link>
417417
</devtools-report-section>
418418
</devtools-report>`, target);

front_end/panels/autofill/AutofillView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: ViewOutput, target: HTMLE
238238
jslog=${VisualLogging.toggle(input.autoOpenViewSetting.name).track({ change: true })}>
239239
${i18nString(UIStrings.autoShow)}
240240
</devtools-checkbox>
241-
<devtools-link href=${AUTOFILL_FEEDBACK_URL} class="feedback link" .jslogContext=${'feedback'}>${i18nString(UIStrings.sendFeedback)}</devtools-link>
241+
<devtools-link href=${AUTOFILL_FEEDBACK_URL} class="feedback link" jslogcontext="feedback">${i18nString(UIStrings.sendFeedback)}</devtools-link>
242242
</div>
243243
<div class="placeholder-container" jslog=${VisualLogging.pane('autofill-empty')}>
244244
<div class="empty-state">
245245
<span class="empty-state-header">${i18nString(UIStrings.noAutofill)}</span>
246246
<div class="empty-state-description">
247247
<span>${i18nString(UIStrings.toStartDebugging)}</span>
248-
<devtools-link href=${AUTOFILL_INFO_URL} class="link" .jslogContext=${'learn-more'}>${i18nString(UIStrings.learnMore)}</devtools-link>
248+
<devtools-link href=${AUTOFILL_INFO_URL} class="link" jslogcontext="learn-more">${i18nString(UIStrings.learnMore)}</devtools-link>
249249
</div>
250250
</div>
251251
</div>
@@ -280,7 +280,7 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: ViewOutput, target: HTMLE
280280
${i18nString(UIStrings.autoShow)}
281281
</devtools-checkbox>
282282
</div>
283-
<devtools-link href=${AUTOFILL_FEEDBACK_URL} class="feedback link" .jslogContext=${'feedback'}>${i18nString(UIStrings.sendFeedback)}</devtools-link>
283+
<devtools-link href=${AUTOFILL_FEEDBACK_URL} class="feedback link" jslogcontext="feedback">${i18nString(UIStrings.sendFeedback)}</devtools-link>
284284
</div>
285285
${renderAddress()}
286286
</div>

0 commit comments

Comments
 (0)