<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>186996</bug_id>
          
          <creation_ts>2018-06-25 01:57:41 -0700</creation_ts>
          <short_desc>Element.animate() animations are stopped permanently if the browser window is not visible</short_desc>
          <delta_ts>2018-09-10 09:24:10 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Animations</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kari.pihkala</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1436011</commentid>
    <comment_count>0</comment_count>
    <who name="">kari.pihkala</who>
    <bug_when>2018-06-25 01:57:41 -0700</bug_when>
    <thetext>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(&quot;box&quot;).animate([
    { transform: &apos;rotate(0deg)&apos;, offset: 0 },
    { transform: &apos;rotate(270deg)&apos;, offset: .5 },
    { transform: &apos;rotate(0deg)&apos;, offset: 1 }
  ], {
    duration: 3000,
    iterations: Infinity,
    easing: &apos;linear&apos;,
    delay: 0
  });

2. Ensure that the animation rotates the element.
3. Hide the browser window by pressing the orange &apos;-&apos; 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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1436056</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-06-25 08:29:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/41424983&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458129</commentid>
    <comment_count>2</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2018-09-10 08:20:22 -0700</bug_when>
    <thetext>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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458139</commentid>
    <comment_count>3</comment_count>
    <who name="">kari.pihkala</who>
    <bug_when>2018-09-10 09:24:10 -0700</bug_when>
    <thetext>I tested it again in Safari Technology Preview 64 and it works now.

Thank you for your hard work implementing WAAPI. :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>