]> source.dussan.org Git - jquery.git/commitdiff
CSS: fix reliableHiddenOffsets support test for IE6-7
authorTimmy Willison <timmywillisn@gmail.com>
Wed, 6 Jan 2016 02:29:04 +0000 (21:29 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Wed, 6 Jan 2016 19:05:18 +0000 (14:05 -0500)
src/css/support.js
test/unit/support.js

index 6ff4cb19f99c0bada7b4936dd5343049162fd698..fbefc7b338964d01f76645196d3c55ee13ff982d 100644 (file)
@@ -149,22 +149,27 @@ define( [
                        div.removeChild( contents );
                }
 
-               // Support: IE8
+               // Support: IE6-8
+               // First check that getClientRects works as expected
                // 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).
-               div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-               contents = div.getElementsByTagName( "td" );
-               contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
-               reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0 &&
-                       contents[ 0 ].getClientRects().length === 0;
+               div.style.display = "none";
+               reliableHiddenOffsetsVal = div.getClientRects().length === 0;
                if ( reliableHiddenOffsetsVal ) {
-                       contents[ 0 ].style.display = "";
-                       contents[ 1 ].style.display = "none";
+                       div.style.display = "";
+                       div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+                       contents = div.getElementsByTagName( "td" );
+                       contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
                        reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+                       if ( reliableHiddenOffsetsVal ) {
+                               contents[ 0 ].style.display = "";
+                               contents[ 1 ].style.display = "none";
+                               reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+                       }
                }
 
                // Teardown
index 41e45c59c82f192e1d13e0a9660475c5f57274da..b75074e28f76855bff95e965779c6e35a3778a0c 100644 (file)
@@ -283,12 +283,12 @@ testIframeWithCallback(
        } else if ( /msie 7\.0/i.test( userAgent ) ) {
                expected = {
                        "ajax": true,
-                       "appendChecked": true,
+                       "appendChecked": false,
                        "attributes": false,
-                       "boxSizing": true,
+                       "boxSizing": false,
                        "boxSizingReliable": false,
                        "change": false,
-                       "checkClone": true,
+                       "checkClone": false,
                        "checkOn": true,
                        "clearCloneStyle": true,
                        "cors": false,
@@ -297,12 +297,12 @@ testIframeWithCallback(
                        "deleteExpando": false,
                        "enctype": true,
                        "focusin": true,
-                       "getSetAttribute": true,
-                       "hrefNormalized": true,
+                       "getSetAttribute": false,
+                       "hrefNormalized": false,
                        "html5Clone": false,
                        "htmlSerialize": false,
-                       "inlineBlockNeedsLayout": false,
-                       "input": false,
+                       "inlineBlockNeedsLayout": true,
+                       "input": true,
                        "leadingWhitespace": false,
                        "noCloneChecked": false,
                        "noCloneEvent": false,
@@ -318,7 +318,7 @@ testIframeWithCallback(
                        "reliableMarginLeft": false,
                        "style": false,
                        "submit": false,
-                       "tbody": true
+                       "tbody": false
                };
        } else if ( /msie 6\.0/i.test( userAgent ) ) {
                expected = {