OLD | NEW |
1 <script src="../js/resources/js-test-pre.js"></script> | 1 <script src="../js/resources/js-test-pre.js"></script> |
2 <script> | 2 <script> |
3 window.jsTestIsAsync = true; | 3 window.jsTestIsAsync = true; |
4 description('Transient registrations should be cleared even without delivery.'); | 4 description('Transient registrations should be cleared even without delivery.'); |
5 | 5 |
6 var mutationsDelivered = false; | 6 var mutationsDelivered = false; |
7 function callback(mutations) { | 7 function callback(mutations) { |
8 mutationsDelivered = true; | 8 mutationsDelivered = true; |
9 } | 9 } |
10 var observer = new WebKitMutationObserver(callback); | 10 var observer = new WebKitMutationObserver(callback); |
11 | 11 |
12 var div = document.createElement('div'); | 12 var div = document.createElement('div'); |
13 var span = div.appendChild(document.createElement('span')); | 13 var span = div.appendChild(document.createElement('span')); |
14 observer.observe(div, {attributes: true, subtree: true}); | 14 observer.observe(div, {attributes: true, subtree: true}); |
15 div.removeChild(span); | 15 div.removeChild(span); |
16 setTimeout(function() { | 16 setTimeout(function() { |
17 // By the time this function runs the transient registration should be clear
ed, | 17 // By the time this function runs the transient registration should be clear
ed, |
18 // so we expect not to be notified of this attribute mutation. | 18 // so we expect not to be notified of this attribute mutation. |
19 span.setAttribute('bar', 'baz'); | 19 span.setAttribute('bar', 'baz'); |
20 setTimeout(function() { | 20 setTimeout(function() { |
21 shouldBeFalse('mutationsDelivered'); | 21 shouldBeFalse('mutationsDelivered'); |
22 finishJSTest(); | 22 finishJSTest(); |
23 }, 0); | 23 }, 0); |
24 }, 0); | 24 }, 0); |
25 </script> | 25 </script> |
26 <script src="../js/resources/js-test-post.js"></script> | 26 <script src="../js/resources/js-test-post.js"></script> |
OLD | NEW |