Don't do body-related feature tests on frameset docs that have no body. Fixes #7398.
This commit is contained in:
parent
328a86f9a0
commit
ad0ebf00ab
1 changed files with 10 additions and 4 deletions
|
@ -136,10 +136,16 @@
|
|||
// 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];
|
||||
|
||||
document.body.appendChild( div );
|
||||
// Frameset documents with no body should not run this code
|
||||
if ( !body ) {
|
||||
return;
|
||||
}
|
||||
|
||||
div.style.width = div.style.paddingLeft = "1px";
|
||||
body.appendChild( div );
|
||||
jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
|
||||
|
||||
if ( "zoom" in div.style ) {
|
||||
|
@ -178,7 +184,7 @@
|
|||
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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue