| <!DOCTYPE html> |
| <script src="../../../resources/js-test.js"></script> |
| <script> |
| description('Test that an appended script does NOT invoke MutationObserver callbacks'); |
| |
| var mutationsDelivered = false; |
| function callback(mutations) { |
| mutationsDelivered = true; |
| } |
| |
| var observer = new MutationObserver(callback); |
| var div = document.createElement('div'); |
| observer.observe(div, {attributes: true}); |
| div.setAttribute('foo', 'bar'); |
| shouldBeFalse('mutationsDelivered'); |
| var scriptDidRun = false; |
| var script = document.createElement('script'); |
| script.textContent = 'scriptDidRun = true'; |
| shouldBeFalse('scriptDidRun'); |
| document.head.appendChild(script); |
| shouldBeTrue('scriptDidRun'); |
| shouldBeFalse('mutationsDelivered'); |
| </script> |