diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-06-15 21:20:41 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-06-15 21:25:25 -0400 |
commit | 0b352f6cb58a1ece3f5d1fb978cdb40bd5b0e854 (patch) | |
tree | e1b5fc8164ce147cdba540724b0c2c2c529a4ad2 /test/unit | |
parent | a101e81bde71e94170f1fa899432cbe8150910f9 (diff) | |
download | jquery-0b352f6cb58a1ece3f5d1fb978cdb40bd5b0e854.tar.gz jquery-0b352f6cb58a1ece3f5d1fb978cdb40bd5b0e854.zip |
Fix #9505, percentage position values in Webkit, closes gh-825.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/css.js | 13 |
1 files changed, 12 insertions, 1 deletions
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("<div style='position: absolute; width: 1px; height: 20px; bottom:50%;'></div>").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("<div style='position:relative;width:200px;height:200px;margin:0;padding:0;border-width:0'></div>").appendTo( "#qunit-fixture" ), + div = jQuery("<div style='position: absolute; width: 20px; height: 20px; top:50%; left:50%'></div>").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("<div>").appendTo("#qunit-fixture").css("fill-opacity", 1); equal( $div.css("fill-opacity"), 1, "Do not append px to 'fill-opacity'"); |