summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm')
-rw-r--r--testing/web-platform/tests/old-tests/submission/Microsoft/selection/selectionStartEnd.htm74
1 files changed, 74 insertions, 0 deletions
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>