tor-browser

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

test_bug600155.html (1097B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=600155
      5 -->
      6 <head>
      7  <title>Test for Bug 600155</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=600155">Mozilla Bug 600155</a>
     13 <p id="display"></p>
     14 <div id='content' style='display:none;'>
     15 </div>
     16 <pre id="test">
     17 <script type="application/javascript">
     18 
     19 /** Test for Bug 600155 */
     20 
     21 var subjectForConstraintValidation = [ "input", "select", "textarea" ];
     22 var content = document.getElementById('content');
     23 
     24 for (var eName of subjectForConstraintValidation) {
     25  var e = document.createElement(eName);
     26  content.appendChild(e);
     27  e.setCustomValidity("foo");
     28  if ("required" in e) {
     29    e.required = true;
     30  } else {
     31    e.setCustomValidity("bar");
     32  }
     33 
     34  // At this point, the element is invalid.
     35  is(e.validationMessage, "foo",
     36     "the validation message should be the author one");
     37 
     38  content.removeChild(e);
     39 }
     40 
     41 </script>
     42 </pre>
     43 </body>
     44 </html>