Add return in the offset support tests if the body is not present in frameset docs

This commit is contained in:
timmywil 2011-11-01 12:02:22 -04:00
parent 52afe20860
commit 969fcc16bc

View File

@ -266,6 +266,12 @@ jQuery.support = (function() {
// Reconstruct a container // Reconstruct a container
body = document.getElementsByTagName("body")[0]; body = document.getElementsByTagName("body")[0];
if ( !body ) {
// Return for frameset docs that don't have a body
// These tests cannot be done
return;
}
container = document.createElement("div"); container = document.createElement("div");
container.style.cssText = vb + "width:0;height:0;position:static;top:0;marginTop:" + conMarginTop + "px"; container.style.cssText = vb + "width:0;height:0;position:static;top:0;marginTop:" + conMarginTop + "px";
body.insertBefore( container, body.firstChild ); body.insertBefore( container, body.firstChild );