Fixed boxModel support - is now computed with feature detection, rather than sniffing.
[jquery.git] / src / support.js
index 20289c9..b89a9d7 100644 (file)
@@ -53,7 +53,8 @@
 
                // Will be defined later
                scriptEval: false,
-               noCloneEvent: true
+               noCloneEvent: true,
+               boxModel: null
        };
        
        script.type = "text/javascript";
                        // 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"
+};