WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
255852
[css-values] Viewport units are often wrong in IABs using WKWebView
https://bugs.webkit.org/show_bug.cgi?id=255852
Summary
[css-values] Viewport units are often wrong in IABs using WKWebView
Johannes Odland
Reported
2023-04-23 23:31:04 PDT
Created
attachment 466060
[details]
Viewport unit test in Facebook IAB (small viewport) A common issue in In App Browsers (IABs) is that the viewport units is incorrectly sized. One issue seems to be caused by SFSafariViewController having setting the wrong sizes, this is reported here:
https://bugs.webkit.org/show_bug.cgi?id=255708
In apps that use WKWebView we have to rely on the app developer setting the sizes correctly. The sizes can be set using `setMinimumViewportInset(_:maximumViewportInset:)`:
https://developer.apple.com/documentation/webkit/wkwebview/3974127-setminimumviewportinset
Unfortunately, many apps doesn't set the viewport insets for their IABs. One example is the Facebook app, where 100vh, 100svh, 100lvh and 100dvh are all updated to be the same height as the current viewport heigh. (They all act as 100dvh). As these apps have a large user base, these IABs are a major hurdle in adapting the new viewport units. It's necessary to build fallbacks for these IABs specifically. As 100vh is dynamically sized, they cause reflow when the user is changing scrolling directions. Could setting minimum and maximum viewport sizes be enforced?
Attachments
Viewport unit test in Facebook IAB (small viewport)
(457.68 KB, image/png)
2023-04-23 23:31 PDT
,
Johannes Odland
no flags
Details
Viewport unit test in Facebook IAB (large viewport)
(482.42 KB, image/png)
2023-04-23 23:31 PDT
,
Johannes Odland
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Johannes Odland
Comment 1
2023-04-23 23:31:35 PDT
Created
attachment 466061
[details]
Viewport unit test in Facebook IAB (large viewport)
Johannes Odland
Comment 2
2023-04-23 23:38:27 PDT
Another example of an app where the viewport units end up wrong is the Firefox app:
https://github.com/mozilla-mobile/firefox-ios/issues/11574
https://github.com/mozilla-mobile/firefox-ios/issues/8819
Radar WebKit Bug Importer
Comment 3
2023-04-25 19:06:04 PDT
<
rdar://problem/108536643
>
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