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

Side by Side Diff: LayoutTests/fast/dom/MutationObserver/added-out-of-order.html

Issue 12317072: Merge 143386 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/MutationObserver/callback-arguments.html » ('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 <div id="sandbox" style="display:none"><span></span></div> 2 <div id="sandbox" style="display:none"><span></span></div>
3 <script src="../../js/resources/js-test-pre.js"></script> 3 <script src="../../js/resources/js-test-pre.js"></script>
4 <script> 4 <script>
5 description("Test MutationEvents interfering with MutationObservers: adding node s 'out of order'"); 5 description("Test MutationEvents interfering with MutationObservers: adding node s 'out of order'");
6 var sandbox = document.getElementById('sandbox'); 6 var sandbox = document.getElementById('sandbox');
7 var inserted = false; 7 var inserted = false;
8 sandbox.addEventListener('DOMNodeRemoved', function() { 8 sandbox.addEventListener('DOMNodeRemoved', function() {
9 if (!inserted) { 9 if (!inserted) {
10 sandbox.appendChild(document.createElement('div')); 10 sandbox.appendChild(document.createElement('div'));
11 inserted = true; 11 inserted = true;
12 } 12 }
13 }); 13 });
14 var observer = new WebKitMutationObserver(function(){}); 14 var observer = new MutationObserver(function(){});
15 observer.observe(sandbox, {childList: true}); 15 observer.observe(sandbox, {childList: true});
16 sandbox.textContent = 'hello world'; 16 sandbox.textContent = 'hello world';
17 17
18 var mutations = observer.takeRecords(); 18 var mutations = observer.takeRecords();
19 shouldBe("mutations.length", "3"); 19 shouldBe("mutations.length", "3");
20 shouldBe("mutations[0].addedNodes.length", "0"); 20 shouldBe("mutations[0].addedNodes.length", "0");
21 shouldBe("mutations[0].removedNodes.length", "1"); 21 shouldBe("mutations[0].removedNodes.length", "1");
22 shouldBe("mutations[0].removedNodes[0].tagName", "'SPAN'"); 22 shouldBe("mutations[0].removedNodes[0].tagName", "'SPAN'");
23 shouldBe("mutations[1].addedNodes.length", "1"); 23 shouldBe("mutations[1].addedNodes.length", "1");
24 shouldBe("mutations[1].removedNodes.length", "0"); 24 shouldBe("mutations[1].removedNodes.length", "0");
25 shouldBe("mutations[1].addedNodes[0].tagName", "'DIV'"); 25 shouldBe("mutations[1].addedNodes[0].tagName", "'DIV'");
26 shouldBe("mutations[2].addedNodes.length", "1"); 26 shouldBe("mutations[2].addedNodes.length", "1");
27 shouldBe("mutations[2].removedNodes.length", "0"); 27 shouldBe("mutations[2].removedNodes.length", "0");
28 shouldBe("mutations[2].addedNodes[0].nodeValue", "'hello world'"); 28 shouldBe("mutations[2].addedNodes[0].nodeValue", "'hello world'");
29 </script> 29 </script>
30 <script src="../../js/resources/js-test-post.js"></script> 30 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/MutationObserver/callback-arguments.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698