Bug 186996 - Element.animate() animations are stopped permanently if the browser window is not visible
Summary: Element.animate() animations are stopped permanently if the browser window is...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-25 01:57 PDT by kari.pihkala
Modified: 2018-09-10 09:24 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kari.pihkala 2018-06-25 01:57:41 PDT
If the browser window is made hidden and then visible, animations created with Web Animation API are not resumed.

Example: https://codepen.io/anon/pen/eKjgyo

Steps to reproduce:

1. Set up an infinite animation like this:

  var animation = document.getElementById("box").animate([
    { transform: 'rotate(0deg)', offset: 0 },
    { transform: 'rotate(270deg)', offset: .5 },
    { transform: 'rotate(0deg)', offset: 1 }
  ], {
    duration: 3000,
    iterations: Infinity,
    easing: 'linear',
    delay: 0
  });

2. Ensure that the animation rotates the element.
3. Hide the browser window by pressing the orange '-' minimize button or by pressing Command-M.
4. Bring the window visible by clicking it in the dock.
5. The element should still be rotating.

Expected Result:
After bringing the window visible in step 4, the element should still be rotating.

Actual Results:
The element is no longer rotating.

It seems that simply dragging another window on top of the browser window will have the same effect as minimizing. I tested also CSS animations, and they are resumed correctly. I would expect Web Animations to behave the same way.

Build: Release 59 (Safari 12.0, WebKit 13606.1.21)
Comment 1 Radar WebKit Bug Importer 2018-06-25 08:29:33 PDT
<rdar://problem/41424983>
Comment 2 Antoine Quint 2018-09-10 08:20:22 PDT
Thanks for filing this bug. This does not reproduce for me in the most recent Safari Technology Preview (64 as of this writing). Can you check that this is indeed fixed?
Comment 3 kari.pihkala 2018-09-10 09:24:10 PDT
I tested it again in Safari Technology Preview 64 and it works now.

Thank you for your hard work implementing WAAPI. :)