Headless: Box model quad coordinates are weird when used with mobile device emulation |
||||
Issue descriptionIt 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.
,
Feb 15 2017
+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?
,
Feb 15 2017
Or maybe the body overflows outside of the viewport and we report the unclipped size?
,
May 15 2017
,
Dec 11 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by skyos...@chromium.org
, Feb 15 2017