]> source.dussan.org Git - jquery.git/commitdiff
Fix more support tests (support.input should only be false in IE8 and checkClone...
authorTimmy Willison <timmywillisn@gmail.com>
Wed, 11 Sep 2013 22:23:17 +0000 (17:23 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Wed, 11 Sep 2013 22:23:17 +0000 (17:23 -0500)
src/attributes/support.js
src/support.js
test/unit/support.js

index 5d4be1aa4d8bd370e22043ab48767446b8bb4d8e..aeeb3af2f915df361c2e269823f0abb9f63847a3 100644 (file)
@@ -44,8 +44,9 @@ define([
        select.disabled = true;
        support.optDisabled = !opt.disabled;
 
+       // Support: IE8 only
        // Check if we can trust getAttribute("value")
-       input = document.createElement("input");
+       input = document.createElement( "input" );
        input.setAttribute( "value", "" );
        support.input = input.getAttribute( "value" ) === "";
 
index 00fd829285478705520451eef0c409726ae30fc0..3add264bf424f98cee116143d7421f86b8c7bbed 100644 (file)
@@ -23,11 +23,7 @@ jQuery(function() {
        // We need to execute this one support test ASAP because we need to know
        // if body.style.zoom needs to be set.
 
-       var container,
-               div = document.createElement( "div" ),
-               divReset =
-                       "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" +
-                       "display:block;padding:0;margin:0;border:0",
+       var container, div,
                body = document.getElementsByTagName("body")[0];
 
        if ( !body ) {
@@ -36,12 +32,10 @@ jQuery(function() {
        }
 
        // Setup
-       div.setAttribute( "className", "t" );
-       div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
        container = document.createElement( "div" );
        container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
 
+       div = document.createElement( "div" );
        body.appendChild( container ).appendChild( div );
 
        if ( typeof div.style.zoom !== strundefined ) {
@@ -49,10 +43,9 @@ jQuery(function() {
                // Check if natively block-level elements act like inline-block
                // elements when setting their display to 'inline' and giving
                // them layout
-               div.innerHTML = "";
-               div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+               div.style.cssText = "width:1px;padding:1px;display:inline;zoom:1";
 
-               if ( (support.inlineBlockNeedsLayout = div.offsetWidth === 3) ) {
+               if ( (support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 )) ) {
                        // Prevent IE 6 from affecting layout for positioned elements #11048
                        // Prevent IE from shrinking the body in IE 7 mode #12869
                        // Support: IE<8
index 6b5b0baa53f28dc0d89621c7b74c5c13a1eff6e7..a37f2c0225b529f3803fdea7a4a3cfc9e297937a 100644 (file)
@@ -26,6 +26,7 @@ test( "zoom of doom (#13089)", function() {
                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 );
@@ -256,7 +257,7 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
                        "boxSizing": false,
                        "boxSizingReliable": true,
                        "changeBubbles": false,
-                       "checkClone": false,
+                       "checkClone": true,
                        "checkOn": true,
                        "clearCloneStyle": true,
                        "cors": false,
@@ -269,7 +270,7 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
                        "html5Clone": false,
                        "htmlSerialize": false,
                        "inlineBlockNeedsLayout": true,
-                       "input": false,
+                       "input": true,
                        "leadingWhitespace": false,
                        "noCloneChecked": false,
                        "noCloneEvent": false,
@@ -293,7 +294,7 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
                        "boxSizing": false,
                        "boxSizingReliable": true,
                        "changeBubbles": false,
-                       "checkClone": false,
+                       "checkClone": true,
                        "checkOn": true,
                        "clearCloneStyle": true,
                        "cors": false,
@@ -306,7 +307,7 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
                        "html5Clone": false,
                        "htmlSerialize": false,
                        "inlineBlockNeedsLayout": true,
-                       "input": false,
+                       "input": true,
                        "leadingWhitespace": false,
                        "noCloneChecked": false,
                        "noCloneEvent": false,
@@ -380,6 +381,7 @@ testIframeWithCallback( "box-sizing does not affect jQuery.support.shrinkWrapBlo
                        "html5Clone": true,
                        "htmlSerialize": true,
                        "inlineBlockNeedsLayout": false,
+                       "input": true,
                        "leadingWhitespace": true,
                        "noCloneChecked": true,
                        "noCloneEvent": true,