aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/support.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2015-05-07 23:16:18 -0400
committerRichard Gibson <richard.gibson@gmail.com>2015-10-18 16:58:38 -0400
commit487d5ca913c237aafe9efa1179749b46382fddbf (patch)
tree80ba81e17553a2076ccc3e49999f533a8ad0ea27 /test/unit/support.js
parentc752a5030bc00eb5b45dea9c28963f824a5c4f44 (diff)
downloadjquery-487d5ca913c237aafe9efa1179749b46382fddbf.tar.gz
jquery-487d5ca913c237aafe9efa1179749b46382fddbf.zip
CSS: Correct misrepresentation of "auto" horizontal margins as 0
Fixes gh-2237 Closes gh-2276 (cherry picked from commit 214e1634ab9b1d13d53647dd5de3bdf7a091d49c) Conflicts: src/css.js src/css/support.js test/unit/support.js
Diffstat (limited to 'test/unit/support.js')
-rw-r--r--test/unit/support.js69
1 files changed, 40 insertions, 29 deletions
diff --git a/test/unit/support.js b/test/unit/support.js
index 8c6b0a28b..a62e57c73 100644
--- a/test/unit/support.js
+++ b/test/unit/support.js
@@ -70,7 +70,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": true
};
} else if ( /(msie 10\.0|trident\/7\.0)/i.test( userAgent ) ) {
expected = {
@@ -86,7 +87,8 @@ testIframeWithCallback(
"optSelected": false,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": false
+ "radioValue": false,
+ "reliableMarginLeft": true
};
} else if ( /msie 9\.0/i.test( userAgent ) ) {
expected = {
@@ -102,7 +104,8 @@ testIframeWithCallback(
"optSelected": false,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": false
+ "radioValue": false,
+ "reliableMarginLeft": true
};
} else if ( /chrome/i.test( userAgent ) ) {
@@ -121,7 +124,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": true
};
} else if ( /8\.0(\.\d+|) safari/i.test( userAgent ) ) {
expected = {
@@ -137,7 +141,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": true
};
} else if ( /7\.0(\.\d+|) safari/i.test( userAgent ) ) {
expected = {
@@ -153,7 +158,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": true
};
} else if ( /firefox/i.test( userAgent ) ) {
expected = {
@@ -169,7 +175,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": true,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": false
};
} else if ( /iphone os 8/i.test( userAgent ) ) {
expected = {
@@ -185,7 +192,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": true
};
} else if ( /iphone os (6|7)/i.test( userAgent ) ) {
expected = {
@@ -201,7 +209,8 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": true,
"pixelPosition": false,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": true
};
} else if ( /android 4\.[0-3]/i.test( userAgent ) ) {
expected = {
@@ -217,33 +226,35 @@ testIframeWithCallback(
"optSelected": true,
"pixelMarginRight": false,
"pixelPosition": false,
- "radioValue": true
+ "radioValue": true,
+ "reliableMarginLeft": false
};
}
- if ( expected ) {
- QUnit.test( "Verify that the support tests resolve as expected per browser", function( assert ) {
- var i, prop,
- j = 0;
+ QUnit.test( "Verify that support tests resolve as expected per browser", function( assert ) {
+ if ( !expected ) {
+ assert.expect( 1 );
+ assert.ok( false, "Known client: " + userAgent );
+ }
- for ( prop in computedSupport ) {
- j++;
- }
+ var i, prop,
+ j = 0;
- assert.expect( j );
+ for ( prop in computedSupport ) {
+ j++;
+ }
- for ( i in expected ) {
+ assert.expect( j );
- // TODO check for all modules containing support properties
- if ( jQuery.ajax || i !== "ajax" && i !== "cors" ) {
- assert.equal( computedSupport[ i ], expected[ i ],
- "jQuery.support['" + i + "']: " + computedSupport[ i ] +
- ", expected['" + i + "']: " + expected[ i ] );
- } else {
- assert.ok( true, "no ajax; skipping jQuery.support[' " + i + " ']" );
- }
+ for ( i in expected ) {
+ if ( jQuery.ajax || i !== "ajax" && i !== "cors" ) {
+ assert.equal( computedSupport[ i ], expected[ i ],
+ "jQuery.support['" + i + "']: " + computedSupport[ i ] +
+ ", expected['" + i + "']: " + expected[ i ] );
+ } else {
+ assert.ok( true, "no ajax; skipping jQuery.support['" + i + "']" );
}
- } );
- }
+ }
+ });
} )();