[Report-a-scam] Hook up screenshot to dialog 11/X [chromium/src : main]

0 views
Skip to first unread message

Demetrios Papadopoulos (Gerrit)

unread,
Feb 27, 2026, 6:50:01 PM (7 hours ago) Feb 27
to Peter Kotwicz, Chromium UI WebUI Reviews, chromium...@chromium.org, ipc-securi...@chromium.org
Attention needed from Peter Kotwicz

Demetrios Papadopoulos added 9 comments

File chrome/browser/resources/feedback/report_unsafe_site/report_unsafe_site_app.css
Line 46, Patchset 4 (Latest):.screenshot-placeholder {
Demetrios Papadopoulos . unresolved

Since the DOM node with this CSS class already has an ID, no need to give it a class as well.
```suggestion
#screenshot-placeholder {
```

Line 58, Patchset 4 (Latest):.screenshot-image {
Demetrios Papadopoulos . unresolved

Same here.
```suggestion
#screenshot-image {
```

File chrome/browser/resources/feedback/report_unsafe_site/report_unsafe_site_app.html.ts
Line 23, Patchset 4 (Latest): <img class="${this.includeScreenshot_ ? 'screenshot-image' : 'hidden'}"
Demetrios Papadopoulos . unresolved

Use conditional rendering instead. See related comment further below.

Line 24, Patchset 4 (Latest): id="screenshot-image" />
Demetrios Papadopoulos . unresolved

"/>" is not proper HTML syntax.

```suggestion
id="screenshot-image">
```

See details at https://developer.mozilla.org/en-US/docs/Glossary/Void_element#self-closing_tags

Line 25, Patchset 4 (Latest): <div
class="${this.includeScreenshot_ ? 'hidden' : 'screenshot-placeholder'}"
id="screenshot-placeholder">
<cr-icon icon="report_unsafe_site:visibility-off"></cr-icon>
</div>
Demetrios Papadopoulos . unresolved
How about using conditional rendering instead? It seems much simpler thatn adding/removing a CSS class that shows/hides the element.
```suggestion
${!this.includeScreenshot_ ? html`
<div id="screenshot-placeholder">
<cr-icon icon="report_unsafe_site:visibility-off"></cr-icon>
</div>
` : ''}
```
Line 32, Patchset 4 (Latest): @change="${this.onIncludeScreenshotChange_}">
Demetrios Papadopoulos . unresolved
Incorrect indentation.
```suggestion
@change="${this.onIncludeScreenshotChange_}">
```
File chrome/browser/resources/feedback/report_unsafe_site/report_unsafe_site_app.ts
Line 19, Patchset 4 (Latest): includeScreenshotCheckbox: CrCheckboxElement,
Demetrios Papadopoulos . unresolved

Leverage this in tests to refer to the element, instead of using querySelector. Otherwise what is the point of adding this?

File chrome/test/data/webui/feedback/report_unsafe_site_test.ts
Line 63, Patchset 4 (Latest): await whenCheck(checkbox, () => checkbox.checked);
Demetrios Papadopoulos . unresolved

Why is this waiting necessary? Can you simply use `await microtasksFinished()` here? What triggers the checkbox to be checked?

Open in Gerrit

Related details

Attention is currently required from:
  • Peter Kotwicz
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic48327976dd912dad161f960ddc138d49221edb0
Gerrit-Change-Number: 7618302
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Demetrios Papadopoulos <dpa...@chromium.org>
Gerrit-CC: Chromium UI WebUI Reviews <chromium-ui-...@google.com>
Gerrit-CC: gwsq
Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Comment-Date: Fri, 27 Feb 2026 23:49:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Demetrios Papadopoulos (Gerrit)

unread,
Feb 27, 2026, 7:18:36 PM (7 hours ago) Feb 27
to Peter Kotwicz, Chromium UI WebUI Reviews, chromium...@chromium.org, ipc-securi...@chromium.org
Attention needed from Peter Kotwicz

Demetrios Papadopoulos added 1 comment

File chrome/test/data/webui/feedback/report_unsafe_site_test.ts
Line 63, Patchset 4 (Latest): await whenCheck(checkbox, () => checkbox.checked);
Demetrios Papadopoulos . unresolved

Why is this waiting necessary? Can you simply use `await microtasksFinished()` here? What triggers the checkbox to be checked?

Demetrios Papadopoulos

FWIW, if this is triggered from the backend response callback, it is usually better to explicitly wait for the backend call to happen with something like
```
await this.handler.whenCalled(...);
await microtasksFinished();
```
than magically waiting for the state to change.

Open in Gerrit

Related details

Attention is currently required from:
  • Peter Kotwicz
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic48327976dd912dad161f960ddc138d49221edb0
Gerrit-Change-Number: 7618302
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Demetrios Papadopoulos <dpa...@chromium.org>
Gerrit-CC: Chromium UI WebUI Reviews <chromium-ui-...@google.com>
Gerrit-CC: gwsq
Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Comment-Date: Sat, 28 Feb 2026 00:18:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Demetrios Papadopoulos <dpa...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Peter Kotwicz (Gerrit)

unread,
Feb 27, 2026, 9:46:26 PM (4 hours ago) Feb 27
to Chromium UI WebUI Reviews, Demetrios Papadopoulos, chromium...@chromium.org, ipc-securi...@chromium.org
Attention needed from Demetrios Papadopoulos

Peter Kotwicz added 9 comments

File chrome/browser/resources/feedback/report_unsafe_site/report_unsafe_site_app.css
Line 18, Patchset 4:.hidden {
display: none;
}
Demetrios Papadopoulos . resolved
Peter Kotwicz

Removed CSS rule because I switched to the conditional HTML notation you suggested.

Line 46, Patchset 4:.screenshot-placeholder {
Demetrios Papadopoulos . resolved

Since the DOM node with this CSS class already has an ID, no need to give it a class as well.
```suggestion
#screenshot-placeholder {
```

Peter Kotwicz

Done

Line 58, Patchset 4:.screenshot-image {
Demetrios Papadopoulos . resolved

Same here.
```suggestion
#screenshot-image {
```

Peter Kotwicz

Done

File chrome/browser/resources/feedback/report_unsafe_site/report_unsafe_site_app.html.ts
Line 23, Patchset 4: <img class="${this.includeScreenshot_ ? 'screenshot-image' : 'hidden'}"
Demetrios Papadopoulos . resolved

Use conditional rendering instead. See related comment further below.

Peter Kotwicz

Done

Line 24, Patchset 4: id="screenshot-image" />
Demetrios Papadopoulos . resolved

"/>" is not proper HTML syntax.

```suggestion
id="screenshot-image">
```

See details at https://developer.mozilla.org/en-US/docs/Glossary/Void_element#self-closing_tags

Peter Kotwicz

Thanks for explaining. I learned something!


class="${this.includeScreenshot_ ? 'hidden' : 'screenshot-placeholder'}"
id="screenshot-placeholder">
<cr-icon icon="report_unsafe_site:visibility-off"></cr-icon>
</div>
Demetrios Papadopoulos . resolved
How about using conditional rendering instead? It seems much simpler thatn adding/removing a CSS class that shows/hides the element.
```suggestion
${!this.includeScreenshot_ ? html`
<div id="screenshot-placeholder">
<cr-icon icon="report_unsafe_site:visibility-off"></cr-icon>
</div>
` : ''}
```
Peter Kotwicz

Done

Line 32, Patchset 4: @change="${this.onIncludeScreenshotChange_}">
Demetrios Papadopoulos . resolved
Incorrect indentation.
```suggestion
@change="${this.onIncludeScreenshotChange_}">
```
Peter Kotwicz

Done

File chrome/browser/resources/feedback/report_unsafe_site/report_unsafe_site_app.ts
Line 19, Patchset 4: includeScreenshotCheckbox: CrCheckboxElement,
Demetrios Papadopoulos . resolved

Leverage this in tests to refer to the element, instead of using querySelector. Otherwise what is the point of adding this?

Peter Kotwicz

Done

File chrome/test/data/webui/feedback/report_unsafe_site_test.ts
Line 63, Patchset 4: await whenCheck(checkbox, () => checkbox.checked);
Demetrios Papadopoulos . resolved

Why is this waiting necessary? Can you simply use `await microtasksFinished()` here? What triggers the checkbox to be checked?

Demetrios Papadopoulos

FWIW, if this is triggered from the backend response callback, it is usually better to explicitly wait for the backend call to happen with something like
```
await this.handler.whenCalled(...);
await microtasksFinished();
```
than magically waiting for the state to change.

Peter Kotwicz

Good idea! Done.

Open in Gerrit

Related details

Attention is currently required from:
  • Demetrios Papadopoulos
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic48327976dd912dad161f960ddc138d49221edb0
    Gerrit-Change-Number: 7618302
    Gerrit-PatchSet: 6
    Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
    Gerrit-Reviewer: Demetrios Papadopoulos <dpa...@chromium.org>
    Gerrit-CC: Chromium UI WebUI Reviews <chromium-ui-...@google.com>
    Gerrit-CC: gwsq
    Gerrit-Attention: Demetrios Papadopoulos <dpa...@chromium.org>
    Gerrit-Comment-Date: Sat, 28 Feb 2026 02:46:20 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages