X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fsupport.js;h=b89a9d73fb5d651f7e4d3f09f30e3017646c9296;hb=7346a476cc1fe20612fb1e9b08faef27e36a962c;hp=c334e78d600cd113609cc32da7e06e2f2bdc4fc2;hpb=122b672f704cca094de50dfef05e88faa84cb51d;p=jquery.git diff --git a/src/support.js b/src/support.js index c334e78..b89a9d7 100644 --- a/src/support.js +++ b/src/support.js @@ -51,13 +51,10 @@ // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, - // Verify tabindex attribute existence - // (IE uses tabIndex instead of tabindex) - tabindex: !a.getAttributeNode('tabindex'), - // Will be defined later scriptEval: false, - noCloneEvent: true + noCloneEvent: true, + boxModel: null }; script.type = "text/javascript"; @@ -87,6 +84,17 @@ div.cloneNode(true).fireEvent("onclick"); } + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function(){ + var div = document.createElement("div"); + div.style.width = "1px"; + div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + document.body.removeChild( div ); + }); })(); var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; @@ -101,5 +109,5 @@ jQuery.props = { maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", - tabindex: jQuery.support.tabindex ? "tabindex" : "tabIndex" + tabindex: "tabIndex" };