Commit ad0ebf00 authored by Dave Methvin's avatar Dave Methvin

Don't do body-related feature tests on frameset docs that have no body. Fixes #7398.

parent 328a86f9
...@@ -136,10 +136,16 @@ ...@@ -136,10 +136,16 @@
// Figure out if the W3C box model works as expected // Figure out if the W3C box model works as expected
// document.body must exist before we can do this // document.body must exist before we can do this
jQuery(function() { jQuery(function() {
var div = document.createElement("div"); var div = document.createElement("div"),
div.style.width = div.style.paddingLeft = "1px"; 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; jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
if ( "zoom" in div.style ) { if ( "zoom" in div.style ) {
...@@ -178,7 +184,7 @@ ...@@ -178,7 +184,7 @@
jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
div.innerHTML = ""; div.innerHTML = "";
document.body.removeChild( div ).style.display = "none"; body.removeChild( div ).style.display = "none";
div = tds = null; div = tds = null;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment