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="../../js/resources/js-test-pre.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 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description('Test to see if setting the value attribute updates the value.'); | 10 description('Test to see if setting the value attribute updates the value.'); |
11 | 11 |
12 var input = document.createElement('input'); | 12 var input = document.createElement('input'); |
13 input.type = 'range'; | 13 input.type = 'range'; |
14 | 14 |
15 shouldBe('input.setAttribute("value", "10"); input.value', '"10"'); | 15 shouldBe('input.setAttribute("value", "10"); input.value', '"10"'); |
16 | 16 |
17 input.setAttribute('min', '0'); | 17 input.setAttribute('min', '0'); |
18 input.setAttribute('max', '100'); | 18 input.setAttribute('max', '100'); |
19 | 19 |
20 debug("rewriting the value attribute should update the value") | 20 debug("rewriting the value attribute should update the value") |
21 shouldBe('input.setAttribute("value", "20"); input.value', '"20"'); | 21 shouldBe('input.setAttribute("value", "20"); input.value', '"20"'); |
22 | 22 |
23 debug("changing the max should effect value") | 23 debug("changing the max should effect value") |
24 shouldBe('input.setAttribute("max", "10"); input.value', '"10"'); | 24 shouldBe('input.setAttribute("max", "10"); input.value', '"10"'); |
25 | 25 |
26 debug("value attribute should not change the value after you set a value") | 26 debug("value attribute should not change the value after you set a value") |
27 shouldBe('input.value = 10; input.setAttribute("value", "5"); input.value', '"10
"'); | 27 shouldBe('input.value = 10; input.setAttribute("value", "5"); input.value', '"10
"'); |
28 </script> | 28 </script> |
29 </body> | 29 </body> |
30 </html> | 30 </html> |
OLD | NEW |