title: Safari: CSS animation doesn't start second time when transitioning from display: none to display: block
body: <p>I have this simple animation triggered when transitioning from display: none to display: block.
  It works perfect on Chrome but on Safari it is triggered only for first time, when I hide element and then show it again second time, it is not working.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.child1 {
    display: none;
  }
  
  .child2 {
    display: block;
  }
  
  .visibility .child1 {
    display: block;
  }
  
  .visibility .child2 {
    display: none;
  }
  
  @keyframes myAnimation {
    0% { transform: scale(0.5); }
  }
  
  .animated {
    animation: myAnimation 0.4s ease-out;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Title&lt;/title&gt;
      &lt;link rel="stylesheet" href="styles.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="testdiv" class="visibility"&gt;
      &lt;div class="child1"&gt;Hello&lt;/div&gt;
      &lt;div class="child2 animated"&gt;Bye&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
      const elem = document.getElementById("testdiv");
  
      elem.addEventListener("click", () =&gt; {
          if (!elem.classList.length) {
              elem.classList.add("visibility");
          } else {
              elem.classList.remove("visibility")
          }
      })
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>