New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 692197 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Headless: Box model quad coordinates are weird when used with mobile device emulation

Project Member Reported by eseckler@chromium.org, Feb 14 2017

Issue description

It seems that the coordinates returned by DOM.getBoxModel are scaled by some inexplicable factor. We should investigate.

-- Reproduction: --
(1) Download repro.py from https://gist.github.com/anonymous/20fc983c3264139ed78aed800119a4bb
(2) $ headless_shell --remote-debugging-port=9222
(3a) $ python $script localhost:9222 desktop
(3b) $ python $script localhost:9222 mobile

-- Outputs: --
(a) Without mobile:

nodeid 1, w: 785, h: 785, content: [0, 0, 785, 0, 785, 785, 0, 785]
nodeid 3, w: 785, h: 13770, content: [0, 0, 785, 0, 785, 13770, 0, 13770]
nodeid 93, w: 785, h: 13770, content: [0, 0, 785, 0, 785, 13770, 0, 13770]

(b) With mobile:

nodeid 1, w: 1175, h: 1175, content: [0, 0, 731, 0, 731, 731, 0, 731]
nodeid 3, w: 1175, h: 13776, content: [0, 0, 731, 0, 731, 8576, 0, 8576]
nodeid 93, w: 1175, h: 13776, content: [0, 0, 731, 0, 731, 8576, 0, 8576]

Width/height of nodes are (likely) good in both (a) and (b). Quad coordinates make sense for (a), but seem to be scaled for (b).

From the values, it looks like the quad coordinates are scaled by a factor - in this case: node coordinates = ~1.6 x quad coordinates. I tried with a different website and got a different factor. But it seems that factor is constant for a single page.
 
My guess would have been the device scale factor, but looks like you're setting that to 1. Does heise.de have a viewport metatag perhaps?
Cc: tmarek@google.com
+cc tmarek who reported this initially.

Yeah, it didn't look like DSF. Maybe a different scale factor.

While the mobile version of heise.de has a meta viewport, I don't think that this is being served to (b) in this case. Looking at heise.de in chrome with a the mobile emulator in DevTools, it seems that the desktop page is served but scaled down into the 800x800 viewport (screenshot attached). Maybe the width/height and quads are in different coordinate systems. Not sure if that's expected?
Screen Shot 2017-02-15 at 9.46.37 AM.png
1.6 MB View Download
Or maybe the body overflows outside of the viewport and we report the unclipped size?
Components: Internals>Headless
Owner: einbinder@chromium.org
Status: Assigned (was: Available)

Sign in to add a comment