X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fsupport.js;h=6139395df10bd5754cc2101d2c50717750a52c46;hb=7d9d2105406fe7fcdc196df860ca155c3e4c8453;hp=20289c99b214b8ac5756b53f298b730947d1e76d;hpb=c9dd5d997229919b8dd4cc402b7b7a465982071a;p=jquery.git diff --git a/src/support.js b/src/support.js index 20289c9..6139395 100644 --- a/src/support.js +++ b/src/support.js @@ -8,7 +8,7 @@ id = "script" + (new Date).getTime(); div.style.display = "none"; - div.innerHTML = '
a'; + div.innerHTML = '
a'; var all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0]; @@ -53,7 +53,8 @@ // Will be defined later scriptEval: false, - noCloneEvent: true + noCloneEvent: true, + boxModel: null }; script.type = "text/javascript"; @@ -78,10 +79,22 @@ // Cloning a node shouldn't copy over any // bound event handlers (IE does this) jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", arguments.callee); }); 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"; @@ -95,5 +108,6 @@ jQuery.props = { readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", - rowspan: "rowSpan" -}; \ No newline at end of file + rowspan: "rowSpan", + tabindex: "tabIndex" +};