Skip to content
Permalink
Browse files

Move clearing the support vars to before the offset doc ready call in…

… case the offset tests are run synchronously. Fixes #10737.

- Adding a test for this would probably slow the manipulation tests significantly, but it's simple enough.
  • Loading branch information...
timmywil committed Nov 10, 2011
1 parent e977a85 commit d5897098510faba7f1c14fdd0ad961add42fb5c1
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/support.js
@@ -253,6 +253,12 @@ jQuery.support = (function() {
}
}

testElement.innerHTML = "";
testElementParent.removeChild( testElement );

// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;

This comment has been minimized.

@3rd-Eden

3rd-Eden Nov 16, 2011

Shouldn't testElementParent also be cleared here?

This comment has been minimized.

@timmywil

timmywil Nov 16, 2011

Author Member

vars that are selections do not need to be cleared to avoid leaks. testElementParent is just a selection of either the existing body or the documentElement. Besides, testElementParent is probably going away in the next release.


// Run fixed position tests at doc ready to avoid a crash
// related to the invisible body in IE8
jQuery(function() {
@@ -311,12 +317,6 @@ jQuery.support = (function() {
jQuery.extend( support, offsetSupport );
});

testElement.innerHTML = "";
testElementParent.removeChild( testElement );

// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;

return support;
})();

1 comment on commit d589709

@kevin1024

This comment has been minimized.

Copy link

kevin1024 commented on d589709 Nov 18, 2011

yay, this bug bit me today.

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.