jquery.textSelection: Remove incorrect browser hack for old Opera
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 5 Feb 2018 22:13:50 +0000 (23:13 +0100)
committerJforrester <jforrester@wikimedia.org>
Wed, 7 Feb 2018 18:53:39 +0000 (18:53 +0000)
commit5db74eb56e425ba803b2cc936fbe3e5cc219b482
tree7171ebbeb02d07672dc97a9d97af2f5034b27bf5
parent82e996b8c63e1f49525020ad71082c366b9567ba
jquery.textSelection: Remove incorrect browser hack for old Opera

This code appears to be incorrect, at least on Opera 12.18 on Windows 10,
where I just tested it. It causes the selection to be misaligned, rather
than correct it.

For example, the following code:

    $textbox.textSelection( 'encapsulateSelection', { peri: 'foo\nfoo' } );

Causes the selection to extend one character past the inserted text with
the hack, and to be shown correctly without the hack.

It is theoretically possible that this hack was necessary for some other
operating system, but then it should have also been applied to 'insertText'.
Also, Opera 12 only has a usage share (barely) large enough to show up on
<https://analytics.wikimedia.org/dashboards/browsers/> on Windows (XP).

Change-Id: Ifee877c6202bcfc0fecb65220e34b4b39659dbeb
resources/src/jquery/jquery.textSelection.js