]> source.dussan.org Git - jquery.git/commitdiff
Inline the boxModel test, and correct unit test. Closes gh-781.
authorMike Sherov <mike.sherov@gmail.com>
Fri, 18 May 2012 16:40:10 +0000 (12:40 -0400)
committerDave Methvin <dave.methvin@gmail.com>
Fri, 18 May 2012 16:59:31 +0000 (12:59 -0400)
src/support.js
test/unit/support.js

index 61acce40d725e5f66f73c18047b68ffd2edb9d2e..8ed47219d850f461c2f59366fc978c2050dde1ac 100644 (file)
@@ -82,6 +82,9 @@ jQuery.support = (function() {
                // Where outerHTML is undefined, this still works
                html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
 
+               // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
+               boxModel: (document.compatMode === "CSS1Compat"),
+
                // Will be defined later
                submitBubbles: true,
                changeBubbles: true,
@@ -95,9 +98,6 @@ jQuery.support = (function() {
                boxSizingReliable: true
        };
 
-       // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
-       support.boxModel = (document.compatMode === "CSS1Compat");
-
        // Make sure checked status is properly cloned
        input.checked = true;
        support.noCloneChecked = input.cloneNode( true ).checked;
index d4d9dfe8578eaec82d03115c29b1c88b36f92340..8a229f43519447c4a865e423f5b8a0fc5b20172d 100644 (file)
@@ -1,6 +1,10 @@
 module("support", { teardown: moduleTeardown });
 
-ok( jQuery.support.boxModel, "jQuery.support.boxModel is perpetually true since 1.8" );
+test("boxModel", function() {
+       expect( 1 );
+
+       equal( jQuery.support.boxModel, document.compatMode === "CSS1Compat" , "jQuery.support.boxModel is sort of tied to quirks mode but unstable since 1.8" );
+});
 
 testIframeWithCallback( "body background is not lost if set prior to loading jQuery (#9238)", "support/bodyBackground", function( color, support ) {
        expect( 2 );