Element.getBoundingClientRect() returns unexpected values in mobile mode
Reported by
abchjs...@gmail.com,
Dec 30 2016
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce the problem: 1. toggle device toolbar and choose a mobile device 2. Element.getBoundingClientRect() returns position relative to the document instead of the viewport. What is the expected behavior? Element.getBoundingClientRect() should return position relative to the viewport. What went wrong? js api returns unexpected result Did this work before? N/A Chrome version: 55.0.2883.87 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Shockwave Flash 24.0 r0
,
Jan 10 2017
Indeed e.g. left property of an element changes with device viewport resize.
,
Jan 11 2017
,
Jan 11 2017
+dsinclair, to me it looks like it's in spec, can you please do a second pass to make sure? I was clicking on an element in devtools in elements and using $0.getBoundingClientRect() and toggling device mode, and it looks like it's correct to me. Even if I zoom (device mode + shift + mouse+down + mouse move) it seems correct. Thanks!
,
Jan 11 2017
Passing to eae@ as layout TL.
,
Jan 11 2017
The viewport in device mode is defined as the viewport of the simulated device. Given that this works as intended. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ranjitkan@chromium.org
, Dec 30 2016Labels: Needs-Feedback
284 KB
284 KB View Download