diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-05-08 22:56:51 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2013-05-13 18:17:25 -0400 |
commit | 3971c2ebb2e6729fe80bac4ee7b91bc02f26486f (patch) | |
tree | b447f875ab3309459471dcb506f45c94144e332f /test | |
parent | c1b8edfcc90961290f7555c55851209bc860c0b4 (diff) | |
download | jquery-3971c2ebb2e6729fe80bac4ee7b91bc02f26486f.tar.gz jquery-3971c2ebb2e6729fe80bac4ee7b91bc02f26486f.zip |
Fix #13855: line-height animations. Close gh-1265.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/effects.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/unit/effects.js b/test/unit/effects.js index 1b2bee85a..47bc9b4b6 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -1371,6 +1371,44 @@ test("Do not append px to 'fill-opacity' #9548", 1, function() { }); }); +test("line-height animates correctly (#13855)", function() { + expect( 12 ); + stop(); + + var + animated = jQuery( + "<p style='line-height: 4;'>unitless</p>" + + "<p style='line-height: 50px;'>px</p>" + + "<p style='line-height: 120%;'>percent</p>" + + "<p style='line-height: 1.5em;'>em</p>" + ).appendTo("#qunit-fixture"), + initialHeight = jQuery.map( animated, function( el ) { + return jQuery( el ).height(); + }); + + animated.animate( { "line-height": "hide" }, 1500 ); + setTimeout(function() { + animated.each(function( i ) { + var label = jQuery.text( this ), + initial = initialHeight[ i ], + height = jQuery( this ).height(); + ok( height < initial, "hide " + label + ": upper bound" ); + ok( height > initial / 2, "hide " + label + ": lower bound" ); + }); + animated.stop( true, true ).hide().animate( { "line-height": "show" }, 1500 ); + setTimeout(function() { + animated.each(function( i ) { + var label = jQuery.text( this ), + initial = initialHeight[ i ], + height = jQuery( this ).height(); + ok( height < initial / 2, "show " + label + ": upper bound" ); + }); + animated.stop( true, true ); + start(); + }, 400 ); + }, 400 ); +}); + // Start 1.8 Animation tests asyncTest( "jQuery.Animation( object, props, opts )", 4, function() { var animation, |