| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE html> |
| 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 <script src="script-tests/htmloutputelement-validity.js"></script> | 7 <script> |
| 8 description('Tests for the validation APIs of output elements.'); |
| 9 |
| 10 var container; |
| 11 var output; |
| 12 |
| 13 container = document.createElement('div'); |
| 14 document.body.appendChild(container); |
| 15 |
| 16 debug('- Ensures whether the willValidate is defined and it always returns false
.'); |
| 17 container.innerHTML = '<form><output id="outputElement">aValue</output></form>'; |
| 18 output = document.getElementById('outputElement'); |
| 19 shouldBe('typeof output.willValidate', '"boolean"'); |
| 20 shouldBeFalse('output.willValidate'); |
| 21 container.innerHTML = '<output id="outputElement">aValue</output>'; |
| 22 output = document.getElementById('outputElement'); |
| 23 shouldBeFalse('output.willValidate'); |
| 24 |
| 25 debug('- Ensures validity is always "valid" and validationMessage() always retur
ns an empty string.'); |
| 26 container.innerHTML = '<form><output id="outputElement">aValue</output></form>'; |
| 27 output = document.getElementById('outputElement'); |
| 28 shouldBeEqualToString('output.validationMessage', ''); |
| 29 shouldBeTrue('output.checkValidity()'); |
| 30 output.setCustomValidity('This should not be affected.'); |
| 31 shouldBeEqualToString('output.validationMessage', ''); |
| 32 shouldBeTrue('output.checkValidity()'); |
| 33 </script> |
| 8 </body> | 34 </body> |
| 9 </html> | 35 </html> |
| OLD | NEW |