Skip to content

Fix animation processing ordering and reenable animations/basic-transition.html test #13865

Closed

Description

@bholley

In #12623, we added some hacky machinery that causes us to mutate style on non-dirty nodes during restyle to tick animations. This causes all kinds of trouble for the new incremental restyle architecture, since we're not guaranteed to have mutable style data for non-dirty nodes (the style might be owned by the layout frame).

Emilio thinks the right approach is to mark the node as dirty when processing transitionend. However, that still doesn't cause us to pass the test, because Servo doesn't properly implement the processing model in the spec [1], and fires requestAnimationFrame callbacks before animation events, rather than after.

Emilio is trying to fix the processing model a bit in #13864, but says that more refactoring will need to be done to pass the test. So we decided to disable the test for now to unblock things.

CC @emilio @notriddle

[1] https://html.spec.whatwg.org/#event-loop-processing-model:run-the-animation-frame-callbacks

Activity

  1. emilio commented on Oct 21, 2016

    @emilio
    Member

    Yeah, to clarify, the problem (apart from the processing order) is the following.

    With that fixed, marking nodes as dirty after transitionend works for most cases, except when the node's style is accessed again before the transitionend event is processed, in which case it fails. This is that last kind of failure.

    Multiple things can be done here. First one is making animations synchronized with script and properly marking the node as dirty in update_animation_state. This would be the preferable option IMO.

    The other thing we might do as a workaround is keeping a list of UnsafeNodes to dirty the next reflow, and filling it with the expired nodes in update_animation_state, but that feels like a bit of a hack.

  2. added
    A-content/css
    A-content/script
    I-wrong
    on Oct 21, 2016
  3. added a commit that references this issue on Oct 21, 2016
  4. notriddle commented on Oct 21, 2016

    @notriddle
    Contributor

    Multiple things can be done here. First one is making animations synchronized with script and properly marking the node as dirty in update_animation_state. This would be the preferable option IMO.

    If we have to go with this solution, could we at least have this predicated on a Big Global Switch that turns off the synchronization if there aren't any outstanding requestAnimationFrame tasks? Otherwise, we end up blocking animations on GC and our smoothness tanks.

  5. pcwalton commented on Dec 10, 2016

    @pcwalton
    Contributor

    Please don't disable OMT animations because of some spec language. The spec shouldn't be forbidding them.

  6. emilio commented on Dec 10, 2016

    @emilio
    Member

    This is not about completely disable OMT animations, but about properly synchronize the computed values back to the element.

    Mainly, the current animations code relied in the DOM being fully restyled (which was no longer the case as restyling optimizations started kicking in), since it is in the restyling code where we checked for expired animations.

    #12623 worked around that fixing some of the most common but not all the cases.

    With "fixing animation processing ordering" I explicitly intend to properly trigger transition events, not disabling OMT transitions completely.

  7. nox commented on Oct 5, 2017

    @nox
    Contributor

    Did this change with the Stylo effort?

  8. self-assigned this
    on Apr 27, 2020
  9. added 2 commits that reference this issue on May 4, 2020
    0fea1c9
    04d8e27
  10. added a commit that references this issue on May 4, 2020
    101c6e7
  11. added a commit that references this issue on May 4, 2020
    8131ee3
  12. added a commit that references this issue on May 4, 2020
    5875d05
  13. added 2 commits that reference this issue on May 5, 2020
    f7e8d41
    b585ce5
  14. added 5 commits that reference this issue on May 5, 2020
    bf50241
    78a4412
    47ba832
    473e368
    b290ad9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-content/cssA-content/scriptI-wrong

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions