WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
Bug 210009
window.innerHeight is broken in WKWebView with viewport-fit=cover
https://bugs.webkit.org/show_bug.cgi?id=210009
Summary
window.innerHeight is broken in WKWebView with viewport-fit=cover
evangun2001
Reported
2020-04-04 13:01:53 PDT
When `viewport-fit=cover` is used in Cordova with the WKWebView plugin, `window.innerHeight` reports a wrong value. Instead of reporting the proper window height, it reports the window height MINUS the safe areas insets. Even a minimalistic snippet will demonstrate the issue:
https://gist.github.com/louisameline/d5ae03b07db8185051346b8da55a2704
The issue happens only if the content of the page is smaller in height than the window height. Exemple: if my iPhone window is 812px high, and the "natural height" of my page is 500, `window.innerHeight` returns 734 (= 812 - 44 top safe area inset - 34 bottom safe area inset). If my page content is 750px high, `window.innerHeight` returns 750, and if my page content overflows the window, `window.innerHeight` returns 812. Additional notes: - The `window.innerHeight` value is not longer false after a rotation of the screen - The bug does not happen in Chrome, Safari, UIWebView, Ionic WKWebView, Capacitor - It was previously brought to the Cordova team, who suggested to report it here:
https://github.com/apache/cordova-plugin-wkwebview-engine/issues/108
Thanks
Attachments
Add attachment
proposed patch, testcase, etc.
evangun2001
Comment 1
2020-04-04 13:05:30 PDT
Tested on iPhone XS, iOS 13.4, Xcode 11.4, cordova-ios 5.1.1, cordova-plugin-wkwebview-engine 1.2.1
Radar WebKit Bug Importer
Comment 2
2020-04-06 22:55:17 PDT
<
rdar://problem/61378008
>
ik
Comment 3
2022-03-16 08:39:44 PDT
This also affects standalone web apps, see
https://bugs.webkit.org/show_bug.cgi?id=237961
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