OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <form id="form"> | 8 <form id="form"> |
9 <input type="hidden" id="input1" value="value1"> | 9 <input type="hidden" id="input1" value="value1"> |
10 <input type="hidden" id="input2" value="value2" form="X"> | 10 <input type="hidden" id="input2" value="value2" form="X"> |
11 <label id="label1">label1</label> | 11 <label id="label1">label1</label> |
12 <label id="label2" form="X">label2</label> | 12 <label id="label2" form="X">label2</label> |
13 </form> | 13 </form> |
14 <div id="console"></div> | 14 <div id="console"></div> |
15 <script> | 15 <script> |
16 description('This page ensures that <input from="X"> and <label from="X
"> don\'t associate with any form elements when there is no <form id="X"&g
t;.'); | 16 description('This page ensures that <input from="X"> and <label from="X
"> don\'t associate with any form elements when there is no <form id="X"&g
t;.'); |
17 | 17 |
18 var form = document.getElementById('form'); | 18 var form = document.getElementById('form'); |
19 var inputShouldHaveForm = document.getElementById('input1'); | 19 var inputShouldHaveForm = document.getElementById('input1'); |
20 var inputShouldNotHaveForm = document.getElementById('input2'); | 20 var inputShouldNotHaveForm = document.getElementById('input2'); |
21 var labelShouldHaveForm = document.getElementById('label1'); | 21 var labelWithoutForm = document.getElementById('label1'); |
22 var labelShouldNotHaveForm = document.getElementById('label2'); | 22 var labelWithInvalidForm = document.getElementById('label2'); |
23 shouldBe('inputShouldHaveForm.form', 'form'); | 23 shouldBe('inputShouldHaveForm.form', 'form'); |
24 shouldBeNull('inputShouldNotHaveForm.form'); | 24 shouldBeNull('inputShouldNotHaveForm.form'); |
25 shouldBe('labelShouldHaveForm.form', 'form'); | 25 shouldBeNull('labelWithoutForm.form'); |
26 shouldBeNull('labelShouldNotHaveForm.form'); | 26 shouldBeNull('labelWithInvalidForm.form'); |
27 </script> | 27 </script> |
28 </body> | 28 </body> |
29 </html> | 29 </html> |
OLD | NEW |