aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/offset.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-09-13 18:47:07 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-09-13 18:47:07 -0400
commitb0a352bfa76cbe1b65f8186d3cb90fe35a08866d (patch)
tree7261586dd603c87e1238c92e4b08a4417878f9e2 /test/unit/offset.js
parent74cdd784975ba6e628d1934a859faeb017824a5f (diff)
downloadjquery-b0a352bfa76cbe1b65f8186d3cb90fe35a08866d.tar.gz
jquery-b0a352bfa76cbe1b65f8186d3cb90fe35a08866d.zip
Fix #12534. Don't die on browsers lacking getBoundingClientRect.
Diffstat (limited to 'test/unit/offset.js')
-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 d18bc4bb8..ab44416d0 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -15,6 +15,15 @@ test("empty set", function() {
strictEqual( jQuery().position(), undefined, "position() returns undefined for empty set (#11962)" );
});
+test("object without getBoundingClientRect", function() {
+ expect(2);
+
+ // Simulates a browser without gBCR on elements, we just want to return 0,0
+ var result = jQuery({ ownerDocument: document }).offset();
+ equal( result.top, 0, "Check top" );
+ equal( result.left, 0, "Check left" );
+});
+
test("disconnected node", function() {
expect(2);