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

[css-transitions-2] Effect of manipulating a CSSTransition via the Web Animations API on the list of running transitions #3233

Closed
graouts opened this issue Oct 22, 2018 · 3 comments

Comments

@graouts
Copy link
Contributor

graouts commented Oct 22, 2018

The CSS Transitions spec, in the Starting of Transitions section, discusses the notion of a running transition. The content of that list is made clear in the context of resolving styles and dealing with the various transition- properties, but I'm not certain what should happen when a running transition is manipulated via the Web Animations API.

Consider this example:

const target = document.querySelector("div");
target.style.transition = "margin-left 1s"

requestAnimationFrame(() => {
    // This starts a transitions, the element now has a running transition.
    target.style.marginLeft = "200px";
});

setTimeout(() => {
    const transition = target.getAnimations()[0];
    // This will yield a "transitioncancel" event. Is this animation now no longer
    // considered to be a running transition?
    transition.timeline = null;
    setTimeout(() => {
        // This will resume the animation for the last quarter of its duration.
        // Is this animation now a running transition or just some animation
        // outside of the list of running transitions? 
        transition.timeline = document.timeline;
    }, 250);
}, 500);

Essentially, my question boils down to whether an animation is considered a running transition just by virtue of having been created via a CSS transition property and being in a running play state, or is it considered to be a running transition only when created via a CSS transition property and until it enters a play state other than running.

@graouts
Copy link
Contributor Author

graouts commented Oct 22, 2018

@graouts
Copy link
Contributor Author

graouts commented Oct 22, 2018

I think this might be related to issue #2948.

@birtles
Copy link
Contributor

birtles commented Oct 22, 2018

This will be defined in CSS Transitions 2.

(But for what it's worth, I believe it should be the latter and will be defined in terms of the owning element concept such that it is only a running transition when it has an owning element.)

@birtles birtles changed the title [css-transitions-1] Effect of manipulating a CSSTransition via the Web Animations API on the list of running transitions [css-transitions-2] Effect of manipulating a CSSTransition via the Web Animations API on the list of running transitions Oct 22, 2018
@birtles birtles closed this as completed in 0b25667 Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants