3 <title>ValidityState minimal test case
</title>
4 <script src=
"../../resources/js-test.js"></script>
7 <fieldset name=
"victim">
8 <select name=
"victim"></select>
10 <textarea name=
"victim"></textarea>
11 <button name=
"victim"></button>
12 <output name=
"victim"></output>
13 <object name=
"victim"></object>
14 <keygen name=
"victim"></keygen>
18 description('Each form control in this document exposes a validity attribute that returns a live instance of ValidityState.');
20 function countAttr(o
) {
27 var controls
= document
.getElementsByName("victim");
28 for (var i
= 0; i
< controls
.length
; ++i
) {
29 debug('===> Tests for ' + controls
[i
].tagName
);
30 shouldBeTrue('"validity" in controls[i]');
31 var validity1
, validity2
;
32 shouldBeTrue('validity1 = controls[i].validity; validity1 instanceof ValidityState');
33 shouldBeTrue('validity2 = controls[i].validity; validity1 === validity2');
34 shouldBe('countAttr(controls[i].validity)', '11');
37 shouldThrow('new ValidityState()', '"TypeError: Illegal constructor"');