@@ -149,22 +149,27 @@ define( [
149
149
div . removeChild ( contents ) ;
150
150
}
151
151
152
- // Support: IE8
152
+ // Support: IE6-8
153
+ // First check that getClientRects works as expected
153
154
// Check if table cells still have offsetWidth/Height when they are set
154
155
// to display:none and there are still other visible table cells in a
155
156
// table row; if so, offsetWidth/Height are not reliable for use when
156
157
// determining if an element has been hidden directly using
157
158
// display:none (it is still safe to use offsets if a parent element is
158
159
// hidden; don safety goggles and see bug #4512 for more information).
159
- div . innerHTML = "<table><tr><td></td><td>t</td></tr></table>" ;
160
- contents = div . getElementsByTagName ( "td" ) ;
161
- contents [ 0 ] . style . cssText = "margin:0;border:0;padding:0;display:none" ;
162
- reliableHiddenOffsetsVal = contents [ 0 ] . offsetHeight === 0 &&
163
- contents [ 0 ] . getClientRects ( ) . length === 0 ;
160
+ div . style . display = "none" ;
161
+ reliableHiddenOffsetsVal = div . getClientRects ( ) . length === 0 ;
164
162
if ( reliableHiddenOffsetsVal ) {
165
- contents [ 0 ] . style . display = "" ;
166
- contents [ 1 ] . style . display = "none" ;
163
+ div . style . display = "" ;
164
+ div . innerHTML = "<table><tr><td></td><td>t</td></tr></table>" ;
165
+ contents = div . getElementsByTagName ( "td" ) ;
166
+ contents [ 0 ] . style . cssText = "margin:0;border:0;padding:0;display:none" ;
167
167
reliableHiddenOffsetsVal = contents [ 0 ] . offsetHeight === 0 ;
168
+ if ( reliableHiddenOffsetsVal ) {
169
+ contents [ 0 ] . style . display = "" ;
170
+ contents [ 1 ] . style . display = "none" ;
171
+ reliableHiddenOffsetsVal = contents [ 0 ] . offsetHeight === 0 ;
172
+ }
168
173
}
169
174
170
175
// Teardown
0 commit comments