title: clientWidth and clientHeight delayed on Android default browser?
body: <p>I am using jqtouch.js (with zepto.js) and testing the <i>onorientationchange</i> event:</p>
  
  <pre><code>http://www.ebi.ac.uk/~mp/test_orientation.html
  
  &lt;!DOCTYPE html&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;!-- Local jqTouch --&gt;
      &lt;link rel="stylesheet" href="lib/jqtouch-1.0-b4-rc/themes/css/apple.css" title="jQTouch"&gt;
      &lt;!-- &lt;style type="text/css" media="screen"&gt;@import "lib/jqtouch-1.0-b4-rc/themes/css/jqtouch.css";&lt;/style&gt; --&gt;
      &lt;script src="lib/jqtouch-1.0-b4-rc/src/lib/zepto.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
      &lt;script src="lib/jqtouch-1.0-b4-rc/src/jqtouch.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" charset="utf-8"&gt;
        var jQT = new $.jQTouch({});
      &lt;/script&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Hello World&lt;/h1&gt;
      &lt;script&gt;
         window.onorientationchange = function() {
           var w = document.documentElement.clientWidth;
           var h = document.documentElement.clientHeight;
           alert("WIDTH: " + w + " -- HEIGHT: " + h);
         }
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Opening this page with the default Android browser I get the clientWidth and clientHeight numbers reversed (when changing the orientation to landscape, I get more height than width, and vice-versa).
  If I insert a short delay:</p>
  
  <pre><code>http://www.ebi.ac.uk/~mp/test_orientation_delay.html
  
  &lt;script&gt;
     window.onorientationchange = function() {
       setTimeout(function() {
         var w = document.documentElement.clientWidth;
         var h = document.documentElement.clientHeight;
         alert("WIDTH: " + w + " -- HEIGHT: " + h);
       }, 500);
     }
  &lt;/script&gt;
  </code></pre>
  
  <p>The clientWidth and clientHeight are properly retrieved.
  This doesn't happen with Safari (iOS5) or Chrome (they don't need the short delay to display the correct numbers).
  Is there an alternative way to safely retrieve these numbers consistently (without having to introduce an arbitrary delay that can be enough or not)?</p>
  
  <p>M;</p>