OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../js/resources/js-test-pre.js"></script> | 2 <script src="../../js/resources/js-test-pre.js"></script> |
3 <script> | 3 <script> |
4 window.jsTestIsAsync = true; | 4 window.jsTestIsAsync = true; |
5 | 5 |
6 description('Test that mutations during delivery do not interrupt delivery order
.'); | 6 description('Test that mutations during delivery do not interrupt delivery order
.'); |
7 function finish() { | 7 function finish() { |
8 shouldBe('order.length', '3'); | 8 shouldBe('order.length', '3'); |
9 shouldBe('order[0]', '1'); | 9 shouldBe('order[0]', '1'); |
10 shouldBe('order[1]', '3'); | 10 shouldBe('order[1]', '3'); |
11 shouldBe('order[2]', '2'); | 11 shouldBe('order[2]', '2'); |
12 finishJSTest(); | 12 finishJSTest(); |
13 } | 13 } |
14 | 14 |
15 var order = []; | 15 var order = []; |
16 var div = document.createElement('div'); | 16 var div = document.createElement('div'); |
17 | 17 |
18 var observer1 = new WebKitMutationObserver(function(mutations) { | 18 var observer1 = new MutationObserver(function(mutations) { |
19 order.push(1); | 19 order.push(1); |
20 div.appendChild(document.createElement('span')); | 20 div.appendChild(document.createElement('span')); |
21 }); | 21 }); |
22 var observer2 = new WebKitMutationObserver(function(mutations) { | 22 var observer2 = new MutationObserver(function(mutations) { |
23 order.push(2); | 23 order.push(2); |
24 }); | 24 }); |
25 var observer3 = new WebKitMutationObserver(function(mutations) { | 25 var observer3 = new MutationObserver(function(mutations) { |
26 order.push(3); | 26 order.push(3); |
27 }); | 27 }); |
28 | 28 |
29 observer1.observe(div, {attributes: true}); | 29 observer1.observe(div, {attributes: true}); |
30 observer2.observe(div, {childList: true}); | 30 observer2.observe(div, {childList: true}); |
31 observer3.observe(div, {attributes: true}); | 31 observer3.observe(div, {attributes: true}); |
32 div.setAttribute('foo', 'bar'); | 32 div.setAttribute('foo', 'bar'); |
33 setTimeout(finish, 0); | 33 setTimeout(finish, 0); |
34 </script> | 34 </script> |
35 <script src="../../js/resources/js-test-post.js"></script> | 35 <script src="../../js/resources/js-test-post.js"></script> |
OLD | NEW |