Skip to content

Commit 77f9b1e

Browse files
committed
CSS: fix reliableHiddenOffsets support test for IE6-7
1 parent ce4d7ca commit 77f9b1e

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

src/css/support.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,27 @@ define( [
149149
div.removeChild( contents );
150150
}
151151

152-
// Support: IE8
152+
// Support: IE6-8
153+
// First check that getClientRects works as expected
153154
// Check if table cells still have offsetWidth/Height when they are set
154155
// to display:none and there are still other visible table cells in a
155156
// table row; if so, offsetWidth/Height are not reliable for use when
156157
// determining if an element has been hidden directly using
157158
// display:none (it is still safe to use offsets if a parent element is
158159
// 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;
164162
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";
167167
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+
}
168173
}
169174

170175
// Teardown

test/unit/support.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,12 @@ testIframeWithCallback(
283283
} else if ( /msie 7\.0/i.test( userAgent ) ) {
284284
expected = {
285285
"ajax": true,
286-
"appendChecked": true,
286+
"appendChecked": false,
287287
"attributes": false,
288-
"boxSizing": true,
288+
"boxSizing": false,
289289
"boxSizingReliable": false,
290290
"change": false,
291-
"checkClone": true,
291+
"checkClone": false,
292292
"checkOn": true,
293293
"clearCloneStyle": true,
294294
"cors": false,
@@ -297,12 +297,12 @@ testIframeWithCallback(
297297
"deleteExpando": false,
298298
"enctype": true,
299299
"focusin": true,
300-
"getSetAttribute": true,
301-
"hrefNormalized": true,
300+
"getSetAttribute": false,
301+
"hrefNormalized": false,
302302
"html5Clone": false,
303303
"htmlSerialize": false,
304-
"inlineBlockNeedsLayout": false,
305-
"input": false,
304+
"inlineBlockNeedsLayout": true,
305+
"input": true,
306306
"leadingWhitespace": false,
307307
"noCloneChecked": false,
308308
"noCloneEvent": false,
@@ -318,7 +318,7 @@ testIframeWithCallback(
318318
"reliableMarginLeft": false,
319319
"style": false,
320320
"submit": false,
321-
"tbody": true
321+
"tbody": false
322322
};
323323
} else if ( /msie 6\.0/i.test( userAgent ) ) {
324324
expected = {

0 commit comments

Comments
 (0)