Bug 1367875 - Add a reftest about brief dynamically chaning <audio> to a small width. r=jaws
MozReview-Commit-ID: 1w5f3jdNb67
new file mode 100644
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-dynamically-change-small-width-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ html, body {
+ margin: 0;
+ padding: 0;
+ }
+</style>
+</head>
+<body>
+ <audio controls></audio>
+</body>
new file mode 100644
--- /dev/null
+++ b/toolkit/content/tests/reftests/audio-dynamically-change-small-width.html
@@ -0,0 +1,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>
--- a/toolkit/content/tests/reftests/reftest.list
+++ b/toolkit/content/tests/reftests/reftest.list
@@ -1,4 +1,5 @@
random-if(cocoaWidget||(/^Windows\x20NT\x206\.2/.test(http.oscpu)&&isDebugBuild)) == bug-442419-progressmeter-max.xul bug-442419-progressmeter-max-ref.xul # fails most of the time on Mac because progress meter animates
!= textbox-multiline-default-value.xul textbox-multiline-empty.xul
fails-if(styloVsGecko) == videocontrols-dynamically-add-cc.html videocontrols-dynamically-add-cc-ref.html
fails-if(styloVsGecko) == audio-with-bogus-url.html audio-with-bogus-url-ref.html
+fails-if(styloVsGecko) == audio-dynamically-change-small-width.html audio-dynamically-change-small-width-ref.html