OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../js/resources/js-test-pre.js"></script> |
4 <script> | 4 <script> |
5 window.jsTestIsAsync = true; | 5 window.jsTestIsAsync = true; |
6 description('Verifies that MutationObserver is passed to the callback as expecte
d.'); | 6 description('Verifies that MutationObserver is passed to the callback as expecte
d.'); |
7 | 7 |
8 function mutationCallback(mutations, observer) { | 8 function mutationCallback(mutations, observer) { |
9 window.thisArgument = this; | 9 window.thisArgument = this; |
10 window.argument2 = observer; | 10 window.argument2 = observer; |
11 shouldBe('thisArgument', 'mutationObserver'); | 11 shouldBe('thisArgument', 'mutationObserver'); |
12 shouldBe('argument2', 'mutationObserver'); | 12 shouldBe('argument2', 'mutationObserver'); |
13 finishJSTest(); | 13 finishJSTest(); |
14 } | 14 } |
15 var mutationObserver = new WebKitMutationObserver(mutationCallback); | 15 var mutationObserver = new MutationObserver(mutationCallback); |
16 var div = document.createElement('div'); | 16 var div = document.createElement('div'); |
17 mutationObserver.observe(div, {attributes: true}); | 17 mutationObserver.observe(div, {attributes: true}); |
18 div.setAttribute('foo', 'bar'); | 18 div.setAttribute('foo', 'bar'); |
19 </script> | 19 </script> |
20 <script src="../../js/resources/js-test-post.js"></script> | 20 <script src="../../js/resources/js-test-post.js"></script> |
21 </body> | 21 </body> |
OLD | NEW |