aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-06-15 21:20:41 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-06-15 21:25:25 -0400
commit0b352f6cb58a1ece3f5d1fb978cdb40bd5b0e854 (patch)
treee1b5fc8164ce147cdba540724b0c2c2c529a4ad2 /test/unit
parenta101e81bde71e94170f1fa899432cbe8150910f9 (diff)
downloadjquery-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.js13
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'");