summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm')
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm
new file mode 100644
index 0000000000..1286493a3e
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Remove the element containing the selection</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script type="text/javascript">
+ function RunTest()
+ {
+ var selection = window.getSelection();
+ var div1 = document.getElementById("div1");
+ var span1 = document.getElementById("span1");
+ var range = document.createRange();
+ range.selectNode(span1);
+ selection.addRange(range);
+
+ assert_equals(selection.toString(), span1.textContent);
+ document.body.removeChild(div1);
+ assert_equals(selection.toString(), "");
+ }
+ </script>
+ </head>
+ <body onload="test(RunTest);">
+ <div id="div1">some text
+ <span id="span1">aaaaaaaa</span>
+ </div>
+ <div id="div2">Remove the element containing the selection</div>
+ </body>
+</html>