Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 64ea9d3d29ee05ce871c26618b8d340a5a578d28
      
https://github.com/WebKit/WebKit/commit/64ea9d3d29ee05ce871c26618b8d340a5a578d28
  Author: Antoine Quint <[email protected]>
  Date:   2024-03-20 (Wed, 20 Mar 2024)

  Changed paths:
    M Source/WebCore/animation/DocumentTimeline.cpp
    M Source/WebCore/animation/DocumentTimeline.h
    M Source/WebCore/animation/WebAnimation.h
    M Source/WebCore/animation/WebAnimationTypes.h
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/Styleable.cpp
    M Source/WebCore/style/Styleable.h

  Log Message:
  -----------
  [web-animations] pause animation scheduling while style-originated animations 
are being updated
https://bugs.webkit.org/show_bug.cgi?id=271311

Reviewed by Dean Jackson.

When we will be adding animation support for the `display` property (see bug 
267762) we will
need to resolve animations even when the underlying style has `display: none` 
to see whether
animations yield a different value. In that process, we may create 
style-originated animations
that will ultimately be canceled once we're certain `display: none` is still 
set. As it stands,
the creation of a style-originated animation will immediately lead to animation 
scheduling and
possibly be observable through Web content by the dispatch of animation events.

As such, in preparation for supporting the animation of the `display` property, 
we now pause
animation scheduling while we consider new style-originated animations. We now 
store new animations
that we create in a list as we start the 
`Style::TreeResolver::createAnimatedElementUpdate()`
process and once it completes, provided that list is not empty, we notify the 
`DocumentTimeline`
to schedule animation resolution in a single operation.

The purpose of using a list rather than just a boolean flag to signal 
style-originated animation
creation is that, as mentioned above, we will need to silently cancel those 
newly created animations
should the animated style have `display: none`.

* Source/WebCore/animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animationTimingDidChange):
(WebCore::DocumentTimeline::styleOriginatedAnimationsWereCreated):
* Source/WebCore/animation/DocumentTimeline.h:
* Source/WebCore/animation/WebAnimation.h:
(WebCore::WebAnimation::isEffectInvalidationSuspended const):
(WebCore::WebAnimation::isEffectInvalidationSuspended): Deleted.
* Source/WebCore/animation/WebAnimationTypes.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* Source/WebCore/style/Styleable.cpp:
(WebCore::Styleable::updateCSSAnimations const):
(WebCore::updateCSSTransitionsForStyleableAndProperty):
(WebCore::Styleable::updateCSSTransitions const):
* Source/WebCore/style/Styleable.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to