OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <p>This tests inserting a td element "beforeBegin" of another td element using i
nsertAdjacentHTML. | 4 <p>This tests inserting a td element "beforeBegin" of another td element using i
nsertAdjacentHTML. |
5 If the context element was not properly adjusted, then td will be stripped by th
e parser.</p> | 5 If the context element was not properly adjusted, then td will be stripped by th
e parser.</p> |
6 <table><tr><td></td></tr></table> | 6 <table><tr><td></td></tr></table> |
7 <script> | 7 <script> |
8 | 8 |
9 if (window.testRunner) | 9 if (window.testRunner) |
10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
11 | 11 |
12 var td = document.querySelector('td'); | 12 var td = document.querySelector('td'); |
13 td.insertAdjacentHTML('beforeBegin', '<td></td>'); | 13 td.insertAdjacentHTML('beforeBegin', '<td></td>'); |
14 | 14 |
15 document.write(document.getElementsByTagName('td').length == 2 ? 'PASS' : 'FAIL'
); | 15 document.write(document.getElementsByTagName('td').length == 2 ? 'PASS' : 'FAIL'
); |
16 | 16 |
17 </script> | 17 </script> |
18 </body> | 18 </body> |
19 </html> | 19 </html> |
OLD | NEW |