[headless] Fix scaled headless screen origin and work area [chromium/src : main]

0 views
Skip to first unread message

Peter Kvitek (Gerrit)

unread,
Sep 5, 2025, 12:07:24 AM (3 days ago) Sep 5
to Andrey Kosyakov, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, droger+w...@chromium.org, headless...@chromium.org, mac-r...@chromium.org, ozone-...@chromium.org
Attention needed from Andrey Kosyakov

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Andrey Kosyakov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I252354382c80a5af14fcabbb1f469458476a8f6f
Gerrit-Change-Number: 6916664
Gerrit-PatchSet: 8
Gerrit-Owner: Peter Kvitek <kvi...@chromium.org>
Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Reviewer: Peter Kvitek <kvi...@chromium.org>
Gerrit-Attention: Andrey Kosyakov <ca...@chromium.org>
Gerrit-Comment-Date: Fri, 05 Sep 2025 04:07:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrey Kosyakov (Gerrit)

unread,
Sep 5, 2025, 1:48:41 PM (2 days ago) Sep 5
to Peter Kvitek, Avi Drissman, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, droger+w...@chromium.org, headless...@chromium.org, mac-r...@chromium.org, ozone-...@chromium.org
Attention needed from Avi Drissman and Peter Kvitek

Andrey Kosyakov voted and added 4 comments

Votes added by Andrey Kosyakov

Code-Review+1

4 comments

File chrome/browser/devtools/protocol/emulation_handler.cc
Line 189, Patchset 8 (Latest): display, gfx::Rect(left, top, width, height), insets,
Andrey Kosyakov . unresolved

Extract bounds into a variable for readability.

File headless/lib/browser/protocol/emulation_handler.cc
Line 155, Patchset 8 (Latest): display, gfx::Rect(left, top, width, height), insets,
Andrey Kosyakov . unresolved

Extract `bounds` into a variable for readability?

File ui/display/headless/headless_screen_manager.h
Line 46, Patchset 8 (Latest): // work area insets and device pixel ratio.
Andrey Kosyakov . unresolved

Mention that this is just a helper?

File ui/display/headless/headless_screen_manager.cc
Line 42, Patchset 8 (Latest): if (!work_area_insets_pixels.IsEmpty()) {
Andrey Kosyakov . unresolved

How about

```
gfx::Rect work_area = bounds;
if (!work_area_insets_pixels.IsEmpty()) {
work_area.Inset(gfx::ScaleToCeiledInsets(
work_area_insets_pixels, 1.0f / display.device_scale_factor()));
}
display.set_work_area(work_area);
```
So that the logic that varies upon condition is more evident.
Open in Gerrit

Related details

Attention is currently required from:
  • Avi Drissman
  • Peter Kvitek
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I252354382c80a5af14fcabbb1f469458476a8f6f
    Gerrit-Change-Number: 6916664
    Gerrit-PatchSet: 8
    Gerrit-Owner: Peter Kvitek <kvi...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Peter Kvitek <kvi...@chromium.org>
    Gerrit-Attention: Avi Drissman <a...@chromium.org>
    Gerrit-Attention: Peter Kvitek <kvi...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Sep 2025 17:48:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Peter Kvitek (Gerrit)

    unread,
    Sep 5, 2025, 2:37:20 PM (2 days ago) Sep 5
    to Andrey Kosyakov, Avi Drissman, Chromium LUCI CQ, chromium...@chromium.org, devtools...@chromium.org, droger+w...@chromium.org, headless...@chromium.org, mac-r...@chromium.org, ozone-...@chromium.org
    Attention needed from Avi Drissman

    Peter Kvitek added 4 comments

    File chrome/browser/devtools/protocol/emulation_handler.cc
    Line 189, Patchset 8: display, gfx::Rect(left, top, width, height), insets,
    Andrey Kosyakov . resolved

    Extract bounds into a variable for readability.

    Peter Kvitek

    Done

    File headless/lib/browser/protocol/emulation_handler.cc
    Line 155, Patchset 8: display, gfx::Rect(left, top, width, height), insets,
    Andrey Kosyakov . resolved

    Extract `bounds` into a variable for readability?

    Peter Kvitek

    Done

    File ui/display/headless/headless_screen_manager.h
    Line 46, Patchset 8: // work area insets and device pixel ratio.
    Andrey Kosyakov . resolved

    Mention that this is just a helper?

    Peter Kvitek

    Done

    File ui/display/headless/headless_screen_manager.cc
    Line 42, Patchset 8: if (!work_area_insets_pixels.IsEmpty()) {
    Andrey Kosyakov . resolved

    How about

    ```
    gfx::Rect work_area = bounds;
    if (!work_area_insets_pixels.IsEmpty()) {
    work_area.Inset(gfx::ScaleToCeiledInsets(
    work_area_insets_pixels, 1.0f / display.device_scale_factor()));
    }
    display.set_work_area(work_area);
    ```
    So that the logic that varies upon condition is more evident.
    Peter Kvitek

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Avi Drissman
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I252354382c80a5af14fcabbb1f469458476a8f6f
    Gerrit-Change-Number: 6916664
    Gerrit-PatchSet: 9
    Gerrit-Owner: Peter Kvitek <kvi...@chromium.org>
    Gerrit-Reviewer: Andrey Kosyakov <ca...@chromium.org>
    Gerrit-Reviewer: Avi Drissman <a...@chromium.org>
    Gerrit-Reviewer: Peter Kvitek <kvi...@chromium.org>
    Gerrit-Attention: Avi Drissman <a...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Sep 2025 18:37:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andrey Kosyakov <ca...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages