Index: LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
diff --git a/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4983e077a14154ef85a36ba73c6057b0912d2da5 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
@@ -0,0 +1,33 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script type="text/javascript"> |
+function log(msg) |
tkent
2014/05/07 00:54:39
Please remove this and use debug() in ../../resour
yosin_UTC9
2014/05/07 01:06:22
I recommend to use "resources/js-test.js". It prov
harpreet.sk
2014/05/07 11:57:54
Done.
harpreet.sk
2014/05/07 11:57:54
Done.
|
+{ |
+ document.getElementById('res').innerHTML = document.getElementById('res').innerHTML + msg + "<br>"; |
+} |
+ |
+function testSelection() |
+{ |
+ if (window.testRunner) { |
tkent
2014/05/07 00:54:39
We prefer early return.
if (window.testRunner
harpreet.sk
2014/05/07 11:57:54
Done.
|
+ testRunner.dumpAsText(); |
+ var firstInput = document.getElementById('val1'); |
tkent
2014/05/07 00:54:39
Wrong indentation.
harpreet.sk
2014/05/07 11:57:54
Corrected.
|
+ var secondInput = document.getElementById('val2'); |
+ firstInput.selectionStart = 3; |
+ firstInput.selectionEnd = 5; |
+ firstInput.value = "Parsed"; |
+ secondInput.selectionStart = 3; |
+ secondInput.selectionEnd = 5; |
+ secondInput.value = "P"; |
+ log('First Input - Slection start: ' + firstInput.selectionStart + ' and end: ' + firstInput.selectionEnd); |
+ log('Second Input - Slection start: ' + secondInput.selectionStart + ' and end: ' + secondInput.selectionEnd); |
+ } |
+} |
+</script> |
+</head> |
+<body onload="testSelection()"> |
+<input id="val1" type="text" /> |
+<input id="val2" type="text" /> |
+<div id="res"></div> |
+</body> |
+</html> |