OLD | NEW |
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 Loading... |
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> |
OLD | NEW |