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

Side by Side Diff: LayoutTests/fast/dom/adopt-node-prevented.html

Issue 10987026: Merge 129469 - adoptNode() shouldn't reset ownerDocument if the source node failed to remove itself (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 2 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/adopt-node-prevented-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 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div id="newParent"></div> 7 <div id="newParent"></div>
8 <a href="#" id="target"></a> 8 <a href="#" id="target"></a>
9 <script> 9 <script>
10 description("Test that adoptNode fails safely if prevented by a DOM mutation."); 10 description("Test that adoptNode fails safely if prevented by a DOM mutation.");
11 11
12 function run() { 12 function run() {
13 newParent = document.getElementById("newParent"); 13 newParent = document.getElementById("newParent");
14 target = document.getElementById("target"); 14 target = document.getElementById("target");
15 target.addEventListener("blur", function () { newParent.appendChild(target); }, false); 15 target.addEventListener("blur", function () { newParent.appendChild(target); }, false);
16 target.focus(); 16 target.focus();
17 var anotherDocument = document.implementation.createDocument("", "", null); 17 var anotherDocument = document.implementation.createDocument("", "", null);
18 18
19 try { anotherDocument.adoptNode(target); } catch(e) {} 19 try { anotherDocument.adoptNode(target); } catch(e) {}
20 shouldBe("target.ownerDocument.location", "document.location"); 20 shouldBe("target.ownerDocument.location", "document.location");
21 } 21 }
22 22
23 document.addEventListener("DOMContentLoaded", run, false); 23 document.addEventListener("DOMContentLoaded", run, false);
24 </script> 24 </script>
25 <script src="../js/resources/js-test-post.js"></script> 25 <script src="../js/resources/js-test-post.js"></script>
26 </body> 26 </body>
27 </html> 27 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/adopt-node-prevented-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698