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

test(function() {
  var textarea = document.createElement('textarea');
  textarea.required = true;
  assert_false(textarea.checkValidity());
}, "Should validate textarea not in document");
</script>