]> source.dussan.org Git - jquery.git/commitdiff
Fix #13089. Only apply zoom to IE6/7 body.
authorDave Methvin <dave.methvin@gmail.com>
Sun, 3 Feb 2013 18:54:38 +0000 (13:54 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Sun, 3 Feb 2013 18:54:38 +0000 (13:54 -0500)
src/support.js
test/unit/support.js

index 6e755b55ddceab714d63209448102d8d1e813133..d955bf0c151a6e31bf69ac08ccb0c4dce79c31fa 100644 (file)
@@ -219,9 +219,12 @@ jQuery.support = (function() {
                        div.firstChild.style.width = "5px";
                        support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
 
-                       // Prevent IE 6 from affecting layout for positioned elements #11048
-                       // Prevent IE from shrinking the body in IE 7 mode #12869
-                       body.style.zoom = 1;
+                       if ( support.inlineBlockNeedsLayout ) {
+                               // Prevent IE 6 from affecting layout for positioned elements #11048
+                               // Prevent IE from shrinking the body in IE 7 mode #12869
+                               // Support: IE<8
+                               body.style.zoom = 1;
+                       }
                }
 
                body.removeChild( container );
index 356751d22ab597d9672ebc0420632c12da0a1fb2..60a6582610e37c0f710d535e129ba3a45464f54c 100644 (file)
@@ -6,6 +6,15 @@ test("boxModel", function() {
        equal( jQuery.support.boxModel, document.compatMode === "CSS1Compat" , "jQuery.support.boxModel is sort of tied to quirks mode but unstable since 1.8" );
 });
 
+test( "zoom of doom (#13089)", function() {
+       expect( 1 );
+
+       if ( jQuery.support.inlineBlockNeedsLayout ) {
+               ok( document.body.style.zoom, "Added a zoom to the body (#11048, #12869)" );
+       } else {
+               ok( !document.body.style.zoom, "No zoom added to the body" );
+       }
+});
 if ( jQuery.css ) {
        testIframeWithCallback( "body background is not lost if set prior to loading jQuery (#9239)", "support/bodyBackground.html", function( color, support ) {
                expect( 2 );