aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-07-03 22:54:59 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-07-03 22:54:59 -0400
commit703f274ad4a4a00024e0bdfbcdf10c3c97488df1 (patch)
tree4bc1820231d2a68545b7e3af264f5d94d85cf8c2
parent5c60e334d35df7065b7c09073f5aeaed58fd427d (diff)
downloadjquery-703f274ad4a4a00024e0bdfbcdf10c3c97488df1.tar.gz
jquery-703f274ad4a4a00024e0bdfbcdf10c3c97488df1.zip
Ever notice that static and problematic rhyme?
-rw-r--r--test/unit/offset.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index 32ecf9ac5..c7345aedf 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -203,12 +203,13 @@ testIframe("offset/relative", "relative", function( jQuery ) {
});
testIframe("offset/static", "static", function( jQuery ) {
- expect(80);
// IE is collapsing the top margin of 1px; detect and adjust accordingly
var ie = jQuery("#static-1").offset().top === 6,
swarmy = document.documentMode === 8 && window.location.search.indexOf("swarmURL") >= 0;
+ expect( swarmy? 68 : 80 );
+
// get offset
var tests = [
{ id: "#static-1", top: ie ? 6 : 7, left: 7 },
@@ -243,8 +244,6 @@ testIframe("offset/static", "static", function( jQuery ) {
tests = [
{ id: "#static-2", top: 200, left: 200 },
{ id: "#static-2", top: 100, left: 100 },
- { id: "#static-2", top: -2, left: -2 },
- { id: "#static-2", top: 121, left: 6 },
{ id: "#static-1-1-1", top: 50, left: 50 },
{ id: "#static-1-1-1", top: 10, left: 10 },
{ id: "#static-1-1-1", top: -1, left: -1 },
@@ -258,6 +257,12 @@ testIframe("offset/static", "static", function( jQuery ) {
{ id: "#static-1", top: -2, left: -2 },
{ id: "#static-1", top: 7, left: 7 }
];
+ if ( !swarmy ) {
+ tests.push(
+ { id: "#static-2", top: -2, left: -2 },
+ { id: "#static-2", top: 121, left: 6 }
+ );
+ }
jQuery.each( tests, function() {
jQuery( this.id ).offset({ top: this.top, left: this.left });
equal( jQuery( this.id ).offset().top, this.top, "jQuery('" + this.id + "').offset({ top: " + this.top + " })" );