[Webkit-unassigned] [Bug 192644] New: WKWebView returns invalid window screen width and height in classic iPad apps
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Dec 12 16:14:36 PST 2018
https://bugs.webkit.org/show_bug.cgi?id=192644
Bug ID: 192644
Summary: WKWebView returns invalid window screen width and
height in classic iPad apps
Product: WebKit
Version: WebKit Local Build
Hardware: iPhone / iPad
OS: iOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: WebCore JavaScript
Assignee: webkit-unassigned at lists.webkit.org
Reporter: andrew at planetaryscale.com
Created attachment 357186
--> https://bugs.webkit.org/attachment.cgi?id=357186&action=review
Sample iPad app that runs in classic mode
Overview:
WKWebView returns incorrect values for window.screen.width and window.screen.height in JavaScript when inside iPad apps running in a scaled/non-native mode ("classic"). This is a regression from UIWebView behavior.
Steps to Reproduce:
* Open attached sample app on a 10.5", 11", or 12.9" iPad or iPad simulator.
* Note difference between values in the top WKWebView versus the bottom UIWebView.
Actual Results:
In the WKWebView window.screen.width is 320 and window.screen.height is 480.
In the UIWebView window.screen.width is 768 and window.screen.height is 1024.
Expected Results:
The screen size should report as 768x1024, which is the screen's reference bounds.
Configuration:
Found on iOS 12.1 both in Simulator and on device, although haven't regressed it. Xcode 10.1 (10B61).
Additional Notes:
320x480 is the default scaling resolution for iPhone-only apps whether on iPhones or iPads. 768x1024 is the scaling resolution of iPad apps on iPads, as that was the resolution of the first iPad.
This looks like it was a deliberate change in https://bugs.webkit.org/show_bug.cgi?id=150763, but I don't have any insight as to why this change was made.
This breaks some existing functionality when migrating from UIWebView to WKWebView in scaled iPad apps. Workaround is to support the native resolution of each iPad, but in legacy iPad apps that process may take longer than moving to WKWebView.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20181213/c7723449/attachment.html>
More information about the webkit-unassigned
mailing list