diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-05-22 10:11:47 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-05-22 10:11:47 -0400 |
commit | 551f8510d516753a803f8d231138f82544dcb45a (patch) | |
tree | 154b2e9557beec2f7b855a54352296ac4ac92f6b /src/support.js | |
parent | e0151e5827d7091f311c82d9f951aaaa2688ba8c (diff) | |
download | jquery-551f8510d516753a803f8d231138f82544dcb45a.tar.gz jquery-551f8510d516753a803f8d231138f82544dcb45a.zip |
Fix #11443 #11441, shut up Chrome 19 and Safari 5.0.x. Closes gh-790.
checkClone and appendChecked test failures in Chrome 19; reliableMarginRight failures in Safari 5.
Diffstat (limited to 'src/support.js')
-rw-r--r-- | src/support.js | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/support.js b/src/support.js index 8ed47219d..c7c2b5434 100644 --- a/src/support.js +++ b/src/support.js @@ -179,7 +179,8 @@ jQuery.support = (function() { // Run tests that need a body at doc ready jQuery(function() { - var container, offsetSupport, marginDiv, + var container, marginDiv, + divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", conMarginTop = 1, boxSizingPrefixes = [ "", "-moz-", "-webkit-", "" ], body = document.getElementsByTagName("body")[0]; @@ -223,7 +224,7 @@ jQuery.support = (function() { if ( window.getComputedStyle ) { div.innerHTML = ""; marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; + marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = "0"; div.style.width = "2px"; div.appendChild( marginDiv ); @@ -237,11 +238,7 @@ jQuery.support = (function() { // them layout // (IE < 8 does this) div.innerHTML = ""; - div.style.width = div.style.padding = "1px"; - div.style.border = 0; - div.style.overflow = "hidden"; - div.style.display = "inline"; - div.style.zoom = 1; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Check if elements with layout shrink-wrap their children @@ -259,10 +256,7 @@ jQuery.support = (function() { support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; } - offsetSupport = { - doesNotIncludeMarginInBodyOffset: ( body.offsetTop !== conMarginTop ) - }; - + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); if ( typeof container.style.zoom !== "undefined" ) { container.style.zoom = 1; @@ -270,8 +264,6 @@ jQuery.support = (function() { body.removeChild( container ); marginDiv = div = container = null; - - jQuery.extend( support, offsetSupport ); }); return support; |