From 4eeae8b0bc789ad525e98568cffb37b04b27ae84 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 30 Dec 2010 01:16:39 -0600 Subject: [PATCH] Remove patch for very early versions of Opera 9 that made it impossible to animate values smaller than -10000. Fixes #7193. Thanks to igorw for initial patch & test case. --- src/effects.js | 2 +- test/unit/effects.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/effects.js b/src/effects.js index 5f3a035f..bd57ffc3 100644 --- a/src/effects.js +++ b/src/effects.js @@ -337,7 +337,7 @@ jQuery.fx.prototype = { } var r = parseFloat( jQuery.css( this.elem, this.prop ) ); - return r && r > -10000 ? r : 0; + return r || 0; }, // Start an animation from one number to another diff --git a/test/unit/effects.js b/test/unit/effects.js index e96f6b6f..b7b60abb 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -560,6 +560,23 @@ jQuery.checkOverflowDisplay = function(){ start(); } +test("support negative values < -10000 (bug #7193)", function () { + expect(1); + stop(); + + jQuery.extend(jQuery.fx.step, { + "marginBottom": function(fx) { + equals( fx.cur(), -11000, "Element has margin-bottom of -11000" ); + delete jQuery.fx.step.marginBottom; + } + }); + + jQuery("#main").css("marginBottom", "-11000px").animate({ marginBottom: "-11001px" }, { + duration: 1, + complete: start + }); +}); + test("JS Overflow and Display", function() { expect(2); stop();