| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 window.jsTestIsAsync = true; | 9 window.jsTestIsAsync = true; |
| 10 var mutations; | 10 var mutations; |
| 11 var div, subDiv; | 11 var div, subDiv; |
| 12 | 12 |
| 13 function testBasic() { | 13 function testBasic() { |
| 14 var observer; | 14 var observer; |
| 15 | 15 |
| 16 function start() { | 16 function start() { |
| 17 debug('Testing basic aspects of cross-document observation.'); | 17 debug('Testing basic aspects of cross-document observation.'); |
| 18 | 18 |
| 19 mutations = null; | 19 mutations = null; |
| 20 div = document.createElement('div'); | 20 div = document.createElement('div'); |
| 21 observer = new WebKitMutationObserver(function(mutations) { | 21 observer = new MutationObserver(function(mutations) { |
| 22 window.mutations = mutations; | 22 window.mutations = mutations; |
| 23 }); | 23 }); |
| 24 | 24 |
| 25 observer.observe(div, {attributes: true}); | 25 observer.observe(div, {attributes: true}); |
| 26 var newDoc = document.implementation.createDocument('', '', null); | 26 var newDoc = document.implementation.createDocument('', '', null); |
| 27 newDoc.appendChild(div); | 27 newDoc.appendChild(div); |
| 28 div.id = 'foo'; | 28 div.id = 'foo'; |
| 29 setTimeout(finish, 0); | 29 setTimeout(finish, 0); |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 45 | 45 |
| 46 function testSubtree() { | 46 function testSubtree() { |
| 47 var observer; | 47 var observer; |
| 48 | 48 |
| 49 function start() { | 49 function start() { |
| 50 debug('Testing that subtree observation works after node is moved.'); | 50 debug('Testing that subtree observation works after node is moved.'); |
| 51 | 51 |
| 52 mutations = null; | 52 mutations = null; |
| 53 div = document.createElement('div'); | 53 div = document.createElement('div'); |
| 54 subDiv = div.appendChild(document.createElement('div')); | 54 subDiv = div.appendChild(document.createElement('div')); |
| 55 observer = new WebKitMutationObserver(function(mutations) { | 55 observer = new MutationObserver(function(mutations) { |
| 56 window.mutations = mutations; | 56 window.mutations = mutations; |
| 57 }); | 57 }); |
| 58 | 58 |
| 59 observer.observe(div, {attributes: true, subtree: true}); | 59 observer.observe(div, {attributes: true, subtree: true}); |
| 60 var newDoc = document.implementation.createDocument('', '', null); | 60 var newDoc = document.implementation.createDocument('', '', null); |
| 61 newDoc.appendChild(div); | 61 newDoc.appendChild(div); |
| 62 subDiv.id = 'foo'; | 62 subDiv.id = 'foo'; |
| 63 setTimeout(finish, 0); | 63 setTimeout(finish, 0); |
| 64 } | 64 } |
| 65 | 65 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 description('Test that MutationObservers move correctly across documents'); | 90 description('Test that MutationObservers move correctly across documents'); |
| 91 | 91 |
| 92 runNextTest(); | 92 runNextTest(); |
| 93 | 93 |
| 94 </script> | 94 </script> |
| 95 <script src="../../js/resources/js-test-post.js"></script> | 95 <script src="../../js/resources/js-test-post.js"></script> |
| 96 </body> | 96 </body> |
| 97 </html> | 97 </html> |
| OLD | NEW |