summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/old-tests/submission/Microsoft/selection
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/old-tests/submission/Microsoft/selection')
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm40
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm72
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm73
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm75
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm75
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm80
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm59
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm41
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm73
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm72
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm72
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm32
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm74
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm73
14 files changed, 911 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 000000000..69150236e
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/RemoveElementContainingSelection.htm
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Remove the element containing the selection</title>
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var div1 = document.getElementById("div1");
+ var span1 = document.getElementById("span1");
+ var range = document.createRange();
+ range.selectNode(span1);
+ selection.addRange(range);
+
+ document.body.removeChild(div1);
+
+ if ("" == selection.toString())
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <div id="div1">some text
+ <span id="span1">aaaaaaaa</span>
+ </div>
+ <div id="div2">Remove the element containing the selection</div>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm
new file mode 100644
index 000000000..c4b5e9944
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/addRange.htm
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Add a range to the selection</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount)
+ {
+ var selection = window.getSelection();
+ if (anchorNode != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (anchorOffset != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (focusNode != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (focusOffset != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (collapsed != selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (rangeCount != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+
+ checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, range.collapsed, 1);
+ if (p1.firstChild.nodeValue != selection.toString())
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Add a range to the selection</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm
new file mode 100644
index 000000000..7c2423021
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapse.htm
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Collapse the selection using collapse()</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount)
+ {
+ var selection = window.getSelection();
+ if (anchorNode != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (anchorOffset != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (focusNode != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (focusOffset != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (collapsed != selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (rangeCount != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+ selection.collapse(p1, 0);
+
+ checkSelectionAttributes(p1, 0, p1, 0, true, 1);
+ if ("" != selection.toString())
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Collapse the selection using collapse()</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm
new file mode 100644
index 000000000..2f68ec655
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToEnd.htm
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Collapse the selection with collapseToEnd()</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount)
+ {
+ var selection = window.getSelection();
+ if (anchorNode != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (anchorOffset != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (focusNode != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (focusOffset != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (collapsed != selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (rangeCount != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+ selection.collapseToEnd();
+
+ range.collapse(false);
+
+ checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, true, 1);
+ if ("" != selection.toString())
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Collapse the selection with collapseToEnd()</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm
new file mode 100644
index 000000000..da9676d57
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/collapseToStart.htm
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Collapse the selection with collapseToStart()</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount)
+ {
+ var selection = window.getSelection();
+ if (anchorNode != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (anchorOffset != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (focusNode != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (focusOffset != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (collapsed != selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (rangeCount != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+ selection.collapseToStart();
+
+ range.collapse(true);
+
+ checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, true, 1);
+ if ("" != selection.toString())
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Collapse the selection with collapseToStart()</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm
new file mode 100644
index 000000000..2373939cc
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/deleteFromDocument.htm
@@ -0,0 +1,80 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Delete some text from the document while it is part of a selection</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkSelectionAttributes(anchorNode, anchorOffset, focusNode, focusOffset, collapsed, rangeCount)
+ {
+ var selection = window.getSelection();
+ if (anchorNode != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (anchorOffset != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (focusNode != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (focusOffset != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (collapsed != selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (rangeCount != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p2 = document.getElementById("p2");
+ var expectedResult = "abcdeuvwxyz";
+
+ var range = document.createRange();
+ range.setStart(p2.firstChild, 5);
+ range.setEnd(p2.firstChild, 20);
+ selection.addRange(range);
+ selection.deleteFromDocument();
+ p2.normalize();
+
+ range.collapse(true);
+
+ checkSelectionAttributes(range.startContainer, range.startOffset, range.endContainer, range.endOffset, true, 1);
+
+ if (expectedResult != p2.firstChild.data)
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Delete some text from the document while it is part of a selection</p>
+ <p id="p2">abcdefghijklmnopqrstuvwxyz</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm
new file mode 100644
index 000000000..a3911e6cd
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/getRangeAt.htm
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Get the range from the selection</title>
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+ var testPassed = true;
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+
+ var returnedRange = selection.getRangeAt(0);
+
+ if (range.toString() != returnedRange.toString())
+ {
+ testPassed = false;
+ }
+ if (range.startContainer != returnedRange.startContainer)
+ {
+ testPassed = false;
+ }
+ if (range.startOffset != returnedRange.startOffset)
+ {
+ testPassed = false;
+ }
+ if (range.endContainer != returnedRange.endContainer)
+ {
+ testPassed = false;
+ }
+ if (range.endOffset != returnedRange.endOffset)
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Get the range from the selection</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm
new file mode 100644
index 000000000..4ec0d80f3
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/insertNodeIntoSelection.htm
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Insert a new element and text node into an element that is currently selected</title>
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var expectedText = "some textnew text";
+ var div1 = document.getElementById("div1");
+ var range = document.createRange();
+ range.selectNode(div1);
+ selection.addRange(range);
+
+ var ele = document.createElement("div");
+ var tNode = document.createTextNode("new text");
+ ele.appendChild(tNode);
+ div1.appendChild(ele);
+
+ if (expectedText == selection.toString())
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p>This test inserts a new element with a text node child into the current selection.</p>
+ <div id="div1">some text</div>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm
new file mode 100644
index 000000000..869e5391d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeAllRanges.htm
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Call removeAllRanges() to clear the selection</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkDefaultSelectionAttributes()
+ {
+ var selection = window.getSelection();
+ if (null != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (null != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (!selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+ selection.removeAllRanges();
+
+ checkDefaultSelectionAttributes();
+ if ("" != selection.toString())
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Call removeAllRanges() to clear the selection</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm
new file mode 100644
index 000000000..e35047b47
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/removeRange.htm
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Remove the range from the selection</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkDefaultSelectionAttributes()
+ {
+ var selection = window.getSelection();
+ if (null != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (null != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (!selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var p1 = document.getElementById("p1");
+
+ var range = document.createRange();
+ range.selectNode(p1);
+ selection.addRange(range);
+ selection.removeRange(range);
+
+ checkDefaultSelectionAttributes();
+ if ("" != selection.toString())
+ {
+ testPassed = false;
+ }
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <p id="p1">Remove the range from the selection by calling removeRange()</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm
new file mode 100644
index 000000000..f6a31f249
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/select.htm
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Call select() on a text field</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkDefaultSelectionAttributes()
+ {
+ var selection = window.getSelection();
+ if (null != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (null != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (!selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var input1 = document.getElementById("input1");
+
+ input1.select();
+
+ checkDefaultSelectionAttributes();
+
+ var selectionText = input1.value.substring(input1.selectionStart, input1.selectionEnd);
+ if (input1.value != selectionText)
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <input style="WIDTH: 500px" id="input1" value="Some text in an input control" type="text" />
+ <p>Select the text in the input element by calling select()</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm
new file mode 100644
index 000000000..a3ab4f57d
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectAllChildren.htm
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Call selectAllChildren() where the parameter is a text node</title>
+ <script type="text/javascript">
+ function RunTest()
+ {
+ try
+ {
+ var selection = window.getSelection();
+ var div1 = document.getElementById("div1");
+ selection.selectAllChildren(div1.firstChild);
+
+ if ("" == selection.toString())
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <div id="div1">Call selectAllChildren() where the parameter is a text node</div>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm
new file mode 100644
index 000000000..c5b69d570
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Set selectionStart and selectionEnd on a text field</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkDefaultSelectionAttributes()
+ {
+ var selection = window.getSelection();
+ if (null != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (null != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (!selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var input1 = document.getElementById("input1");
+ var expectedResult = "text";
+
+ input1.selectionStart = 5;
+ input1.selectionEnd = 9;
+
+ checkDefaultSelectionAttributes();
+
+ var selectionText = input1.value.substring(input1.selectionStart, input1.selectionEnd);
+ if (expectedResult != selectionText)
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <input style="WIDTH: 500px" id="input1" value="Some text in an input control" type="text" />
+ <p>Select some text in the input element by setting selectionStart and selectionEnd</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm
new file mode 100644
index 000000000..a6d7a0f2b
--- /dev/null
+++ b/testing/web-platform/tests/old-tests/submission/Microsoft/selection/setSelectionRange.htm
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title id="desc">HTML5 Selection: Call setSelectionRange() on a text field</title>
+ <script type="text/javascript">
+ var testPassed = true;
+
+ function checkDefaultSelectionAttributes()
+ {
+ var selection = window.getSelection();
+ if (null != selection.anchorNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.anchorOffset)
+ {
+ testPassed = false;
+ }
+ if (null != selection.focusNode)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.focusOffset)
+ {
+ testPassed = false;
+ }
+ if (!selection.isCollapsed)
+ {
+ testPassed = false;
+ }
+ if (0 != selection.rangeCount)
+ {
+ testPassed = false;
+ }
+ }
+
+ function RunTest()
+ {
+ try
+ {
+ var input1 = document.getElementById("input1");
+ var expectedResult = "input";
+
+ input1.setSelectionRange(16, 21);
+
+ checkDefaultSelectionAttributes();
+
+ var selectionText = input1.value.substring(input1.selectionStart, input1.selectionEnd);
+ if (expectedResult != selectionText)
+ {
+ testPassed = false;
+ }
+
+ if (testPassed)
+ {
+ document.getElementById("testresult").firstChild.data = "PASS";
+ }
+ }
+ catch (ex)
+ {
+ document.getElementById("testresult").firstChild.data = "FAIL";
+ }
+ }
+ </script>
+ </head>
+ <body onload="RunTest();">
+ <input style="WIDTH: 500px" id="input1" value="Some text in an input control" type="text" />
+ <p>Call setSelectionRange() on the input element to select some of the text</p>
+ <p>Test passes if the word "PASS" appears below.</p>
+ <div>Test result: </div>
+ <div id="testresult">FAIL</div>
+ </body>
+</html>