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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/range-surround-contents.html

Issue 2745443003: DOM Range: surroundContents() should not check if newParent is in ancestors beforehand. (Closed)
Patch Set: . Created 3 years, 9 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/shadow-dom.js"></script> 4 <script src="resources/shadow-dom.js"></script>
5 <div id="targets"> 5 <div id="targets">
6 <div id="T0"> 6 <div id="T0">
7 <div id="normal-target">Normal</div> 7 <div id="normal-target">Normal</div>
8 </div> 8 </div>
9 9
10 <div id="T1"> 10 <div id="T1">
(...skipping 19 matching lines...) Expand all
30 testSurroundContents("<details>", "details-target", T3); 30 testSurroundContents("<details>", "details-target", T3);
31 31
32 function testSurroundContents(description, targetPath, newParent) { 32 function testSurroundContents(description, targetPath, newParent) {
33 test(function () { 33 test(function () {
34 var target = getNodeInComposedTree(targetPath); 34 var target = getNodeInComposedTree(targetPath);
35 var range = document.createRange(); 35 var range = document.createRange();
36 range.selectNode(target); 36 range.selectNode(target);
37 assert_throws("HierarchyRequestError", function () { 37 assert_throws("HierarchyRequestError", function () {
38 range.surroundContents(newParent); 38 range.surroundContents(newParent);
39 }); 39 });
40 var targetAfter = getNodeInComposedTree(targetPath); 40 assert_equals(newParent.firstChild, null, newParent.id + " should not ha ve children after surroundContents()");
41 assert_equals(targetAfter, target, "DOM should not change after Hierarch yRequestError");
42 }, description); 41 }, description);
43 } 42 }
44 43
45 if (window.testRunner) 44 if (window.testRunner)
46 targets.style.display = "none"; 45 targets.style.display = "none";
47 </script> 46 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698