summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/reftests/audio-dynamically-change-small-width.html
blob: 0e9059541a024585088a3b9dae343fa5b213ef19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
  html, body {
    margin: 0;
    padding: 0;
  }
</style>
</head>
<body>
  <audio id="tweakme" controls></audio>

  <script>
    function doTest() {
      setTimeout(() => {
        let tweakme = document.getElementById("tweakme");

        // Make the audio element extremely skinny, flush layout, and then revert
        // that change:
        tweakme.style.width = "1px";
        tweakme.offsetHeight; // flush layout
        tweakme.style.width = "";
        tweakme.offsetHeight; // flush layout

        document.documentElement.removeAttribute("class");
      }, 300);
    }

    window.addEventListener("MozReftestInvalidate", doTest);
  </script>
</body>