aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrandonaaron <brandon.aaron@gmail.com>2010-02-28 10:55:59 -0600
committerbrandonaaron <brandon.aaron@gmail.com>2010-02-28 10:55:59 -0600
commit5353c6bcc352c4d900cc76af110e56ee1e70ae0f (patch)
treeec39f7123b60991c57b232f6b787cffdb92614d7
parent1d352084c4257217b0778f1ec3bb2e409411a4c3 (diff)
downloadjquery-5353c6bcc352c4d900cc76af110e56ee1e70ae0f.tar.gz
jquery-5353c6bcc352c4d900cc76af110e56ee1e70ae0f.zip
Adding unit tests to make sure .scrollTop() and .scrollLeft() work cross-frame.
-rw-r--r--test/unit/offset.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index 3d71ef177..0f5c964e2 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -300,7 +300,7 @@ testoffset("table", function( jQuery ) {
});
testoffset("scroll", function( jQuery, win ) {
- expect(12);
+ expect(16);
var ie = jQuery.browser.msie && parseInt( jQuery.browser.version ) < 8;
@@ -330,6 +330,14 @@ testoffset("scroll", function( jQuery, win ) {
equals( jQuery(win.document).scrollTop(), 1000, "jQuery(document).scrollTop()" );
equals( jQuery(win.document).scrollLeft(), 1000, "jQuery(document).scrollLeft()" );
+
+ // test jQuery using parent window/document
+ // jQuery reference here is in the iframe
+ window.scrollTo(0,0);
+ equals( jQuery(window).scrollTop(), 0, "jQuery(window).scrollTop() other window" );
+ 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" );
});
testoffset("body", function( jQuery ) {