| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>HTML5 Table API Tests</title> | 4 <title>HTML5 Table API Tests</title> |
| 5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> | 5 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> |
| 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> | 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> |
| 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-caption-e
lement" /> | 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-caption-e
lement" /> |
| 8 </head> | 8 </head> |
| 9 <script src="../../../../../../resources/testharness.js"></script> | 9 <script src="../../../../../../resources/testharness.js"></script> |
| 10 <script src="../../../../../../resources/testharnessreport.js"></script> | 10 <script src="../../../../../../resources/testharnessreport.js"></script> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 assert_equals(document.getElementById('table1').caption.innerHTML, "firs
t caption"); | 30 assert_equals(document.getElementById('table1').caption.innerHTML, "firs
t caption"); |
| 31 }, "first caption element child of the first table element"); | 31 }, "first caption element child of the first table element"); |
| 32 | 32 |
| 33 test(function () { | 33 test(function () { |
| 34 var caption = document.createElement("caption"); | 34 var caption = document.createElement("caption"); |
| 35 caption.innerHTML = "new caption"; | 35 caption.innerHTML = "new caption"; |
| 36 var table = document.getElementById('table1'); | 36 var table = document.getElementById('table1'); |
| 37 table.caption = caption; | 37 table.caption = caption; |
| 38 | 38 |
| 39 assert_equals(caption.parentNode, table); | 39 assert_equals(caption.parentNode, table); |
| 40 assert_equals(table.firstChild, caption); |
| 40 assert_equals(table.caption.innerHTML, "new caption"); | 41 assert_equals(table.caption.innerHTML, "new caption"); |
| 41 | 42 |
| 42 captions = table.getElementsByTagName('caption'); | 43 captions = table.getElementsByTagName('caption'); |
| 43 assert_equals(captions.length, 2); | 44 assert_equals(captions.length, 2); |
| 44 assert_equals(captions[0].innerHTML, "new caption"); | 45 assert_equals(captions[0].innerHTML, "new caption"); |
| 45 assert_equals(captions[1].innerHTML, "second caption"); | 46 assert_equals(captions[1].innerHTML, "second caption"); |
| 46 }, "setting caption on a table"); | 47 }, "setting caption on a table"); |
| 47 | 48 |
| 48 test(function () { | 49 test(function () { |
| 49 assert_equals(document.getElementById('table2').caption, null); | 50 assert_equals(document.getElementById('table2').caption, null); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 60 assert_not_equals(document.getElementById('table4').caption, null); | 61 assert_not_equals(document.getElementById('table4').caption, null); |
| 61 | 62 |
| 62 var parent = document.getElementById('table4').caption.parentNode; | 63 var parent = document.getElementById('table4').caption.parentNode; |
| 63 parent.removeChild(document.getElementById('table4').caption); | 64 parent.removeChild(document.getElementById('table4').caption); |
| 64 | 65 |
| 65 assert_equals(document.getElementById('table4').caption, null); | 66 assert_equals(document.getElementById('table4').caption, null); |
| 66 }, "dynamically removing caption on a table"); | 67 }, "dynamically removing caption on a table"); |
| 67 </script> | 68 </script> |
| 68 </body> | 69 </body> |
| 69 </html> | 70 </html> |
| OLD | NEW |