| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <title>old</title> | |
| 3 <script src="../../resources/js-test.js"></script> | |
| 4 <script> | |
| 5 window.jsTestIsAsync = true; | |
| 6 description("Test for mutations to childList when setting document.title."); | |
| 7 var mutations; | |
| 8 function finish() { | |
| 9 shouldBe('mutations.length', '1'); | |
| 10 shouldBe('mutations[0].type', '"childList"'); | |
| 11 shouldBe('mutations[0].addedNodes.length', '1'); | |
| 12 shouldBe('mutations[0].removedNodes.length', '1'); | |
| 13 finishJSTest(); | |
| 14 } | |
| 15 | |
| 16 var titleElement = document.querySelector('title'); | |
| 17 var i = 0; | |
| 18 | |
| 19 var observer = new MutationObserver(function(mutations) { | |
| 20 window.mutations = mutations; | |
| 21 }); | |
| 22 observer.observe(titleElement, { childList: true }); | |
| 23 document.title = "new"; | |
| 24 | |
| 25 setTimeout(finish, 0); | |
| 26 </script> | |
| 27 <body> | |
| 28 </body> | |
| OLD | NEW |