| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 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/title-with-multiple-children.js"></script> | 7 <script> |
| 8 description("This test checks to see if setting document.title works even if the
title element has multiple children."); |
| 9 |
| 10 // Setup - create title element. |
| 11 shouldBe("document.getElementsByTagName('title').length", "0"); |
| 12 var titleElement = document.createElement("title"); |
| 13 document.body.appendChild(titleElement); |
| 14 |
| 15 // For case with no children. |
| 16 shouldBe("document.title", "''"); |
| 17 shouldBe("titleElement.text", "''"); |
| 18 |
| 19 // For case with single children. |
| 20 var firstText = "First"; |
| 21 titleElement.appendChild(document.createTextNode(firstText)); |
| 22 shouldBe("document.title", "firstText"); |
| 23 shouldBe("titleElement.text", "firstText"); |
| 24 |
| 25 // For case with 2 children. |
| 26 var secondText = "Second"; |
| 27 titleElement.appendChild(document.createTextNode(secondText)); |
| 28 shouldBe("document.title", "firstText + secondText"); |
| 29 shouldBe("titleElement.text", "firstText + secondText"); |
| 30 |
| 31 // override title with setting document.title with multiple title children. |
| 32 var expected = "This title is set by property"; |
| 33 document.title = expected; |
| 34 shouldBe("document.title", "expected"); |
| 35 shouldBe("titleElement.text", "expected"); |
| 36 </script> |
| 8 </body> | 37 </body> |
| 9 </html> | 38 </html> |
| OLD | NEW |