Make sure that mousing over Chrome "internal div" elements results in no trigger...
[jquery.git] / src / support.js
index 7be28fd..8b60abd 100644 (file)
                jQuery.support.deleteExpando = false;
        }
 
-       if ( div.attachEvent && div.fireEvent ) {
+       if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
                div.attachEvent("onclick", function click() {
                        // Cloning a node shouldn't copy over any
                        // bound event handlers (IE does this)
        // 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";
+               var div = document.createElement("div"),
+                       body = document.getElementsByTagName("body")[0];
+
+               // Frameset documents with no body should not run this code
+               if ( !body ) {
+                       return;
+               }
 
-               document.body.appendChild( div );
+               div.style.width = div.style.paddingLeft = "1px";
+               body.appendChild( div );
                jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
 
                if ( "zoom" in div.style ) {
                jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
                div.innerHTML = "";
 
-               document.body.removeChild( div ).style.display = "none";
+               body.removeChild( div ).style.display = "none";
                div = tds = null;
        });