test_state_change_on_reframe.html (860B)
1 <!doctype html> 2 <title>Test for state change not bogusly changing during reframe (bug 1528644)</title> 3 <script src="/tests/SimpleTest/SimpleTest.js"></script> 4 <script src="/tests/SimpleTest/EventUtils.js"></script> 5 <style> 6 .reframe { display: table } 7 input:invalid { color: red; } 8 input:valid { color: green; } 9 </style> 10 <form> 11 <input type="text" required minlength="4" onkeypress="this.classList.toggle('reframe')"> 12 </form> 13 <script> 14 SimpleTest.waitForExplicitFinish(); 15 SimpleTest.waitForFocus(function() { 16 let input = document.querySelector("input"); 17 input.focus(); 18 requestAnimationFrame(() => { 19 synthesizeKey("a"); 20 requestAnimationFrame(() => { 21 requestAnimationFrame(() => { 22 ok(!input.validity.valid); 23 is(getComputedStyle(input).display, "table"); 24 SimpleTest.finish(); 25 }); 26 }); 27 }); 28 }); 29 </script>