title: Problem with height adjustment of an <iframe> : scrollHeight returns 0
body: <p>I'm working on a mailbox, i get a mail from a HTTP request and try to display it in a iframe, because it can be a plain text or HTML email.</p>
  
  <p>There is no problem to display the content but i'm not able to adjust the height to that content. I always get a 0 from <code>contentWindow.document.body.scrollHeight</code>.</p>
  
  <p>I tried to see if it comes from the fact that the mail could be in plain text, but it's the same thing for an html email.</p>
  
  <p>I know that the content is displayed because i manually edited the page to change the height and show the content. The only problem right now is the auto adjustment of this height.</p>
  
  <p>By the way, the <code>iframe.contentWindow.document.body</code> is an <code>[Object HTMLBodyElement]</code></p>
  
  <pre><code>$scope.iFrameDisplayMail = function (Mail_content) {
  
      var iframe = document.getElementById('mail-display');
      if (Mail_content.html != null) {
        iframe.contentWindow.document.write(Mail_content.html);
      } else {
        iframe.contentWindow.document.write(Mail_content.plain);
      }
      iframe.style.width = 'auto';
      alert(iframe.contentWindow.document.body.scrollHeight);
      iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
      iframe.contentWindow.document.close();  
  }
  </code></pre>
  
  <p>There is no error in the console about this.</p>