From a9faef2a155efb9ed1619da0da71b4db0bd29ac9 Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Sat, 23 Mar 2013 21:03:04 +0100 Subject: [PATCH] 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 --- .../suites/resources/jquery/jquery.textSelection.test.js | 7 ------- 1 file changed, 7 deletions(-) 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; -- 2.20.1