Bug 228333 - [iOS] CSS transform transitions become janky after snapshotting other UIViews
Summary: [iOS] CSS transform transitions become janky after snapshotting other UIViews
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-27 10:38 PDT by Ali Juma
Modified: 2021-07-29 10:18 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2021-07-27 10:38:49 PDT
Snapshotting UIViews with a forced screen update (i.e., calling -[UIView snapshotAfterScreenUpdates:YES]) sufficiently many times somehow breaks all CSS transform transitions in all WKWebViews embedded in the same app, until the app is-relaunched. In the broken state, transitions are either very janky (low frame rate) or just jump directly to their end state with no intermediate frames.

In an app with a complex view hierarchy (e.g., Chrome for iOS), even a couple calls to -[UIView snapshotAfterScreenUpdates:YES] are enough to get into this broken state. In a simple test app, a few hundred calls are needed to make the jankiness obvious. The UIView being snapshotted is independent of WKWebView (neither contained in WKWebView nor an ancestor). The same bug happens when using -[UIView resizableSnapshotViewFromRect:rect afterScreenUpdates:YES withCapInsets:UIEdgeInsetsZero]. In both cases, changing the 'afterScreenUpdates' argument to NO prevents the bug from happening.

This doesn't seem to affect CSS keyframe animations, just CSS transitions.

I've attached a test app to FB9409883.
Comment 1 Simon Fraser (smfr) 2021-07-27 10:41:57 PDT
<rdar://81165761>
Comment 2 Simon Fraser (smfr) 2021-07-29 10:18:48 PDT
This appears to be a bug in UIKit. Tracked by the above radar.