<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 - Incorrect window size following window.onresize for WKWebView using Auto Layout"
   href="https://bugs.webkit.org/show_bug.cgi?id=185886">185886</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect window size following window.onresize for WKWebView using Auto Layout
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>Safari 11
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>iOS 11
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

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

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

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jdarcangelo@mozilla.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On iOS, the `window.onresize` event fires in a WKWebView when the device switches orientation. However, if the WKWebView is positioned WITH Auto Layout, `window.innerWidth` and `window.innerHeight` will report incorrect values from within the `window.onresize` event handler. But, if the WKWebView is positioned manually WITHOUT using Auto Layout, `window.innerWidth` and `window.innerHeight` will report correct values in the event handler.

This bug was found in Firefox for iOS when viewing maps.google.com and rotating the device orientation as reported here: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1463058">https://bugzilla.mozilla.org/show_bug.cgi?id=1463058</a>

I've created the following JSBin for testing the result of observing the `window.onresize` event when rotating the device orientation:

<a href="http://output.jsbin.com/regipul">http://output.jsbin.com/regipul</a>

Then, I tested that JSBin in a minimal WKWebView iOS app both WITH and WITHOUT Auto Layout and observed the following:

WKWebView WITH Auto Layout:
1.) Portrait  - 375x603 (initial load)
2.) Landscape - 375x343
3.) Portrait  - 375x343

WKWebView WITHOUT Auto Layout:
1.) Portrait  - 375x603 (initial load)
2.) Landscape - 667x311
3.) Portrait  - 375x603

As you can see, in the WKWebView using Auto Layout, the `innerWidth`/`innerHeight` values remain the same following the first `window.onresize` event. However, this problem is not exhibited when positioning the WKWebView manually without Auto Layout.

This problem is not seen in Mobile Safari. Presumably, it is not using Auto Layout.</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>