test_validation_not_in_doc.html (627B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Test for constraint validation of form controls not in documents</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id="log"></div> 7 <script> 8 test(function() { 9 var input = document.createElement('input'); 10 input.required = true; 11 assert_false(input.checkValidity()); 12 }, "Should validate input not in document"); 13 14 test(function() { 15 var textarea = document.createElement('textarea'); 16 textarea.required = true; 17 assert_false(textarea.checkValidity()); 18 }, "Should validate textarea not in document"); 19 </script>