| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>document.title with head blown away</title> | |
| 5 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> | |
| 6 <link rel="help" href="http://www.whatwg.org/html5/#document.title"> | |
| 7 <script src="../../../resources/testharness.js"></script> | |
| 8 <script src="../../../resources/testharnessreport.js"></script> | |
| 9 <link rel="stylesheet" href="../../../resources/testharness.css"> | |
| 10 </head> | |
| 11 <body> | |
| 12 <script> | |
| 13 test(function() { | |
| 14 assert_equals(document.title, "document.title with head blown away"); | |
| 15 }) | |
| 16 test(function() { | |
| 17 var head = document.getElementsByTagName("head")[0]; | |
| 18 assert_true(!!head, "Head gone?!") | |
| 19 head.parentNode.removeChild(head); | |
| 20 assert_false(!!document.getElementsByTagName("head")[0], "Head still there?!
") | |
| 21 document.title = "FAIL"; | |
| 22 assert_equals(document.title, ""); | |
| 23 }) | |
| 24 test(function() { | |
| 25 var title2 = document.createElement("title"); | |
| 26 title2.appendChild(document.createTextNode("PASS")); | |
| 27 document.body.appendChild(title2); | |
| 28 assert_equals(document.title, "PASS"); | |
| 29 }) | |
| 30 test(function() { | |
| 31 var title3 = document.createElement("title"); | |
| 32 title3.appendChild(document.createTextNode("PASS2")); | |
| 33 document.documentElement.insertBefore(title3, document.body); | |
| 34 assert_equals(document.title, "PASS2"); | |
| 35 }) | |
| 36 </script> | |
| 37 </body> | |
| 38 </html> | |
| OLD | NEW |