Bug 7931; Fixed bug that caused scrollTop and scrollLeft setters to return null when called on an empty jquery object

This commit is contained in:
Xavi 2011-01-09 19:11:05 -05:00
parent fcf623786a
commit d03d2e9f26
2 changed files with 21 additions and 15 deletions

View file

@ -333,7 +333,7 @@ testoffset("table", function( jQuery ) {
});
testoffset("scroll", function( jQuery, win ) {
expect(16);
expect(20);
var ie = jQuery.browser.msie && parseInt( jQuery.browser.version, 10 ) < 8;
@ -379,6 +379,12 @@ testoffset("scroll", function( jQuery, win ) {
equals( jQuery(window).scrollLeft(), 0, "jQuery(window).scrollLeft() other window" );
equals( jQuery(document).scrollTop(), 0, "jQuery(window).scrollTop() other document" );
equals( jQuery(document).scrollLeft(), 0, "jQuery(window).scrollLeft() other document" );
// Tests scrollTop/Left with empty jquery objects
ok( jQuery().scrollTop(100) != null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
ok( jQuery().scrollLeft(100) != null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
ok( jQuery().scrollTop() === null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
ok( jQuery().scrollLeft() === null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
});
testoffset("body", function( jQuery ) {