- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
- try {
- div.test = 1;
- delete doc.test;
-
- } catch(e) {
- jQuery.support.deleteExpando = false;
- }
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ div.innerHTML = '<table><tr><td style="display:none"></td><td>t</td></tr></table>';
+ jQuery.support.reliableHiddenOffsets = div.getElementsByTagName('td')[0].offsetHeight === 0;
+ div.innerHTML = '';