aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/dimensions.js
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-06-06 23:35:16 -0400
committertimmywil <tim.willison@thisismedium.com>2011-06-06 23:35:16 -0400
commit75203de7435b7f32c69da1dde88aa6708bf6bb7d (patch)
treeaf3ca2da288b538472cee948a3e45f2d2f809a0a /test/unit/dimensions.js
parent80ad14bd14467c547c2867f2677ca581aa29bf33 (diff)
downloadjquery-75203de7435b7f32c69da1dde88aa6708bf6bb7d.tar.gz
jquery-75203de7435b7f32c69da1dde88aa6708bf6bb7d.zip
Optimize width/height retrieval (moved logic to getWH, removed adjustWH). Supplements #9441, #9300.
Diffstat (limited to 'test/unit/dimensions.js')
-rw-r--r--test/unit/dimensions.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js
index 2b0637063..57229199a 100644
--- a/test/unit/dimensions.js
+++ b/test/unit/dimensions.js
@@ -214,23 +214,24 @@ test("outerWidth()", function() {
test("child of a hidden elem has accurate inner/outer/Width()/Height() see #9441 #9300", function() {
expect(8);
- //setup html
- var $divNormal = jQuery( '<div>' ).css({ width: "100px", border: "10px solid white", padding: "2px", margin: "3px" });
- var $divChild = $divNormal.clone();
- var $divHiddenParent = jQuery( '<div>' ).css( "display", "none" ).append( $divChild );
- jQuery( 'body' ).append( $divHiddenParent ).append( $divNormal );
+ // setup html
+ var $divNormal = jQuery("<div>").css({ width: "100px", height: "100px", border: "10px solid white", padding: "2px", margin: "3px" }),
+ $divChild = $divNormal.clone(),
+ $divHiddenParent = jQuery("<div>").css( "display", "none" ).append( $divChild ).appendTo("body");
+ $divNormal.appendTo("body");
- //tests that child div of a hidden div works the same as a normal div
+ // tests that child div of a hidden div works the same as a normal div
equals( $divChild.width(), $divNormal.width(), "child of a hidden element width() is wrong see #9441" );
equals( $divChild.innerWidth(), $divNormal.innerWidth(), "child of a hidden element innerWidth() is wrong see #9441" );
equals( $divChild.outerWidth(), $divNormal.outerWidth(), "child of a hidden element outerWidth() is wrong see #9441" );
equals( $divChild.outerWidth(true), $divNormal.outerWidth( true ), "child of a hidden element outerWidth( true ) is wrong see #9300" );
+
equals( $divChild.height(), $divNormal.height(), "child of a hidden element height() is wrong see #9441" );
equals( $divChild.innerHeight(), $divNormal.innerHeight(), "child of a hidden element innerHeight() is wrong see #9441" );
equals( $divChild.outerHeight(), $divNormal.outerHeight(), "child of a hidden element outerHeight() is wrong see #9441" );
equals( $divChild.outerHeight(true), $divNormal.outerHeight( true ), "child of a hidden element outerHeight( true ) is wrong see #9300" );
- //teardown html
+ // teardown html
$divHiddenParent.remove();
$divNormal.remove();
});