aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-28 10:55:48 -0400
committerJohn Resig <jeresig@gmail.com>2010-09-28 10:55:48 -0400
commitcf672a2e7a886cac5ae62f6772c6b4b43b19a2fc (patch)
treef8e93b0849a7c51babe442b197d1dbf4aaa84204 /test
parent7be11207b9267592a639eb739dc8d719c7de56a1 (diff)
downloadjquery-cf672a2e7a886cac5ae62f6772c6b4b43b19a2fc.tar.gz
jquery-cf672a2e7a886cac5ae62f6772c6b4b43b19a2fc.zip
Make sure that .offset() doesn't fail against disconnected DOM nodes. Fixes #4996.
Diffstat (limited to 'test')
-rw-r--r--test/unit/offset.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index ed3d9622a..879753181 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -1,5 +1,14 @@
module("offset");
+test("disconnected node", function() {
+ expect(2);
+
+ var result = jQuery( document.createElement("div") ).offset();
+
+ equals( result.top, 0, "Check top" );
+ equals( result.left, 0, "Check left" );
+});
+
var supportsScroll = false;
testoffset("absolute"/* in iframe */, function($, iframe) {