| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | |
| 5 <script src="resources/microdata-common.js"></script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <p>This test ensures that writing to itemValue must throw an INVALID_ACCESS_ERR
error if the element has an itemscope attribute.</p> | |
| 9 <div id="console"></div> | |
| 10 <script> | |
| 11 var exceptionCode; | |
| 12 function runTest(tagName) | |
| 13 { | |
| 14 debug("Testing '" + tagName + "' element's behavior."); | |
| 15 exceptionCode = undefined; | |
| 16 testElement = createElement(tagName, {itemscope: 'itemscope', itemprop: 'foo
', content: 'test'}); | |
| 17 try { | |
| 18 testElement.itemValue = 'test' | |
| 19 } catch (exception) { | |
| 20 exceptionCode = exception.code; | |
| 21 } | |
| 22 | |
| 23 if (exceptionCode == DOMException.INVALID_ACCESS_ERR) | |
| 24 debug("TEST SUCCEEDED: Got the expected exception (" + exceptionCode + "
) INVALID_ACCESS_ERR.<br>"); | |
| 25 else | |
| 26 debug("TEST FAILED: Should've thrown INVALID_ACCESS_ERR but threw " + ex
ceptionCode + ".<br>"); | |
| 27 } | |
| 28 | |
| 29 runTest('meta'); | |
| 30 runTest('audio'); | |
| 31 runTest('embed'); | |
| 32 runTest('iframe'); | |
| 33 runTest('img'); | |
| 34 runTest('source'); | |
| 35 runTest('track'); | |
| 36 runTest('video'); | |
| 37 runTest('a'); | |
| 38 runTest('area'); | |
| 39 runTest('link'); | |
| 40 runTest('object'); | |
| 41 runTest('div'); | |
| 42 | |
| 43 </script> | |
| 44 <script src="../../js/resources/js-test-post.js"></script> | |
| 45 </body> | |
| 46 </html | |
| OLD | NEW |