Skip to content

Commit 120c373

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
Auto-set --icon-error color for cross-circle-filled icons in component
Bypass-Check-License: Only updating files, no new files are added. Bug: 414330824 Change-Id: I92dfe46197c86d5e89f782bb9e0a3dfb70ed57ae Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6845748 Commit-Queue: Kateryna Prokopenko <[email protected]> Reviewed-by: Nikolay Vitkov <[email protected]>
1 parent 0052fd3 commit 120c373

File tree

13 files changed

+15
-34
lines changed

13 files changed

+15
-34
lines changed

front_end/panels/ai_assistance/components/chatView.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,6 @@ main {
859859
align-items: center;
860860
gap: var(--sys-size-3);
861861
color: var(--sys-color-error);
862-
863-
devtools-icon {
864-
color: var(--sys-color-error);
865-
}
866862
}
867863

868864
.footer {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export class PreloadingGrid extends LegacyWrapper.LegacyWrapper.WrappableCompone
110110
name=${hasWarning ? 'warning-filled' : 'cross-circle-filled'}
111111
class='medium'
112112
style=${styleMap({
113-
color: hasWarning ? 'var(--sys-color-warning)' : 'var(--sys-color-error)',
114113
'vertical-align': 'sub',
115114
})}
116115
></devtools-icon>` : ''}

front_end/panels/console/ConsoleViewMessage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,14 +1506,13 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
15061506
this.messageIcon = null;
15071507
}
15081508

1509-
let color = '';
1509+
const color = '';
15101510
let iconName = '';
15111511
let accessibleName = '';
15121512
if (this.message.level === Protocol.Log.LogEntryLevel.Warning) {
15131513
iconName = 'warning-filled';
15141514
accessibleName = i18nString(UIStrings.warning);
15151515
} else if (this.message.level === Protocol.Log.LogEntryLevel.Error) {
1516-
color = 'var(--icon-error)';
15171516
iconName = 'cross-circle-filled';
15181517
accessibleName = i18nString(UIStrings.error);
15191518
} else if (this.message.originatesFromLogpoint) {

front_end/panels/console_counters/WarningErrorCounter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ const DEFAULT_VIEW: View = (input, _output, target) => {
7070
groups: [
7171
{
7272
iconName: 'cross-circle-filled',
73-
iconColor: 'var(--icon-error)',
7473
text: countToText(errors)
7574
},
7675
{

front_end/panels/network/NetworkDataGridNode.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describeWithEnvironment('NetworkLogView', () => {
9898
assert.isNull(marker);
9999
});
100100

101-
it('adds an error red icon to the left of the failed requests', async () => {
101+
it('adds an error icon to the left of the failed requests', async () => {
102102
const request = SDK.NetworkRequest.NetworkRequest.create(
103103
'requestId' as Protocol.Network.RequestId, urlString`https://www.example.com`, urlString``, null, null, null);
104104
request.statusCode = 404;
@@ -111,9 +111,6 @@ describeWithEnvironment('NetworkLogView', () => {
111111
const iconElement = el.querySelector('.icon') as HTMLElement;
112112
const iconImage = iconElement.getAttribute('name');
113113
assert.strictEqual('cross-circle-filled', iconImage);
114-
115-
const backgroundColorOfIcon = iconElement.style.color.toString();
116-
assert.strictEqual(backgroundColorOfIcon, 'var(--icon-error)');
117114
});
118115

119116
it('show document icon', async () => {
@@ -475,7 +472,5 @@ describeWithEnvironment('NetworkLogView', () => {
475472
const iconElement = el.querySelector('.icon') as HTMLElement;
476473
const iconImage = iconElement.getAttribute('name');
477474
assert.strictEqual('warning-filled', iconImage);
478-
const backgroundColorOfIcon = iconElement.style.color.toString();
479-
assert.strictEqual(backgroundColorOfIcon, 'var(--icon-warning)');
480475
});
481476
});

front_end/panels/network/NetworkItemView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
235235
const signedExchangeInfo = request.signedExchangeInfo();
236236
if (signedExchangeInfo?.errors?.length) {
237237
const icon = new IconButton.Icon.Icon();
238-
icon.data = {iconName: 'cross-circle-filled', color: 'var(--icon-error)'};
238+
icon.name = 'cross-circle-filled';
239239
icon.classList.add('small');
240240
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.signedexchangeError));
241241
this.setTabIcon(NetworkForward.UIRequestLocation.UIRequestTabs.PREVIEW, icon);
@@ -343,7 +343,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
343343
if (trustTokenResult &&
344344
!NetworkComponents.RequestTrustTokensView.statusConsideredSuccess(trustTokenResult.status)) {
345345
const icon = new IconButton.Icon.Icon();
346-
icon.data = {iconName: 'cross-circle-filled', color: 'var(--icon-error)'};
346+
icon.name = 'cross-circle-filled';
347347
icon.classList.add('small');
348348
this.setTabIcon(NetworkForward.UIRequestLocation.UIRequestTabs.TRUST_TOKENS, icon);
349349
}

front_end/panels/network/RequestCookiesView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export class RequestCookiesView extends UI.Widget.Widget {
306306
for (const malformedCookie of malformedResponseCookies) {
307307
const listItem = this.malformedResponseCookiesList.createChild('span', 'cookie-line source-code');
308308
const icon = new IconButton.Icon.Icon();
309-
icon.data = {iconName: 'cross-circle-filled', color: 'var(--icon-error)'};
309+
icon.name = 'cross-circle-filled';
310310
icon.classList.add('cookie-warning-icon', 'small');
311311
listItem.appendChild(icon);
312312
UI.UIUtils.createTextChild(listItem, malformedCookie.cookieLine);

front_end/panels/network/SignedExchangeInfoView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class SignedExchangeInfoView extends UI.Widget.VBox {
128128
for (const error of signedExchangeInfo.errors) {
129129
const fragment = document.createDocumentFragment();
130130
const icon = new IconButton.Icon.Icon();
131-
icon.data = {iconName: 'cross-circle-filled', color: 'var(--icon-error)'};
131+
icon.name = 'cross-circle-filled';
132132
icon.classList.add('prompt-icon', 'small');
133133
fragment.appendChild(icon);
134134
fragment.createChild('div', 'error-log').textContent = error.message;

front_end/panels/network/components/HeaderSectionRow.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,7 @@ export class HeaderSectionRow extends HTMLElement {
180180
Lit.nothing
181181
}
182182
${isHeaderNameEditable && !this.#isValidHeaderName ?
183-
html`<devtools-icon class="inline-icon disallowed-characters" title=${UIStrings.headerNamesOnlyLetters} .data=${{
184-
iconName: 'cross-circle-filled',
185-
width: '16px',
186-
height: '16px',
187-
color: 'var(--icon-error)',
188-
}}>
183+
html`<devtools-icon class="inline-icon disallowed-characters medium" title=${UIStrings.headerNamesOnlyLetters} name='cross-circle-filled'>
189184
</devtools-icon>` : Lit.nothing
190185
}
191186
${isHeaderNameEditable && !this.#header.isDeleted ?

front_end/panels/sources/TabbedEditorContainer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
555555

556556
private addLoadErrorIcon(tabId: string): void {
557557
const icon = new IconButton.Icon.Icon();
558-
icon.data = {iconName: 'cross-circle-filled', color: 'var(--icon-error)'};
558+
icon.name = 'cross-circle-filled';
559559
icon.classList.add('small');
560560
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.unableToLoadThisContent));
561561
if (this.tabbedPane.tabView(tabId)) {
@@ -635,7 +635,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
635635
this.tabbedPane.changeTabTitle(tabId, title, tooltip);
636636
if (uiSourceCode.loadError()) {
637637
const icon = new IconButton.Icon.Icon();
638-
icon.data = {iconName: 'cross-circle-filled', color: 'var(--icon-error)'};
638+
icon.name = 'cross-circle-filled';
639639
icon.classList.add('small');
640640
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.unableToLoadThisContent));
641641
this.tabbedPane.setTrailingTabIcon(tabId, icon);

0 commit comments

Comments
 (0)