Index: LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html |
diff --git a/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html b/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d817d98d28eba8ba2e0515fc3ac5363fcd44d73e |
--- /dev/null |
+++ b/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE html> |
+<html> |
+ <body> |
+ <script src="../../fast/js/resources/js-test-pre.js"></script> |
+ <script> |
+ window.onload = function(){ |
+ var range = document.createRange(); |
+ var rootNode = document.getElementById("root"); |
+ range.setStart(rootNode, 4); |
+ range.setEnd(rootNode, 6); |
+ var parentElement = document.getElementById("targetForSurround"); |
+ range.surroundContents(parentElement); |
+ |
+ shouldBe(range.startContainer.id, rootNode.id); |
+ shouldBe(range.startOffset.toString(), "3"); |
yosin_UTC9
2013/10/04 01:26:36
nit: It is better to write shouldBe('range.startOf
|
+ shouldBe(range.endContainer.id, rootNode.id); |
+ shouldBe(range.startOffset.toString(), "3"); |
+ }; |
+ </script> |
+ <script src="../../fast/js/resources/js-test-post.js"></script> |
+ <div id="root"> |
+ <div id="targetForSurround"></div> |
+ <div id="description">Test that there is no crash when surroundContents is called with a node preceding the current selection.</div> |
+ <div id="trailingNode"></div> |
+ </div> |
+ </body> |
+</html> |