[webkit-changes] [WebKit/WebKit] b59d14: [iOS] Rakuten cellular data activation portal is s...
Wenson Hsieh
noreply at github.com
Fri Mar 31 16:25:27 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b59d14452d4ba35b25178124996ce560ea32d139
https://github.com/WebKit/WebKit/commit/b59d14452d4ba35b25178124996ce560ea32d139
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2023-03-31 (Fri, 31 Mar 2023)
Changed paths:
M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
Log Message:
-----------
[iOS] Rakuten cellular data activation portal is sometimes clipped when presented in a web sheet
https://bugs.webkit.org/show_bug.cgi?id=254846
rdar://107301827
Reviewed by Chris Dumez.
When activating a Rakuten cellular plan on Apple Watch via the Watch app on iOS 16.4, the web view
can end up in a state where both `vw` and `vh` units are always 0. This causes main, scrollable
container element with `height: 100vh;` on the page to become much, much shorter than intended,
which makes interacting with the activation portal difficult.
Some more important context: in the Watch app, the web view starts out at size `(0, 0)`, and is
resized to fill the entire window only after the first navigation is complete. Rakuten's portal
redirects cross-origin from a landing page, such that this size adjustment races against the second
cross-origin navigation (which initiates a process swap).
While the immediate cause of this is still unknown, the root cause is that during a process swap
(in this particular case, from <login.account.rakuten.com> to <entitlement.devicem.rm-n.jp>), it's
possible for UIKit to call `-setFrame:` with the first non-empty frame after the new web process has
been launched and `WebPageCreationParameters` are created, but before the process swap actually
finishes. This causes:
1. A viewport size of `(0, 0)` to be sent to the newly created page via `WebPageCreationParameters`.
2. The newly updated, non-zero viewport size to be sent to the *old* page, via an IPC message.
As such, the new webpage is stuck in a state where it thinks the viewport size is still `(0, 0)`. To
fix this, we simply propagate the new viewport layout size to a provisional page upon process swap.
Test: ProcessSwap.ChangeViewSizeDuringNavigationActionPolicyDecision
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Canonical link: https://commits.webkit.org/262453@main
More information about the webkit-changes
mailing list