diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2017-07-31 12:36:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-31 12:36:54 -0400 |
commit | a49578499ec88c9fbca59ff0c80b23b798a55d99 (patch) | |
tree | 80d8ca0285711d25189fb1441254c062b56209f4 /test/unit/dimensions.js | |
parent | 262acc6f1e0f71a3a8b786e3c421b2e645799ea0 (diff) | |
download | jquery-a49578499ec88c9fbca59ff0c80b23b798a55d99.tar.gz jquery-a49578499ec88c9fbca59ff0c80b23b798a55d99.zip |
Dimensions: Improve offsetWidth/offsetHeight fallback
Fixes gh-3698
Fixes gh-3602
Closes gh-3738
Diffstat (limited to 'test/unit/dimensions.js')
-rw-r--r-- | test/unit/dimensions.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js index 13cd9662b..991a59113 100644 --- a/test/unit/dimensions.js +++ b/test/unit/dimensions.js @@ -544,6 +544,25 @@ QUnit.test( "width/height on an inline element with no explicitly-set dimensions } ); } ); +QUnit.test( "width/height on a table row with phantom borders (gh-3698)", function( assert ) { + assert.expect( 4 ); + + jQuery( "<table id='gh3698' style='border-collapse: separate; border-spacing: 0;'><tbody>" + + "<tr style='margin: 0; border: 10px solid black; padding: 0'>" + + "<td style='margin: 0; border: 0; padding: 0; height: 42px; width: 42px;'></td>" + + "</tr>" + + "</tbody></table>" ).appendTo( "#qunit-fixture" ); + + var $elem = jQuery( "#gh3698 tr" ); + + jQuery.each( [ "Width", "Height" ], function( i, method ) { + assert.equal( $elem[ "outer" + method ](), 42, + "outer" + method + " should match content dimensions" ); + assert.equal( $elem[ "outer" + method ]( true ), 42, + "outer" + method + "(true) should match content dimensions" ); + } ); +} ); + QUnit.test( "interaction with scrollbars (gh-3589)", function( assert ) { assert.expect( 48 ); |