From: MatmaRex Date: Sat, 23 Mar 2013 20:03:04 +0000 (+0100) Subject: jquery.textSelection.test: Fix regression in Opera X-Git-Tag: 1.31.0-rc.0~20196^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=a9faef2a155efb9ed1619da0da71b4db0bd29ac9;p=lhc%2Fweb%2Fwiklou.git jquery.textSelection.test: Fix regression in Opera Removing a window.opera-guarded part of code that was supposed to "[c]ompensate for Opera's craziness converting \n to \r\n and counting that as two chars". That craziness was apparently fixed some time ago and the tests were now failing. This makes the QUnit tests pass on Opera again. Bug: 41931 Change-Id: Ide3a95e8e86ee65c8e1ea357aefa44dd2bbd4ed4 --- diff --git a/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js b/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js index ce03b69778..5fe239448f 100644 --- a/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.textSelection.test.js @@ -48,13 +48,6 @@ var start = opt.before.start, end = opt.before.end; - if ( window.opera ) { - // Compensate for Opera's craziness converting \n to \r\n and counting that as two chars - var newLinesBefore = opt.before.text.substring( 0, start ).split( '\n' ).length - 1, - newLinesInside = opt.before.text.substring( start, end ).split( '\n' ).length - 1; - start += newLinesBefore; - end += newLinesBefore + newLinesInside; - } var options = $.extend( {}, opt.replace ); // Clone opt.replace options.selectionStart = start;