tor-browser

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

textarea-minlength-ui-invalid-change.html (824B)


      1 <!DOCTYPE HTML>
      2 <html>
      3  <!-- Test: textarea with minlength is -moz-ui-invalid if the user edits and it's too short -->
      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 textarea = document.getElementById('textarea');
     14        textarea.setSelectionRange(textarea.value.length, textarea.value.length)
     15        textarea.focus();
     16        sendString("o");
     17        textarea.blur(); // to hide the caret
     18        document.documentElement.className='';
     19      }
     20    </script>
     21  </head>
     22  <body onload="runTest()">
     23    <textarea id="textarea" minlength="4">fo</textarea>
     24  </body>
     25 </html>