diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2016-01-06 16:24:22 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2016-01-06 16:24:22 -0500 |
commit | 1f85ded20444ab9b1c48ff33bfaa00668941e98b (patch) | |
tree | 9af3a8837a79a2144ed7ef6a44a5560a093d1986 /src/effects | |
parent | 24ada82ce803f68d65d47218800208844eadab68 (diff) | |
download | jquery-1f85ded20444ab9b1c48ff33bfaa00668941e98b.tar.gz jquery-1f85ded20444ab9b1c48ff33bfaa00668941e98b.zip |
Effects: add back support.shrinkWrapBlocks() for ie6
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/support.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/effects/support.js b/src/effects/support.js new file mode 100644 index 000000000..22d4ecb2e --- /dev/null +++ b/src/effects/support.js @@ -0,0 +1,58 @@ +define( [ + "../var/support", + "../var/document" +], function( support, document ) { + +( function() { + var shrinkWrapBlocksVal; + + support.shrinkWrapBlocks = function() { + if ( shrinkWrapBlocksVal != null ) { + return shrinkWrapBlocksVal; + } + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + // Minified: var b,c,d + var div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Test fired too early or in an unsupported environment, exit. + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + if ( typeof div.style.zoom !== "undefined" ) { + + // Reset CSS: box-sizing; display; margin; border + div.style.cssText = + + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;" + + "padding:1px;width:1px;zoom:1"; + div.appendChild( document.createElement( "div" ) ).style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; + } + + body.removeChild( container ); + + return shrinkWrapBlocksVal; + }; + +} )(); + +return support; + +} ); |