Bug 1330962 part 6 - Start this test using MozReftestInvalidate rather than onload.
authorMats Palmgren <mats@mozilla.com>
Mon, 30 Jan 2017 00:37:00 +0100
changeset 331612 b222ec9a5d90
parent 331611 f0acc072ee76
child 331613 89526e05e79d
push id86303
push usermpalmgren@mozilla.com
push dateSun, 29 Jan 2017 23:37:10 +0000
treeherdermozilla-inbound@b222ec9a5d90 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1330962
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1330962 part 6 - Start this test using MozReftestInvalidate rather than onload. The test fails when using onload if it's the first test to run in its reftest chunk.
layout/reftests/bugs/315920-17.html
--- a/layout/reftests/bugs/315920-17.html
+++ b/layout/reftests/bugs/315920-17.html
@@ -1,23 +1,30 @@
 <!DOCTYPE html>
-<html>
+<html class="reftest-wait">
   <head>
     <style>
       input ~ label {color: red}
       input:not(:default):not(:checked):not([checked]) ~ label {color:red}
       input[checked]:checked:default ~ input:not(:checked):not([checked]):not(:default) + label {color: green}
       input:checked:default + label {color: green}
     </style>
   </head>
-  <body onload='document.getElementById("two").setAttribute("checked", "true");
-                document.getElementById("one").setAttribute("checked", "checked");
-                document.getElementById("two").removeAttribute("checked");'>
+  <body>
     <form>
       <input type="checkbox" name="group1" id="one" value="1"/>
       <label for="one">Should be no red</label><br>
       <input type="checkbox" name="group1" id="two" value="2"/>
       <label for="two">Should be no red</label><br>
       <input type="checkbox" name="group1" id="three" value="3"/>
       <label for="three">Should be no red</label>
     </form>
+<script>
+function doTest() {
+  document.getElementById("two").setAttribute("checked", "true");
+  document.getElementById("one").setAttribute("checked", "checked");
+  document.getElementById("two").removeAttribute("checked");
+  setTimeout(function () { document.documentElement.removeAttribute("class"); }, 0);
+}
+window.addEventListener("MozReftestInvalidate", doTest);
+</script>
   </body>
 </html>