New issue
Advanced search Search tips

Issue 823563 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

window.innerWidth/Height incorrect on chromium-swarm Android devices

Project Member Reported by bsheedy@chromium.org, Mar 20 2018

Issue description

The 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.
 
record.mp4
4.7 MB View Download
Cc: bokan@chromium.org
Labels: Needs-Feedback
Status: Untriaged (was: Available)
Do you have the example page that you are using? Do you have a constrained viewport? If not you might be getting a desktop viewport size which will have an innerWidth that is much larger than your expected 320px

Comment 2 by bokan@chromium.org, 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.
Status: WontFix (was: Untriaged)
Alright, good to know that this is WAI. Closing.

Sign in to add a comment