<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Miscalculated Viewport Width and Height (vw/vh) inside iframes"
   href="https://bugs.webkit.org/show_bug.cgi?id=148584">148584</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Miscalculated Viewport Width and Height (vw/vh) inside iframes
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>iOS
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>HTML DOM
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marvin&#64;marvindanig.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

I've the nightly build on my iPad and an older version of iOS too, so I'm assuming this bug has been there for long (Thus the risk of repeating the issue, but I didn't find it). 

Seems like `vw` and `vh` units are miscalculated inside of an iframe each time you change the orientation of the device. Happens both on iPhone &amp; iPad.  

Here's the test case and it's &lt;a href=&quot;<a href="https://bubbl.in/book/official-handbook-by-marvin-danig/4">https://bubbl.in/book/official-handbook-by-marvin-danig/4</a>&quot;&gt;live demo&lt;/a&gt;:

HTML: 

Inside 
&lt;iframe&gt;

  &lt;head&gt; 
    // style here.
  &lt;/head&gt;

  &lt;body&gt;
    &lt;div class=&quot;leaf&quot;&gt;
      &lt;div class=&quot;inner&quot;&gt;
        &lt;blockquote&gt;
          “To teach how to live without certainty, and yet without being paralyzed by hesitation, is perhaps the chief thing that philosophy, in our age, can still do for those who study it.”

          &lt;div class=&quot;right&quot;&gt;
            &lt;p&gt;- Bertrand Russell, &lt;/p&gt;
            &lt;cite&gt;
              &lt;a href=&quot;<a href="https://archive.org/stream/westernphilosoph035502mbp/westernphilosoph035502mbp_djvu.txt">https://archive.org/stream/westernphilosoph035502mbp/westernphilosoph035502mbp_djvu.txt</a>&quot;&gt;A History of Western Philosophy&lt;/a&gt;
          &lt;/cite&gt;
          &lt;/div&gt;

        &lt;/blockquote&gt;


      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/iframe&gt;

CSS:

&#64;import url(//fonts.googleapis.com/css?family=EB+Garamond);
body {
  margin: 0 0;
  overflow: hidden;
  color: #fff;
  font-size: 3.5vw;
  font-family: 'EB Garamond', serif;
  background-image: url(//raw.githubusercontent.com/bubblin/Official-Handbook/master/images/bertrand-page-5.jpg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  height: 100vh;
  width: 100vw;
}

.inner {
  width: 70vw;
  float: right;
  padding: 3vw;
}

cite {
  font-style: oblique;
  font-size: 3vw;
}

.right {
  float: right;
}

a {
  color: #00ffaa;
  outline: 0 none;
  text-decoration: none;
  text-rendering: optimizelegibility;
}

a:focus,
a:active,
a:hover {
  outline: 0 none;
  text-shadow: 0 0 2px #0cf;
}

a:active {
  padding-top: 2px;
}

Now if you change the orientation of the screen it appears that iOS continues to calculate the vw/vh even after rendering the oversized context. Or it calculates the viewport width and height before the iframe itself is given its final reoriented size.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>