aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-07-22 21:58:23 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-07-22 22:03:27 -0400
commitaa3fabce461313f7c31e9a250df57165f15be873 (patch)
tree5b1a227fd3fc96d6f8ec6b60670d467689dfd760 /test/unit
parentff7a43456228826856f5f14f22fbe2d61ef59bf5 (diff)
downloadjquery-aa3fabce461313f7c31e9a250df57165f15be873.tar.gz
jquery-aa3fabce461313f7c31e9a250df57165f15be873.zip
Fix #12088, Safari 5 and more percentages in getComputedStyle
In particular, min-width and max-width are taunting the awesome hack. Closes gh-865.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/css.js9
-rw-r--r--test/unit/dimensions.js7
2 files changed, 9 insertions, 7 deletions
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("<div/>").width( 400 ).appendTo("#qunit-fixture"),
+ el = jQuery("<div/>").css({ "width": "50%", "marginRight": "50%" }).appendTo( container ),
+ el2 = jQuery("<div/>").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( "<div>" ).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( "<div/>" ).width(400).appendTo( "#qunit-fixture" ),
- el = jQuery( "<div/>" ).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 );