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

Issue 599511 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

document.body.clientHeight reports incorrect height in emulation mode

Reported by w...@distortedlogic.co.uk, Mar 31 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
1. Opens dev tools on www.google.com
2. Emulate device with a bigger emulation area than the scaled emulated window 
3. run 'document.body.clientHeight' in the console

What is the expected behavior?
'document.body.clientHeight' should match the emulated height at all times

What went wrong?
With a bigger emulation area than the scaled emulated window document.body.clientHeight' is one less than the emulated height. 

Did this work before? Yes Before the new dev tool emulation windwo

Chrome version: 49.0.2623.87  Channel: stable
OS Version: OS X 10.11.4
Flash Version: Shockwave Flash 21.0 r0

A smaller emulated area than the scaled emulated window 'document.body.clientHeight' reports the correct height
 
1079.png
515 KB View Download
1080.png
521 KB View Download
Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
Dmitry, please take a look.
Labels: Needs-Feedback
Interesting... Do you have a zoom set in DevTools (try Cmd+0 to reset it)?
Yes I do, but that doesn't seem to be the problem it occurs after I reset it.

Looking closer at it, it seems to happen when you switch between custom sizes.
I think this is a rounding issue due to 49% zoom. That's definitely a bug, but meanwhile try 50% zoom as a workaround.
Cc: kavvaru@chromium.org dgozman@chromium.org
 Issue 600731  has been merged into this issue.
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/128414e543648a361e5791cde27e11f6d399d19a

commit 128414e543648a361e5791cde27e11f6d399d19a
Author: dgozman <dgozman@chromium.org>
Date: Mon Jun 20 20:26:08 2016

[DevTools] Try to adjust device mode scale to avoid rounding errors.

If not possible, fallback to faithful emulation with correct size.

BUG= 599511 

Review-Url: https://codereview.chromium.org/2020083004
Cr-Commit-Position: refs/heads/master@{#400764}

[modify] https://crrev.com/128414e543648a361e5791cde27e11f6d399d19a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js

Labels: -Needs-Feedback
Status: Fixed (was: Assigned)
Should be fixed in M53.
Cc: msrchandra@chromium.org
 Issue 640732  has been merged into this issue.

Sign in to add a comment