window.innerWidth/Height incorrect on chromium-swarm Android devices |
||
Issue descriptionThe reported window dimensions on Android devices in chromium-swarm seem to be way larger than they should be. For example, the Nexus 5 is supposed to have a screen width of 360 CSS pixels. This is correctly reported for screen.width, but window.innerWidth reports a width of 980. This was the root cause of Issue 814460 , where the increased width/height was causing us to try to allocate a 2940 x 4173 frame buffer for WebXR, which is much larger than the maximum allowed size. This appears to be somehow related to the way the bots are provisioned on chromium-swarm, as this has been unable to be reproduced locally, but the segfault issue occurred on multiple swarmed device/OS combinations: * Nexus 5 w/ K * Nexus 5 w/ L * Pixel XL w/ N * Pixel XL w/ O Attached is a video of one of the tests that encountered this behavior, although it doesn't look like anything out of the ordinary happens.
,
Mar 20 2018
This is working as intended. window.innerWidth/Height reports the layout viewport size. On Android, if you don't specify a viewport meta tag, we fallback to using a 980px layout width. This is to allow legacy desktop pages to render correctly. Effectively, we're laying the page out as-if it were in a 980px window and then we zoom out to fit that into the smaller screen. The solution here is to add a viewport meta tag to your page to render it in a mobile viewport: <meta name="viewport" content="width=device-width"> Doing so makes Chrome lay the page out into the same size as the screen.
,
Mar 20 2018
Alright, good to know that this is WAI. Closing. |
||
►
Sign in to add a comment |
||
Comment 1 by dtapu...@chromium.org
, Mar 20 2018Labels: Needs-Feedback
Status: Untriaged (was: Available)