@@ -422,6 +422,21 @@ test("offsetParent", function(){
422
422
equals ( div [ 1 ] , jQuery ( "#nothiddendiv" ) [ 0 ] , "The div is the offsetParent." ) ;
423
423
} ) ;
424
424
425
+ testoffset ( "bug_8316" , function ( jQuery ) {
426
+ expect ( 2 ) ;
427
+
428
+ var tests = [
429
+ { id :'#elem' , top : 100 , left : 100 }
430
+ ] ;
431
+
432
+ jQuery . each ( tests , function ( ) {
433
+ var el = jQuery ( this . id ) ;
434
+ el . offset ( { top : this . top , left : this . left } ) ;
435
+ equals ( Math . round ( el . offset ( ) . top ) , this . top ) ;
436
+ equals ( Math . round ( el . offset ( ) . left ) , this . left ) ;
437
+ } ) ;
438
+ } ) ;
439
+
425
440
function testoffset ( name , fn ) {
426
441
427
442
test ( name , function ( ) {
@@ -447,7 +462,7 @@ function testoffset(name, fn) {
447
462
function loadFixture ( ) {
448
463
var src = './data/offset/' + name + '.html?' + parseInt ( Math . random ( ) * 1000 , 10 ) ,
449
464
iframe = jQuery ( '<iframe />' ) . css ( {
450
- width : 500 , height : 500 , position : 'absolute' , top : - 600 , left : - 600 , visiblity : 'hidden'
465
+ width : 500 , height : 500 , position : 'absolute' , top : - 600 , left : - 600 , visibility : 'hidden'
451
466
} ) . appendTo ( 'body' ) [ 0 ] ;
452
467
iframe . contentWindow . location = src ;
453
468
return iframe ;
0 commit comments