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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/adopt-node-crash.html

Issue 2532393003: Remove the wrong optimization in replacing a text node with innerHTML (Closed)
Patch Set: use NeedsRebaseline Created 4 years 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <div>Tests for a crash due to modifying the DOM during mutation events due to an adoptNode call. If this page doesn't crash and DOMSubtreeModified is fire, this test succeeds.</div>
3 <div id="result"></div>
4 <div id="node-to-adopt"></div>
5 <iframe></iframe>
6 <script>
7 if (window.testRunner)
8 testRunner.dumpAsText();
9
10 var nodeToAdopt = document.getElementById('node-to-adopt');
11
12 var mutationHandler = function() {
13 document.getElementById('result').innerHTML = "DOMSubtreeModified fired";
14 document.body.removeEventListener('DOMSubtreeModified', mutationHandler, tru e);
15 document.body.appendChild(nodeToAdopt);
16 };
17 document.body.addEventListener('DOMSubtreeModified', mutationHandler, true);
18
19 var iframe = document.querySelector('iframe');
20 var iframeDoc = iframe.contentDocument;
21 iframeDoc.adoptNode(nodeToAdopt);
22 // The crash happens when the iframe's document is getting detached.
23 document.body.removeChild(iframe);
24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698