-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sec-CH-Viewport-Width/Height
aren't <meta name=viewport>
-aware on navigation requests
#23
Comments
Viewport-Width/Height
aren't <meta meta name="viewport">
-aware on navigation requestsSec-CH-Viewport-Width/Height
aren't <meta meta name="viewport">
-aware on navigation requests
Sec-CH-Viewport-Width/Height
aren't <meta meta name="viewport">
-aware on navigation requestsSec-CH-Viewport-Width/Height
aren't <meta name=viewport>
-aware on navigation requests
What, exactly, is As best as I can tell it's spec'd here, with a circular definition of |
Looks like the vw/vh units are defined relative to the UA-default viewport size. That seems like it might be a good fit here, actually. |
@acomminos |
What would help us (I think?) is a resolution to this issue: w3c/csswg-drafts#1323 |
In the meantime, we could use some combination of working backwards from
...but I get ahead of myself.... @acomminos can you share a bit more about Facebook's use case for |
@eeeps, it's to improve our server-side rendering pipeline, which depends on the exact dimensions of the device viewport. Providing this lets us precompute layouts and styles for better performance on lower end devices. With more accurate viewport information via client hints, we can drop the cookie we use for storing the last recorded width/height/density, which can be out of date quite often. |
Thank you for bringing this up @eeeps. I agree that the current implementation has limited value. Especially for non-mobile user-agents. In ImageEngine (disclaimer: I work there) we use On first thoughts, I'm not sure I'm in favour of through new hints at the problem. I'm just thinking about the potential mess and confusion among devs with privacy, opting in and delegating permissions across origins. The whole space of the various client hints is already too "dynamic" for most devs to keep up (imo). |
@yoavweiss and I discussed this today. We have a shared gut sense that some sort of client hint should expose what the viewport dimensions would be, if a Yoav leans towards re-using the existing I initially leaned towards more granular and less magical solutions, like inventing new hints which always send the width/height of the viewport in physical pixels (which developers could then divide by Key open questions…
One question which came up, which we think we resolved, is: are there things in HTML payload that can change the DPR? My current understanding is: no (phew); browsers that use a default viewport “zoom out” from it using pinch zoom, not page zoom; pinch zoom does not affect DPR. |
^^ @spanicker |
@eeeps @yoavweiss I agree with what you suggest. Did you query httparchive to check I recently saw a |
I think for devices where For desktop, |
This makes sense. Just a note that came to mind; |
@jonarnes |
And, without time-travel, they can't be, as the (request) values here are dependent on the response.
This issue was first reported against Chromium, by Facebook.
Right now, Chrome on Android always reports its default viewport width of 980px in the
Sec-CH-Viewport-Width
header – which makes a certain kind of sense, given constraints – but in cases where that viewport width is quickly modified by a<meta name=viewport>
declaration, this hint is at best not useful and at worst misleading/harmful.The only things I can think to do about this are:
Sec-CH-Viewport-Width
on navigation requestsThese two things plus the
Sec-CH-DPR
, defaultSec-CH-Viewport-Width
, and any viewport declaration (which the server sending the HTML has the ability, in theory, to know) could be used to calculate the viewport dimensions on the server side after receiving the request but before sending any response. That'd be a pretty complex server-side flow, though.cc: @acomminos @tarunban @domfarolino
The text was updated successfully, but these errors were encountered: