Index: LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html |
diff --git a/LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html b/LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a9da9ac3f23feca3109fa553fa9a0e74dab3beb5 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html |
@@ -0,0 +1,23 @@ |
+<html> |
+<head> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<div id='test'> |
+ <p id='start'>start</p> |
+ <p id='end'>end</p> |
+</div> |
+<script> |
+var range = document.createRange(); |
+var start = document.getElementById('start'); |
+var end = document.getElementById('end'); |
+range.setStart(start.firstChild, 0); |
+range.setEnd(end.firstChild, 0); |
+ |
+shouldThrow("range.surroundContents(start)", '"InvalidStateError: Failed to execute \'surroundContents\' on \'Range\': The Range has partially selected a non-Text node."'); |
+ |
+if (window.testRunner) |
+ document.getElementById('test').outerHTML = ''; |
+</script> |
+</body> |
+</html> |