Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Mac] Animation stutters when making a video full screen in Safari
https://bugs.webkit.org/show_bug.cgi?id=257922
rdar://109325226

Reviewed by Simon Fraser.

In some circumstances, there may be a significant delay between when fullscreen is initiated
through -[WKFullscreenWindowController beganEnterFullScreenWithInitialFrame], and when the
animation to enter fullscreen begins
via -window:startCustomAnimationToEnterFullScreenWithDuration:. In this case, the intent was to put
in place the animation's transformations, but with a speed of 0 (so that the animation would not
progress). However, the speed parameter to the animation methods was ignored, and the animation
would use the default speed of 1. When the delay between the two functions mentioned above occurrs,
it has the effect of making it look like the animation starts early and then "restarts".

Actually obey the speed parameter in zoomAnimation() and maskAnimation().

* Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:
(zoomAnimation):
(maskAnimation):

Canonical link: https://commits.webkit.org/265051@main
  • Loading branch information
jernoble committed Jun 10, 2023
1 parent 6c63375 commit 7a59a6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm
Expand Up @@ -747,6 +747,7 @@ - (void)_replaceView:(NSView *)view with:(NSView *)otherView
scaleAnimation.toValue = scaleValue;

scaleAnimation.duration = duration;
scaleAnimation.speed = speed;
scaleAnimation.removedOnCompletion = NO;
scaleAnimation.fillMode = kCAFillModeBoth;
scaleAnimation.timingFunction = timingFunctionForDuration(duration);
Expand Down Expand Up @@ -783,6 +784,7 @@ - (void)_replaceView:(NSView *)view with:(NSView *)otherView
CAAnimationGroup *animation = [CAAnimationGroup animation];
animation.animations = @[boundsAnimation, positionAnimation];
animation.duration = duration;
animation.speed = speed;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeBoth;
animation.timingFunction = timingFunctionForDuration(duration);
Expand Down

0 comments on commit 7a59a6a

Please sign in to comment.