Issue metadata
Sign in to add a comment
|
Sometimes add a div into window.document.body, although dev tools can show it's width x height, clientWidth, clientHeight are 0
Reported by
steelloc...@gmail.com,
Feb 5 2018
|
||||||||||||||||||||
Issue description
Chrome Version: <From about:version: Google Chrome 66.0.3339.0>
Chrome OS Version: <From about:version: Windows 7 Professional SP1>
<b>Chrome OS Platform: <Make/model of computer running Chrome OS></b>
<b>Network info: <network, encryption type, router model (if known)></b>
Please specify Cr-* of the system to which this bug/feature applies (add
the label below).
Use below code to get system DPI, the width & height of the new created tmpNode sometimes can get correct value(tmpNode.offsetWidth & tmpNode.offsetHeight are 0 however in developer tools, it shows 96 x 96) but sometimes cannot. Same logic always work on Chrome 63&64
var tmpNode = document.createElement("DIV");
tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
document.body.appendChild(tmpNode);
arrDPI[0] = parseInt(tmpNode.offsetWidth);
arrDPI[1] = parseInt(tmpNode.offsetHeight);
tmpNode.parentNode.removeChild(tmpNode);
How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)
sometimes
What is the impact to the user, and is there a workaround? If so, what is
it?
Page cannot be rendered, because many dependent code
Please provide any additional information below. Attach a screen shot or
log if possible.
See screenshot
For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.
,
Feb 5 2018
,
Feb 5 2018
,
Feb 6 2018
tmpNode.getBoundingClientRect also returns all 0 after document.body.appendChild(tmpNode);
,
Feb 8 2018
Unable to reproduce (see attached test case). At what stage of the document lifecycle are you running this script? Is it in the main document or an iframe? Is it offscreen?
,
Feb 22 2018
Closing due to lack of feedback. Comment to reopen.
,
Feb 28 2018
The NextAction date has arrived: 2018-02-28 |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by steelloc...@gmail.com
, Feb 5 2018