X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=src%2Fsupport.js;h=299fbd2774fe52bd526a9538a46d68fa4ce1857d;hp=d35dbed2d847cbed0d346dd35d20dd9642124b32;hb=0229b83f7e5bf64edb2888ab349bedcd1a45e7c1;hpb=57c046f91cbc3caf174ecc993fe883c027340901 diff --git a/src/support.js b/src/support.js index d35dbed..299fbd2 100644 --- a/src/support.js +++ b/src/support.js @@ -65,7 +65,8 @@ checkClone: false, scriptEval: false, noCloneEvent: true, - boxModel: null + boxModel: null, + reliableHiddenOffsets: true }; // Make sure that the options inside disabled selects aren't marked as disabled @@ -117,6 +118,18 @@ document.body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = '
t
'; + jQuery.support.reliableHiddenOffsets = div.getElementsByTagName('td')[0].offsetHeight === 0; + div.innerHTML = ''; + document.body.removeChild( div ).style.display = 'none'; div = null; });