Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / required-attribute-002.html
blobfda36c8933b094897aa0ce76a6b0b1bd28bbe6a5
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <title>required attribute JS set</title>
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <input id="input" name="victim" />
11 <textarea id="textarea" name="victim"></textarea>
12 <select id="select" name="victim">
13 <option value="" selected />
14 <option value="X">X</option>
15 </select>
16 <script language="JavaScript" type="text/javascript">
17 function requiredFor(id) {
18 return document.getElementById(id).required;
21 description("There are three form control elements below, all optional. They're set as required via required DOM attribute.");
23 v = document.getElementsByName("victim");
25 debug("Before set:");
26 shouldBeFalse('requiredFor("input")');
27 shouldBeFalse('requiredFor("textarea")');
28 shouldBeFalse('requiredFor("select")');
29 debug("");
31 v[0].required = true;
32 v[1].required = true;
33 v[2].required = true;
35 debug("After set:");
36 shouldBeTrue('requiredFor("input")');
37 shouldBeTrue('requiredFor("textarea")');
38 shouldBeTrue('requiredFor("select")');
39 debug("");
40 </script>
41 </body>
42 </html>