X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fsupport.js;h=429825083396aed0acdbb8b3d3c6d84763a7a1a9;hb=985856b823b1648bffc3fd63c1faf836d0ddaf7c;hp=c334e78d600cd113609cc32da7e06e2f2bdc4fc2;hpb=122b672f704cca094de50dfef05e88faa84cb51d;p=jquery.git
diff --git a/src/support.js b/src/support.js
index c334e78..4298250 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];
@@ -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";
@@ -78,15 +75,25 @@
root.removeChild( script );
if ( div.attachEvent && div.fireEvent ) {
- div.attachEvent("onclick", function(){
+ div.attachEvent("onclick", function click(){
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
jQuery.support.noCloneEvent = false;
- div.detachEvent("onclick", arguments.callee);
+ div.detachEvent("onclick", click);
});
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 = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ });
})();
var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
@@ -101,5 +108,5 @@ jQuery.props = {
maxlength: "maxLength",
cellspacing: "cellSpacing",
rowspan: "rowSpan",
- tabindex: jQuery.support.tabindex ? "tabindex" : "tabIndex"
+ tabindex: "tabIndex"
};