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

Issue 677598 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Element.getBoundingClientRect() returns unexpected values in mobile mode

Reported by abchjs...@gmail.com, Dec 30 2016

Issue description

UserAgent: 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
 
Cc: ranjitkan@chromium.org
Labels: Needs-Feedback
Followed the steps as mentioned above on chrome stable version 55.0.2883.87 and getting the erroor as displayed in screen shot. Kindly check and let us know if we have missed out anything here.

Thanks.!
Error.png
284 KB View Download

Comment 2 by alph@chromium.org, Jan 10 2017

Labels: -Needs-Feedback
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
Indeed e.g. left property of an element changes with device viewport resize.

Cc: dgozman@chromium.org
Components: -Platform>DevTools Platform>DevTools>Mobile
Labels: -OS-Windows OS-All
Owner: allada@chromium.org

Comment 4 by allada@chromium.org, Jan 11 2017

Cc: dsinclair@chromium.org
+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!
Cc: -dsinclair@chromium.org e...@chromium.org
Passing to eae@ as layout TL.

Comment 6 by e...@chromium.org, Jan 11 2017

Status: WontFix (was: Assigned)
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