I experienced a similar problem and doing width:100%;
solved it for me. I came to this solution after trying an answer in this question and realizing that the very nature of an <iframe>
will make these javascript measurement tools inaccurate without using some complex function. Doing 100% is a simple way to take care of it in an iframe. I don't know about your issue since I'm not sure of what HTML elements you are manipulating.