aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.js
diff options
context:
space:
mode:
authortimmywil <timmywillisn@gmail.com>2011-09-28 11:30:38 -0400
committertimmywil <timmywillisn@gmail.com>2011-09-28 11:30:38 -0400
commit3661835101865b08fae20df7458ba03551b86bc3 (patch)
tree132942cf9b847f9a038196b35d69f7365267de9d /src/support.js
parent649823de18564774a5812ae04083606447bd2b93 (diff)
downloadjquery-3661835101865b08fae20df7458ba03551b86bc3.tar.gz
jquery-3661835101865b08fae20df7458ba03551b86bc3.zip
Fixes IE7 test suite. Keep the testElement attached and set necessary styles on it to fix the offset with margin test.
Diffstat (limited to 'src/support.js')
-rw-r--r--src/support.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/support.js b/src/support.js
index 6a77e449c..dc93164a4 100644
--- a/src/support.js
+++ b/src/support.js
@@ -230,7 +230,6 @@ jQuery.support = (function() {
// Remove the body element we added
testElement.innerHTML = "";
- testElementParent.removeChild( testElement );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
@@ -255,12 +254,15 @@ jQuery.support = (function() {
}
// Determine fixed-position support early
+ testElement.style.position = "static";
+ testElement.style.top = "0px";
+ testElement.style.marginTop = "1px";
offsetSupport = (function( body, container ) {
var outer, inner, table, td, supports,
bodyMarginTop = parseFloat( body.style.marginTop ) || 0,
- ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;",
- style = "style='" + ptlm + "margin:0;border:5px solid #000;padding:0;'",
+ ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",
+ style = "style='" + ptlm + "border:5px solid #000;padding:0;'",
html = "<div " + style + "><div></div></div>" +
"<table " + style + " cellpadding='0' cellspacing='0'>" +
"<tr><td></td></tr></table>";
@@ -296,6 +298,7 @@ jQuery.support = (function() {
})( testElement, div );
jQuery.extend( support, offsetSupport );
+ testElementParent.removeChild( testElement );
// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;