Skip to content

Commit

Permalink
Move clearing the support vars to before the offset doc ready call in…
Browse files Browse the repository at this point in the history
… 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 d589709
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
@3rd-Eden

3rd-Eden Nov 16, 2011

Shouldn't testElementParent also be cleared here?

This comment has been minimized.

Copy link
@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() {
Expand Down Expand Up @@ -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;
})();

Expand Down

1 comment on commit d589709

@kevin1024
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay, this bug bit me today.

Please sign in to comment.