From aa3fabce461313f7c31e9a250df57165f15be873 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Sun, 22 Jul 2012 21:58:23 -0400 Subject: Fix #12088, Safari 5 and more percentages in getComputedStyle In particular, min-width and max-width are taunting the awesome hack. Closes gh-865. --- test/unit/css.js | 9 +++++++++ test/unit/dimensions.js | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'test/unit') diff --git a/test/unit/css.js b/test/unit/css.js index 9880a8bdb..45aee9f06 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -641,6 +641,15 @@ test("marginRight computed style (bug #3333)", function() { equal($div.css("marginRight"), "0px", "marginRight correctly calculated with a width and display block"); }); +test("box model properties incorrectly returning % instead of px, see #10639 and #12088", function() { + var container = jQuery("
").width( 400 ).appendTo("#qunit-fixture"), + el = jQuery("
").css({ "width": "50%", "marginRight": "50%" }).appendTo( container ), + el2 = jQuery("
").css({ "width": "50%", "minWidth": "300px", "marginLeft": "25%" }).appendTo( container ); + + equal( el.css("marginRight"), "200px", "css('marginRight') returning % instead of px, see #10639" ); + equal( el2.css("marginLeft"), "100px", "css('marginLeft') returning incorrect pixel value, see #12088" ); +}); + test("jQuery.cssProps behavior, (bug #8402)", function() { var div = jQuery( "
" ).appendTo(document.body).css({ "position": "absolute", diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js index 4c8cf5788..8b03b9ffc 100644 --- a/test/unit/dimensions.js +++ b/test/unit/dimensions.js @@ -292,13 +292,6 @@ test("getting dimensions shouldnt modify runtimeStyle see #9233", function() { $div.remove(); }); -test("outerWidth(true) returning % instead of px in Webkit, see #10639", function() { - var container = jQuery( "
" ).width(400).appendTo( "#qunit-fixture" ), - el = jQuery( "
" ).css({ "width": "50%", "marginRight": "50%" }).appendTo( container ); - - equal( el.outerWidth(true), 400, "outerWidth(true) and css('margin') returning % instead of px in Webkit, see #10639" ); -}); - test( "getting dimensions of zero width/height table elements shouldn't alter dimensions", function() { expect( 1 ); -- cgit v1.2.3