tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

input-maxlength-ui-invalid-change.html (808B)


      1 <!DOCTYPE HTML>
      2 <html>
      3  <!-- Test: input with maxlength is -moz-ui-invalid if the user edits and it's too long -->
      4  <head>
      5    <style>
      6      :-moz-ui-valid { background-color:green; }
      7      :-moz-ui-invalid { background-color:red; }
      8      * { box-shadow:none; background-color:white; }
      9    </style>
     10    <script src="/tests/SimpleTest/EventUtils.js"></script>
     11    <script>
     12      function runTest() {
     13        var input = document.getElementById('input');
     14        input.setSelectionRange(input.value.length, input.value.length)
     15        input.focus();
     16        synthesizeKey("KEY_Backspace");
     17        input.blur(); // to hide the caret
     18        document.documentElement.className='';
     19      }
     20    </script>
     21  </head>
     22  <body onload="runTest()">
     23    <input id="input" maxlength="2" value="fooo">
     24  </body>
     25 </html>