title: window.innerWidth is randomly wrong in iOS9 Safari
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;!-- some meta tags here --&gt;
  &lt;meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0"&gt;
  &lt;!-- loading some css, js files here --&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!-- contents here --&gt;
  &lt;script&gt;
      window.addEventListener("load",function(){
          // page setup here
          console.log(window.innerWidth);
      }, false);
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My html is essentially like this.  I noticed a strange problem occurs only in iOS9.2 Safari on my iPhone5c/5s (I don't have any other version, but it has never occurred in Android and PC browsers), that some elements created by JavaScript are not displayed, and it occurs randomly (the probability is approximately one in five reloads).  </p>
  
  <p>Using the Web Inspector I found that width of the elements becomes zero when window.innerWidth returns wrong value, 1280 specifically, even though 320 is the correct value.  I reloaded the page several times and confirmed that the problem occurs because of this random phenomenon.</p>
  
  <p>I guess it is some timing issue of loading the page and reflecting viewport settings and executing JavaScript, somehow.  Is there some iOS bugs that might be related and I should care about?  Is there any workaround?</p>