OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <script> | 3 <script> |
4 description('Test that a script end tags invokes MutationObserver callbacks'); | 4 description('Test that a script end tags invokes MutationObserver callbacks'); |
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 | 10 |
11 var observer = new MutationObserver(callback); | 11 var observer = new MutationObserver(callback); |
12 var div = document.createElement('div'); | 12 var div = document.createElement('div'); |
13 observer.observe(div, {attributes: true}); | 13 observer.observe(div, {attributes: true}); |
14 div.setAttribute('foo', 'bar'); | 14 div.setAttribute('foo', 'bar'); |
| 15 document.write('<script><\/script>'); |
15 shouldBeFalse('mutationsDelivered'); | 16 shouldBeFalse('mutationsDelivered'); |
16 document.write('<script><\/script>'); // performs a microtask checkpoint | 17 </script> |
| 18 <script> |
17 shouldBeTrue('mutationsDelivered'); | 19 shouldBeTrue('mutationsDelivered'); |
18 </script> | 20 </script> |
OLD | NEW |