From 0b352f6cb58a1ece3f5d1fb978cdb40bd5b0e854 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Fri, 15 Jun 2012 21:20:41 -0400 Subject: Fix #9505, percentage position values in Webkit, closes gh-825. --- test/unit/css.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/unit') diff --git a/test/unit/css.js b/test/unit/css.js index ea57c9abe..ac8795749 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -713,12 +713,23 @@ test("can't get background-position in IE<9, see #10796", function() { } }); -test("percentage position properties in IE<9 should not be incorrectly transformed to pixels, see #11311", function() { +test("percentage properties for bottom and right in IE<9 should not be incorrectly transformed to pixels, see #11311", function() { expect( 1 ); var div = jQuery("
").appendTo( "#qunit-fixture" ); ok( window.getComputedStyle || div.css( "bottom" ) === "50%", "position properties get incorrectly transformed in IE<8, see #11311" ); }); +if ( jQuery.fn.offset ) { + test("percentage properties for left and top should be transformed to pixels, see #9505", function() { + expect( 2 ); + var parent = jQuery("
").appendTo( "#qunit-fixture" ), + div = jQuery("
").appendTo( parent ); + + equal( div.css("top"), "100px", "position properties not transformed to pixels, see #9505" ); + equal( div.css("left"), "100px", "position properties not transformed to pixels, see #9505" ); + }); +} + test("Do not append px to 'fill-opacity' #9548", 1, function() { var $div = jQuery("
").appendTo("#qunit-fixture").css("fill-opacity", 1); equal( $div.css("fill-opacity"), 1, "Do not append px to 'fill-opacity'"); -- cgit v1.2.3