Closed Bug 1901641 Opened 1 year ago Closed 1 year ago

Incorrect start time when replacing a transition on the compositor if the main thread is busy

Categories

(Core :: CSS Transitions and Animations, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1626165

People

(Reporter: boris, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

When writing this reftest, I noticed we didn't send the correct start time to the compositor, so we skip the delay phase (because we compute the incorrect elapsedDuration) after replacing the transition

<!DOCTYPE html>
<html class="reftest-wait reftest-no-flush">
<style>
#target {
  width: 100px;
  height: 100px;
  background: green;
  transition: transform 100s 1s steps(1, start);
}
</style>
<body>
  <div id='target'></div>
</body>
<script>
document.addEventListener('MozReftestInvalidate', () => {
  // The first transition: 0px -> 100px.
  target.style.transform = 'translateX(100px)';

  target.addEventListener('transitionstart', () => {
    const startTime = performance.now();
    while (performance.now() - startTime < 1200);

    target.addEventListener('transitionrun', () => {
      document.documentElement.classList.remove('reftest-wait');
    }, { once: true });

    // The second transition: 100px -> 200px.
    target.style.transform = 'translateX(200px)';
  }, { once: true });
});
</script>
</html>
Attached file Bug 1901641 - Reftest. (obsolete) —

We did pass this test few years ago, so this may be another regression I think.

Blocks: 1626165
Blocks: compositor-animations
No longer blocks: 1626165

Basically we align the start time with mPendingReadyTime. So when we send the transition info to the compositor, the animation has run for a while if the main thread is busy, and so the "start time"/"ready time" is behind the current time a little bit (and it is noticeable). Therefore, this may cause the transition jump a little bit, even if we recompute the start value or set start value by the last value on the compositor.

I guess the gap between ready time and real start time on the compositor becomes huge since we removed the PendingAnimationTracker (especially for busy main thread), and so we may still need more tweak on it. However, I have no idea for now.

We'd like to fix this together with Bug 1626165.

Status: NEW → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1626165
Resolution: --- → DUPLICATE
Attachment #9406527 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: