Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea31e4d

Browse files
authored
Tests: remove unnecessary scroll feature test
- it wasn't working properly anywayClosesgh-5507
1 parent7497052 commitea31e4d

File tree

1 file changed

+11
-30
lines changed

1 file changed

+11
-30
lines changed

‎test/unit/offset.js

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ var alwaysScrollable,
1414
// Append forceScroll to the body instead of #qunit-fixture because the latter is hidden
1515
forceScroll.appendTo("body");
1616
window.scrollTo(200,200);
17-
window.supportsScroll=document.documentElement.scrollTop||document.body.scrollTop;
1817
forceScroll.detach();
1918

2019
// Support: iOS <=7 - 12+
@@ -363,7 +362,7 @@ testIframe( "static", "offset/static.html", function( assert, $ ) {
363362
});
364363
});
365364

366-
testIframe("fixed","offset/fixed.html",function(assert,$,window){
365+
testIframe("fixed","offset/fixed.html",function(assert,$){
367366
assert.expect(38);
368367

369368
vartests,$noTopLeft;
@@ -386,22 +385,12 @@ testIframe( "fixed", "offset/fixed.html", function( assert, $, window ) {
386385
];
387386

388387
jQuery.each(tests,function(){
389-
if(!window.supportsScroll){
390-
assert.ok(true,"Browser doesn't support scroll position.");
391-
assert.ok(true,"Browser doesn't support scroll position.");
392-
assert.ok(true,"Browser doesn't support scroll position.");
393-
assert.ok(true,"Browser doesn't support scroll position.");
394-
assert.ok(true,"Browser doesn't support scroll position.");
395-
assert.ok(true,"Browser doesn't support scroll position.");
396-
397-
}else{
398-
assert.equal(jQuery.isPlainObject($(this.id).offset()),true,"jQuery('"+this.id+"').offset() is plain object");
399-
assert.equal(jQuery.isPlainObject($(this.id).position()),true,"jQuery('"+this.id+"').position() is plain object");
400-
assert.equal($(this.id).offset().top,this.offsetTop,"jQuery('"+this.id+"').offset().top");
401-
assert.equal($(this.id).position().top,this.positionTop,"jQuery('"+this.id+"').position().top");
402-
assert.equal($(this.id).offset().left,this.offsetLeft,"jQuery('"+this.id+"').offset().left");
403-
assert.equal($(this.id).position().left,this.positionLeft,"jQuery('"+this.id+"').position().left");
404-
}
388+
assert.equal(jQuery.isPlainObject($(this.id).offset()),true,"jQuery('"+this.id+"').offset() is plain object");
389+
assert.equal(jQuery.isPlainObject($(this.id).position()),true,"jQuery('"+this.id+"').position() is plain object");
390+
assert.equal($(this.id).offset().top,this.offsetTop,"jQuery('"+this.id+"').offset().top");
391+
assert.equal($(this.id).position().top,this.positionTop,"jQuery('"+this.id+"').position().top");
392+
assert.equal($(this.id).offset().left,this.offsetLeft,"jQuery('"+this.id+"').offset().left");
393+
assert.equal($(this.id).position().left,this.positionLeft,"jQuery('"+this.id+"').position().left");
405394
});
406395

407396
tests=[
@@ -476,19 +465,11 @@ testIframe( "scroll", "offset/scroll.html", function( assert, $, win ) {
476465

477466
win.name="test";
478467

479-
if(!window.supportsScroll){
480-
assert.ok(true,"Browser doesn't support scroll position.");
481-
assert.ok(true,"Browser doesn't support scroll position.");
482-
483-
assert.ok(true,"Browser doesn't support scroll position.");
484-
assert.ok(true,"Browser doesn't support scroll position.");
485-
}else{
486-
assert.equal($(win).scrollTop(),1000,"jQuery(window).scrollTop()");
487-
assert.equal($(win).scrollLeft(),1000,"jQuery(window).scrollLeft()");
468+
assert.equal($(win).scrollTop(),1000,"jQuery(window).scrollTop()");
469+
assert.equal($(win).scrollLeft(),1000,"jQuery(window).scrollLeft()");
488470

489-
assert.equal($(win.document).scrollTop(),1000,"jQuery(document).scrollTop()");
490-
assert.equal($(win.document).scrollLeft(),1000,"jQuery(document).scrollLeft()");
491-
}
471+
assert.equal($(win.document).scrollTop(),1000,"jQuery(document).scrollTop()");
472+
assert.equal($(win.document).scrollLeft(),1000,"jQuery(document).scrollLeft()");
492473

493474
// test jQuery using parent window/document
494475
// jQuery reference here is in the iframe

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp