mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Remove IE8 testswarm hacks for offset.
This commit is contained in:
parent
2e42f06cdc
commit
3478cbb4d4
@ -218,20 +218,17 @@ testIframe("offset/relative", "relative", function( $ ) {
|
||||
testIframe("offset/static", "static", function( $ ) {
|
||||
|
||||
// IE is collapsing the top margin of 1px; detect and adjust accordingly
|
||||
var ie = $("#static-1").offset().top === 6,
|
||||
swarmy = document.documentMode === 8 && window.location.search.indexOf("swarmURL") >= 0;
|
||||
var ie = $("#static-1").offset().top === 6;
|
||||
|
||||
expect( swarmy? 68 : 80 );
|
||||
expect( 80 );
|
||||
|
||||
// get offset
|
||||
var tests = [
|
||||
{ "id": "#static-1", "top": ie ? 6 : 7, "left": 7 },
|
||||
{ "id": "#static-1-1", "top": ie ? 13 : 15, "left": 15 },
|
||||
{ "id": "#static-1-1-1", "top": ie ? 20 : 23, "left": 23 }
|
||||
{ "id": "#static-1-1-1", "top": ie ? 20 : 23, "left": 23 },
|
||||
{ "id": "#static-2", "top": ie ? 121 : 122, left: 7 }
|
||||
];
|
||||
if ( !swarmy ) {
|
||||
tests.push({ "id": "#static-2", "top": ie ? 121 : 122, left: 7 });
|
||||
}
|
||||
jQuery.each( tests, function() {
|
||||
equal( $( this["id"] ).offset().top, this["top"], "jQuery('" + this["id"] + "').offset().top" );
|
||||
equal( $( this["id"] ).offset().left, this["left"], "jQuery('" + this["id"] + "').offset().left" );
|
||||
@ -242,12 +239,9 @@ testIframe("offset/static", "static", function( $ ) {
|
||||
tests = [
|
||||
{ "id": "#static-1", "top": ie ? 5 : 6, "left": 6 },
|
||||
{ "id": "#static-1-1", "top": ie ? 12 : 14, "left": 14 },
|
||||
{ "id": "#static-1-1-1", "top": ie ? 19 : 22, "left": 22 }
|
||||
|
||||
{ "id": "#static-1-1-1", "top": ie ? 19 : 22, "left": 22 },
|
||||
{ "id": "#static-2", "top": ie ? 120 : 121, "left": 6 }
|
||||
];
|
||||
if ( !swarmy ) {
|
||||
tests.push({ "id": "#static-2", "top": ie ? 120 : 121, "left": 6 });
|
||||
}
|
||||
jQuery.each( tests, function() {
|
||||
equal( $( this["id"] ).position().top, this["top"], "jQuery('" + this["top"] + "').position().top" );
|
||||
equal( $( this["id"] ).position().left, this["left"], "jQuery('" + this["left"] +"').position().left" );
|
||||
@ -269,15 +263,10 @@ testIframe("offset/static", "static", function( $ ) {
|
||||
{ "id": "#static-1-1", "top": -3, "left": -3 },
|
||||
{ "id": "#static-1-1", "top": 14, "left": 14 },
|
||||
{ "id": "#static-1", "top": 30, "left": 30 },
|
||||
{ "id": "#static-1", "top": 2, "left": 2 }
|
||||
|
||||
];
|
||||
if ( !swarmy ) {
|
||||
tests.push(
|
||||
{ "id": "#static-1", "top": 2, "left": 2 },
|
||||
{ "id": "#static-1", "top": -2, "left": -2 },
|
||||
{ "id": "#static-1", "top": 7, "left": 7 }
|
||||
);
|
||||
}
|
||||
];
|
||||
jQuery.each( tests, function() {
|
||||
$( this["id"] ).offset({ "top": this["top"], "left": this["left"] });
|
||||
equal( $( this["id"] ).offset().top, this["top"], "jQuery('" + this["id"] + "').offset({ top: " + this["top"] + " })" );
|
||||
|
Loading…
Reference in New Issue
Block a user