Skip to content
Commit f3f90d94 authored by Max Curran's avatar Max Curran Committed by Chromium LUCI CQ
Browse files

[client-hints] Calculate correct values for viewport width and height on

navigation requests.

Currently on navigation requests, the viewport-width and sec-ch-viewport-height client hints are calculated using the display's dimensions. This CL updates the two clients to use the visible viewport size, which provides more accurate information.

The CL also handles prefetch requests. In a prefetch request, the frame_tree_node is null, so we need a separate mechanism to track the viewport size. This is done by a new ClientHintsWebContentsObserver.

Reimplementation of the reverted CL: https://chromium-review.googlesource.com/c/chromium/src/+/2494876

Bug: 825892
Change-Id: Id3117cfa505c33d59eb7dbb8cc8b485dd567f792
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3108448


Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Max Curran <curranmax@chromium.org>
Cr-Commit-Position: refs/heads/main@{#918864}
parent 682bc558
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment