Skip to content

Commit a41948d

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
[GM3Restyling] Update selfXSS dialog
Also add an option to make dt-close-button small Screenshot: https://imgur.com/a/6CVoKws Bug: 325442935 Change-Id: I976ee79583a0b792e9f173eadb2a82d8c542e519 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6276567 Auto-Submit: Kateryna Prokopenko <[email protected]> Commit-Queue: Kateryna Prokopenko <[email protected]> Reviewed-by: Kim-Anh Tran <[email protected]>
1 parent bcea1c7 commit a41948d

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

front_end/ui/legacy/UIUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,10 @@ export class DevToolsCloseButton extends HTMLElement {
14161416
ARIAUtils.setLabel(this.#button, name);
14171417
}
14181418

1419+
setSize(size: Buttons.Button.Size): void {
1420+
this.#button.size = size;
1421+
}
1422+
14191423
setTabbable(tabbable: boolean): void {
14201424
if (tabbable) {
14211425
this.#button.tabIndex = 0;

front_end/ui/legacy/components/source_frame/SourceFrame.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,15 +1066,18 @@ export class SelfXssWarningDialog {
10661066
const content = shadowRoot.createChild('div', 'widget');
10671067

10681068
const result = await new Promise<boolean>(resolve => {
1069-
const closeButton = content.createChild('dt-close-button', 'dialog-close-button');
1069+
const header = content.createChild('div', 'header');
1070+
header.createChild('div', 'title').textContent = i18nString(UIStrings.doYouTrustThisCode);
1071+
1072+
const closeButton = header.createChild('dt-close-button', 'dialog-close-button');
10701073
closeButton.setTabbable(true);
10711074
self.onInvokeElement(closeButton, event => {
10721075
dialog.hide();
10731076
event.consume(true);
10741077
resolve(false);
10751078
});
1079+
closeButton.setSize(Buttons.Button.Size.SMALL);
10761080

1077-
content.createChild('div', 'title').textContent = i18nString(UIStrings.doYouTrustThisCode);
10781081
content.createChild('div', 'message').textContent =
10791082
i18nString(UIStrings.doNotPaste, {PH1: i18nString(UIStrings.allowPasting)});
10801083

front_end/ui/legacy/components/source_frame/selfXssDialog.css

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,39 @@
44
* found in the LICENSE file.
55
*/
66

7-
.widget {
8-
padding: 20px;
7+
.header {
8+
display: flex;
9+
justify-content: space-between;
10+
font: var(--sys-typescale-body2-medium);
11+
margin: var(--sys-size-5) var(--sys-size-5) var(--sys-size-5) var(--sys-size-8);
912
}
1013

1114
.title {
12-
font-size: larger;
15+
padding-top: var(--sys-size-3);
16+
}
17+
18+
.dialog-close-button {
19+
margin: var(--sys-size-3);
20+
z-index: 1;
1321
}
1422

15-
.title,
1623
.message,
17-
.button,
1824
.text-input {
19-
margin: 5px;
25+
margin: 0 var(--sys-size-8);
26+
}
27+
28+
.text-input {
29+
margin-top: var(--sys-size-5);
2030
}
2131

2232
.button {
2333
text-align: right;
24-
margin-top: 10px;
34+
margin: var(--sys-size-6) var(--sys-size-8) var(--sys-size-8) var(--sys-size-8);
35+
gap: var(--sys-size-5);
2536
display: flex;
2637
justify-content: flex-end;
27-
gap: var(--sys-size-6);
2838
}
2939

3040
.button button {
31-
min-width: 80px;
32-
}
33-
34-
.dialog-close-button {
35-
position: absolute;
36-
right: 9px;
37-
top: 9px;
38-
z-index: 1;
41+
min-width: var(--sys-size-19);
3942
}

0 commit comments

Comments
 (0)