summaryrefslogtreecommitdiffstats
path: root/layout/reftests/selection/addrange-1.html
diff options
context:
space:
mode:
Diffstat (limited to 'layout/reftests/selection/addrange-1.html')
-rw-r--r--layout/reftests/selection/addrange-1.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/layout/reftests/selection/addrange-1.html b/layout/reftests/selection/addrange-1.html
new file mode 100644
index 000000000..648d42140
--- /dev/null
+++ b/layout/reftests/selection/addrange-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Testcase #2 for bug 602331</title>
+ <script type="text/javascript" charset="utf-8">
+ function selectNewlyAdded() {
+ window.getSelection().removeAllRanges();
+
+ var newNode = document.createElement('span');
+ newNode.innerHTML = "Hello Kitty";
+ document.getElementById('new_nodes').appendChild(newNode);
+ var range = document.createRange();
+ range.selectNode(newNode);
+ window.getSelection().addRange(range);
+ }
+
+ </script>
+ </head>
+ <body onload="selectNewlyAdded()">
+ * <span id="new_nodes"></span> *
+ </body>
+</html>