Open Bug 1463058 Opened 2 years ago Updated 1 year ago
.google .com not resizing properly after switching orientation from landscape to portrait
v12.0 (10757) iPhone 8 Plus (11.3) 1. Put the device in landscape. 2. Visit maps.google.com. 3. Switch to portrait. Result: The page is not properly resized (see the screenshot). This is working fine in Chrome.
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 Starting in portrait orientation, then rotating to landscape and back to portrait, I've observed the following results: Firefox: 1.) Portrait - 375x545 2.) Landscape - 375x319 3.) Portrait - 375x319 Safari: 1.) Portrait - 375x553 2.) Landscape - 667x375 3.) Portrait - 375x553 Chrome: 1.) Portrait - 375x591 2.) Landscape - 667x299 3.) Portrait - 375x591 Minimal WKWebView App (WITH Autolayout): 1.) Portrait - 375x603 2.) Landscape - 375x343 3.) Portrait - 375x343 Minimal WKWebView App (WITHOUT Autolayout): 1.) Portrait - 375x603 2.) Landscape - 667x311 3.) Portrait - 375x603 As seen in these results, both Firefox and the minimal WKWebView app using Autolayout are reporting incorrect window sizes after the `resize` event fires on the page. By altering the minimal WKWebView app to NOT use Autolayout, the problem goes away. We also believe that both Safari and Chrome are not using Autolayout for the WKWebView which would also support this notion that Autolayout is breaking the `resize` event in WKWebView. The solution here is to stop using Autolayout for the WKWebView, but this will require a fair bit of refactoring around our scrolling code. Re-assigning to Farhan as he is far more knowledgeable than myself in UIKit and I immediately regret opening this can of worms :-)
Assignee: jdarcangelo → fpatel
I've filed a bug with WebKit as well: https://bugs.webkit.org/show_bug.cgi?id=185886
You need to log in before you can comment on or make changes to this bug.