Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] CSS transform transitions become janky after snapshotting other UIViews #8394

Merged

Conversation

graouts
Copy link
Contributor

@graouts graouts commented Jan 9, 2023

46c1b78

[iOS] CSS transform transitions become janky after snapshotting other UIViews
https://bugs.webkit.org/show_bug.cgi?id=228333
rdar://81165591

Reviewed by Dean Jackson.

In WebKit clients that use the UIView snapshotting API, accelerated animations, which
are ran using Core Animation, will not run anymore. This happens because we use absolute
start times for our CAAnimation objects, and this does not play well with the UIView
snapshotting machinery.

Using the -[CALayer setInheritsTiming:(BOOL)] private API addresses this issue, so we call
it with NO any time we add a CAAnimation to a remote layer.

* Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::addAnimationToLayer):

Canonical link: https://commits.webkit.org/258781@main

ee8e032

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe ❌ πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug ❌ πŸ›  gtk   πŸ›  wincairo
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac ❌ πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios   πŸ§ͺ mac-wk1 ❌ πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch   πŸ§ͺ mac-wk2-stress
βœ… πŸ›  watch-sim
βœ… πŸ›  πŸ§ͺ unsafe-merge

@graouts graouts requested a review from cdumez as a code owner January 9, 2023 13:01
@graouts graouts self-assigned this Jan 9, 2023
@graouts graouts added the Animations Bugs related to CSS + SVG animations and transitions label Jan 9, 2023
@graouts graouts requested a review from smfr January 9, 2023 13:03
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 9, 2023
Copy link
Contributor

@grorg grorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we test this?

@graouts graouts force-pushed the chrome-animation-snapshotting branch from 8e8d154 to ee8e032 Compare January 11, 2023 11:29
@graouts graouts added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed merging-blocked Applied to prevent a change from being merged labels Jan 11, 2023
@graouts
Copy link
Contributor Author

graouts commented Jan 11, 2023

Can we test this?

I think in theory it is possible exercising the -[UIView snapshotAfterScreenUpdates:] or -[UIView resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:] in an API test. However, I haven't been able to find a solid way to reproduce the issue using those API calls. The reports we've had of this issue highlight that the issue varies based on the view hierarchy complexity and the number of calls made to such methods.

… UIViews

https://bugs.webkit.org/show_bug.cgi?id=228333
rdar://81165591

Reviewed by Dean Jackson.

In WebKit clients that use the UIView snapshotting API, accelerated animations, which
are ran using Core Animation, will not run anymore. This happens because we use absolute
start times for our CAAnimation objects, and this does not play well with the UIView
snapshotting machinery.

Using the -[CALayer setInheritsTiming:(BOOL)] private API addresses this issue, so we call
it with NO any time we add a CAAnimation to a remote layer.

* Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::addAnimationToLayer):

Canonical link: https://commits.webkit.org/258781@main
@webkit-commit-queue
Copy link
Collaborator

Committed 258781@main (46c1b78): https://commits.webkit.org/258781@main

Reviewed commits have been landed. Closing PR #8394 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 46c1b78 into WebKit:main Jan 11, 2023
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jan 11, 2023
@graouts graouts deleted the chrome-animation-snapshotting branch January 11, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Animations Bugs related to CSS + SVG animations and transitions
Projects
None yet
5 participants