Skip to content

Commit

Permalink
[view-transitions] Async animation of snapshot position via transform…
Browse files Browse the repository at this point in the history
… looks jumpy with sync animation of size

https://bugs.webkit.org/show_bug.cgi?id=274437
<rdar://128441578>

Reviewed by Antoine Quint.

The default pseudo element structure results in an asynchronous animation of the snapshot position via
transform, and a sync animation of the width/height.

If there's any slowness at all on the main thread, then this looks super jumpy.

* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computeHasSizeDependentTransform):

Canonical link: https://commits.webkit.org/279093@main
  • Loading branch information
mattwoodrow authored and nt1m committed May 22, 2024
1 parent 3a59245 commit de30955
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/WebCore/animation/KeyframeEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,14 @@ void KeyframeEffect::computeHasSizeDependentTransform()
{
m_animatesSizeAndSizeDependentTransform = (m_blendingKeyframes.hasWidthDependentTransform() && m_blendingKeyframes.containsProperty(CSSPropertyWidth))
|| (m_blendingKeyframes.hasHeightDependentTransform() && m_blendingKeyframes.containsProperty(CSSPropertyHeight));

// If this is a ::view-transition-group pseudo element with the UA-generated transform
// and width/height animations, then prevent the transform component from being applied
// asynchronously.
if (auto target = targetStyleable()) {
if (target->pseudoElementIdentifier && target->pseudoElementIdentifier->pseudoId == PseudoId::ViewTransitionGroup)
m_animatesSizeAndSizeDependentTransform |= ((m_blendingKeyframes.containsProperty(CSSPropertyWidth) || m_blendingKeyframes.containsProperty(CSSPropertyHeight)) && m_blendingKeyframes.containsProperty(CSSPropertyTransform));
}
}

void KeyframeEffect::effectStackNoLongerPreventsAcceleration()
Expand Down

0 comments on commit de30955

Please sign in to comment.