X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fsupport.js;h=878db1f0ba401d1986b8dbbc0c705fafb66c50ac;hb=0cdcef5b364fa3c89d7f27935e77b453f4a56efd;hp=d35dbed2d847cbed0d346dd35d20dd9642124b32;hpb=d558e9eb6f44783bb06666617c758408daf53e3d;p=jquery.git diff --git a/src/support.js b/src/support.js index d35dbed..878db1f 100644 --- a/src/support.js +++ b/src/support.js @@ -65,7 +65,9 @@ checkClone: false, scriptEval: false, noCloneEvent: true, - boxModel: null + boxModel: null, + inlineBlockNeedsLayout: false, + reliableHiddenOffsets: true }; // Make sure that the options inside disabled selects aren't marked as disabled @@ -117,6 +119,29 @@ document.body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' + // (IE < 8 does this) + if ( 'zoom' in div.style ) { + div.style.display = 'inline'; + + // Layout is necessary to trigger this “feature” + div.style.zoom = 1; + jQuery.support.inlineBlockNeedsLayout = 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; });