OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <script src="../../js/resources/js-test-pre.js"></script> | 5 <script src="../../js/resources/js-test-pre.js"></script> |
6 <title></title> | 6 <title></title> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <p id=description></p> | 9 <p id=description></p> |
10 <div id="console"></div> | 10 <div id="console"></div> |
11 <script> | 11 <script> |
12 | 12 |
13 window.jsTestIsAsync = true; | 13 window.jsTestIsAsync = true; |
14 var mutations; | 14 var mutations; |
15 | 15 |
16 function testBasic() { | 16 function testBasic() { |
17 var observer; | 17 var observer; |
18 | 18 |
19 function start() { | 19 function start() { |
20 debug('Testing takeRecords.'); | 20 debug('Testing takeRecords.'); |
21 | 21 |
22 mutations = null; | 22 mutations = null; |
23 div = document.createElement('div'); | 23 div = document.createElement('div'); |
24 subDiv = div.appendChild(document.createElement('div')); | 24 subDiv = div.appendChild(document.createElement('div')); |
25 subDiv.innerHTML = 'hello, world'; | 25 subDiv.innerHTML = 'hello, world'; |
26 observer = new WebKitMutationObserver(function(mutations) { | 26 observer = new MutationObserver(function(mutations) { |
27 window.mutations = mutations; | 27 window.mutations = mutations; |
28 }); | 28 }); |
29 | 29 |
30 observer.observe(div, {attributes: true, characterData: true, subtree: t
rue}); | 30 observer.observe(div, {attributes: true, characterData: true, subtree: t
rue}); |
31 subDiv.setAttribute('foo', 'bar'); | 31 subDiv.setAttribute('foo', 'bar'); |
32 subDiv.firstChild.textContent = 'goodbye!'; | 32 subDiv.firstChild.textContent = 'goodbye!'; |
33 div.removeChild(subDiv); | 33 div.removeChild(subDiv); |
34 | 34 |
35 mutations = observer.takeRecords(); | 35 mutations = observer.takeRecords(); |
36 | 36 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 finishJSTest(); | 73 finishJSTest(); |
74 } | 74 } |
75 | 75 |
76 description('Testing WebKitMutationObserver.takeRecords'); | 76 description('Testing WebKitMutationObserver.takeRecords'); |
77 | 77 |
78 runNextTest(); | 78 runNextTest(); |
79 </script> | 79 </script> |
80 <script src="../../js/resources/js-test-post.js"></script> | 80 <script src="../../js/resources/js-test-post.js"></script> |
81 </body> | 81 </body> |
82 </html> | 82 </html> |
OLD | NEW |