WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
185886
Incorrect window size following window.onresize for WKWebView using Auto Layout
https://bugs.webkit.org/show_bug.cgi?id=185886
Summary
Incorrect window size following window.onresize for WKWebView using Auto Layout
Justin D'Arcangelo
Reported
2018-05-22 14:12:10 PDT
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:
https://bugzilla.mozilla.org/show_bug.cgi?id=1463058
I've created the following JSBin for testing the result of observing the `window.onresize` event when rotating the device orientation:
http://output.jsbin.com/regipul
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Lucas Forschler
Comment 1
2019-02-06 09:18:58 PST
Mass move bugs into the DOM component.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug