QUnit test cases for bug 31847: will trigger a fail on IE 6/7/8
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 20 Oct 2011 22:50:04 +0000 (22:50 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 20 Oct 2011 22:50:04 +0000 (22:50 +0000)
commit3db636e4001a8323eb04e1e0662a07a2a73501c6
tree874dea3bc2d51a17dd4289035acaa47d787b6906
parent07ceebd3e28f92543f3b6a0466f78c9978ce2b04
QUnit test cases for bug 31847: will trigger a fail on IE 6/7/8

jquery.textSelection's getCaretPosition() gives bogus results on IE 6/7/8 when there's not a selection set in the textarea; it seems to give us some value somewhere in the middle of the textarea, rather than what we expected.
If we actually set an empty selection, then it gets it back just fine!
But if the cursor is in initial state, or has been moved by the user, we get back garbage. This is causing WikiEditor to sometimes insert things in the wrong place, as it tries to pull the caret position and manipulate the selection to do insertions; we then end up using the bogus selection when it gets saved in via selection restoration.
tests/qunit/suites/resources/jquery/jquery.textSelection.test.js