1 <div>Tests that setting selectionEnd on a blurred text control does not clobber selectionStart.
</div>
2 <textarea>This is dummy text. This is dummy text.
</textarea>
3 <input value=
"This is dummy text. This is dummy text">
4 <pre id=
"logger"></pre>
7 testRunner
.dumpAsText();
9 function assert(property
, actual
, expected
)
11 if (expected
== actual
)
14 result
= "FAIL: " + property
+ " was " + actual
+ " expected " + expected
+ ".";
16 document
.getElementById('logger').innerHTML
+= result
+ "\n";
19 function runTest(editArea
)
21 editArea
.selectionStart
= 10;
23 assert("selectionStart", editArea
.selectionStart
, 10);
24 editArea
.selectionEnd
= 20;
25 assert("selectionStart", editArea
.selectionStart
, 10);
26 assert("selectionEnd", editArea
.selectionEnd
, 20);
28 runTest(document
.querySelector('textarea'));
29 runTest(document
.querySelector('input'));