1 module("support", { teardown: moduleTeardown });
3 function supportIFrameTest( title, url, noDisplay, func ) {
5 if ( noDisplay !== true ) {
10 test( title, function() {
14 window.supportCallback = function() {
17 setTimeout( function() {
18 window.supportCallback = undefined;
20 func.apply( self, args );
24 iframe = jQuery( "<div/>" ).css( "display", noDisplay ? "none" : "block" ).append(
25 jQuery( "<iframe/>" ).attr( "src", "data/support/" + url + ".html" )
30 supportIFrameTest( "proper boxModel in compatMode CSS1Compat (IE6 and IE7)", "boxModelIE", function( compatMode, boxModel ) {
31 ok( compatMode !== "CSS1Compat" || boxModel, "boxModel properly detected" );
34 supportIFrameTest( "body background is not lost if set prior to loading jQuery (#9238)", "bodyBackground", function( color, support ) {
42 ok( okValue[ color ], "color was not reset (" + color + ")" );
44 for ( i in jQuery.support ) {
45 if ( jQuery.support[ i ] !== support[ i ] ) {
47 strictEqual( jQuery.support[ i ], support[ i ], "Support property " + i + " is different" );
50 for ( i in support ) {
51 if ( !( i in jQuery.support ) ) {
53 strictEqual( jQuery.support[ i ], support[ i ], "Unexpected property: " + i );
56 ok( passed, "Same support properties" );
59 supportIFrameTest( "A background on the testElement does not cause IE8 to crash (#9823)", "testElementCrash", function() {
61 ok( true, "IE8 does not crash" );
64 var userAgent = window.navigator.userAgent;
66 // These tests do not have to stay
67 // They are here to help with upcoming support changes for 1.8
68 if ( /chrome\/16\.0/i.test(userAgent) ) {
69 test("Verify that the support tests resolve as expected per browser", function() {
72 "leadingWhitespace":true,
76 "hrefNormalized":true,
81 "getSetAttribute":true,
86 "focusinBubbles":false,
89 "inlineBlockNeedsLayout":false,
90 "shrinkWrapBlocks":false,
91 "reliableMarginRight":true,
92 "noCloneChecked":true,
98 "reliableHiddenOffsets":true,
101 "doesNotIncludeMarginInBodyOffset":true
103 for ( i in expected ) {
104 equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
107 } else if ( /msie 8\.0/i.test(userAgent) ) {
108 test("Verify that the support tests resolve as expected per browser", function() {
111 "leadingWhitespace":false,
113 "htmlSerialize":false,
115 "hrefNormalized":true,
120 "getSetAttribute":true,
123 "submitBubbles":false,
124 "changeBubbles":false,
125 "focusinBubbles":true,
126 "deleteExpando":false,
127 "noCloneEvent":false,
128 "inlineBlockNeedsLayout":false,
129 "shrinkWrapBlocks":false,
130 "reliableMarginRight":true,
131 "noCloneChecked":false,
135 "appendChecked":true,
137 "reliableHiddenOffsets":false,
140 "doesNotIncludeMarginInBodyOffset":true
142 for ( i in expected ) {
143 equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
146 } else if ( /msie 7\.0/i.test(userAgent) ) {
147 test("Verify that the support tests resolve as expected per browser", function() {
151 "appendChecked": false,
153 "changeBubbles": false,
158 "deleteExpando": false,
159 "doesNotIncludeMarginInBodyOffset": true,
161 "focusinBubbles": true,
162 "getSetAttribute": false,
163 "hrefNormalized": false,
165 "htmlSerialize": false,
166 "inlineBlockNeedsLayout": true,
167 "leadingWhitespace": false,
168 "noCloneChecked": false,
169 "noCloneEvent": false,
172 "optSelected": false,
174 "reliableHiddenOffsets": false,
175 "reliableMarginRight": true,
176 "shrinkWrapBlocks": false,
177 "submitBubbles": false,
181 for ( i in expected ) {
182 equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
185 } else if ( /msie 6\.0/i.test(userAgent) ) {
186 test("Verify that the support tests resolve as expected per browser", function() {
189 "leadingWhitespace":false,
191 "htmlSerialize":false,
193 "hrefNormalized":false,
198 "getSetAttribute":false,
201 "submitBubbles":false,
202 "changeBubbles":false,
203 "focusinBubbles":true,
204 "deleteExpando":false,
205 "noCloneEvent":false,
206 "inlineBlockNeedsLayout":true,
207 "shrinkWrapBlocks":true,
208 "reliableMarginRight":true,
209 "noCloneChecked":false,
213 "appendChecked":false,
215 "reliableHiddenOffsets":false,
218 "doesNotIncludeMarginInBodyOffset":true
220 for ( i in expected ) {
221 equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
224 } else if ( /5\.1\.1 safari/i.test(userAgent) ) {
225 test("Verify that the support tests resolve as expected per browser", function() {
228 "leadingWhitespace":true,
230 "htmlSerialize":true,
232 "hrefNormalized":true,
237 "getSetAttribute":true,
240 "submitBubbles":true,
241 "changeBubbles":true,
242 "focusinBubbles":false,
243 "deleteExpando":true,
245 "inlineBlockNeedsLayout":false,
246 "shrinkWrapBlocks":false,
247 "reliableMarginRight":true,
248 "noCloneChecked":true,
252 "appendChecked":true,
254 "reliableHiddenOffsets":true,
257 "doesNotIncludeMarginInBodyOffset":true
259 for ( i in expected ) {
260 equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);
263 } else if ( /firefox\/3\.6/i.test(userAgent) ) {
264 test("Verify that the support tests resolve as expected per browser", function() {
267 "leadingWhitespace":true,
269 "htmlSerialize":true,
271 "hrefNormalized":true,
276 "getSetAttribute":true,
279 "submitBubbles":true,
280 "changeBubbles":true,
281 "focusinBubbles":false,
282 "deleteExpando":true,
284 "inlineBlockNeedsLayout":false,
285 "shrinkWrapBlocks":false,
286 "reliableMarginRight":true,
287 "noCloneChecked":true,
291 "appendChecked":true,
293 "reliableHiddenOffsets":true,
296 "doesNotIncludeMarginInBodyOffset":true
298 for ( i in expected ) {
299 equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]);