diff options
author | John Resig <jeresig@gmail.com> | 2010-09-28 10:55:48 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-09-28 10:55:48 -0400 |
commit | cf672a2e7a886cac5ae62f6772c6b4b43b19a2fc (patch) | |
tree | f8e93b0849a7c51babe442b197d1dbf4aaa84204 /test | |
parent | 7be11207b9267592a639eb739dc8d719c7de56a1 (diff) | |
download | jquery-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.js | 9 |
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) { |