]> source.dussan.org Git - jquery.git/commitdiff
Offset: no need to check for ownerDocument
authorTimmy Willison <timmywillisn@gmail.com>
Tue, 16 Jun 2015 16:23:43 +0000 (12:23 -0400)
committerTimmy Willison <timmywillisn@gmail.com>
Tue, 16 Jun 2015 16:23:43 +0000 (12:23 -0400)
src/offset.js

index 142c91893b8e9ae2b04a1a2c5773f90759f09b81..b07bbe232b93bf969cb46c844c5c430e41eec3b8 100644 (file)
@@ -88,14 +88,14 @@ jQuery.fn.extend({
                                });
                }
 
-               var docElem, win, rect,
-                       elem = this[ 0 ],
-                       doc = elem && elem.ownerDocument;
+               var docElem, win, rect, doc,
+                       elem = this[ 0 ];
 
-               if ( !doc ) {
+               if ( !elem ) {
                        return;
                }
 
+               doc = elem.ownerDocument;
                docElem = doc.documentElement;
 
                // Support: IE<=11+