Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: LayoutTests/fast/dom/MutationObserver/script-append.html

Issue 146043008: Verify that appendChild(script) does not perform a microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/MutationObserver/script-append-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 an appended script does NOT invoke MutationObserver callb acks');
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 shouldBeFalse('mutationsDelivered'); 15 shouldBeFalse('mutationsDelivered');
16 document.write('<script><\/script>'); // performs a microtask checkpoint 16 var scriptDidRun = false;
17 shouldBeTrue('mutationsDelivered'); 17 var script = document.createElement('script');
18 script.textContent = 'scriptDidRun = true';
19 shouldBeFalse('scriptDidRun');
20 document.head.appendChild(script);
21 shouldBeTrue('scriptDidRun');
22 shouldBeFalse('mutationsDelivered');
18 </script> 23 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/MutationObserver/script-append-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698