diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-04-10 17:18:00 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-04-10 17:26:52 -0400 |
commit | d7217cc29c24f582198ce2df7db54a55625e8259 (patch) | |
tree | c6208b2631c8c30a9f9489226faca7a4f389fe33 /test | |
parent | 5376a809c0d2bee4b7872847c2821e458dfdcc3b (diff) | |
download | jquery-d7217cc29c24f582198ce2df7db54a55625e8259.tar.gz jquery-d7217cc29c24f582198ce2df7db54a55625e8259.zip |
Fix 11004. getWH() box-sizing:border-box includes padding and border.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/css.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index 8e7f8ec10..6d0b39f81 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -555,6 +555,18 @@ test("outerWidth(true) and css('margin') returning % instead of px in Webkit, se equal( el.outerWidth(true), 400, "outerWidth(true) and css('margin') returning % instead of px in Webkit, see #10639" ); }); +test("css('width') should respect box-sizing, see #11004", function() { + var el_disconnected = jQuery("<div style='width:300px;margin:2px;padding:2px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>"), + el = el_disconnected.clone().appendTo("#qunit-fixture"), + width_initial = el.css("width"), + width_roundtrip = el.css("width", el.css("width")).css("width"), + width_initial_disconnected = el_disconnected.css("width"), + width_roundtrip_disconnected = el_disconnected.css("width", el_disconnected.css("width")).css("width"); + + equal( width_roundtrip, width_initial, "css('width') is not respecting box-sizing, see #11004"); + equal( width_roundtrip_disconnected, width_initial_disconnected, "css('width') is not respecting box-sizing for disconnected element, see #11004"); +}); + test( "cssHooks - expand", function() { expect( 15 ); var result, |