X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fsupport.js;h=6139395df10bd5754cc2101d2c50717750a52c46;hb=82958c79ff7604b1854a58cf161e8d6691bed6ac;hp=c334e78d600cd113609cc32da7e06e2f2bdc4fc2;hpb=122b672f704cca094de50dfef05e88faa84cb51d;p=jquery.git
diff --git a/src/support.js b/src/support.js
index c334e78..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];
@@ -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"
};