]> source.dussan.org Git - jquery.git/commitdiff
No ticket: Reduce size in anticipation of Sizzle-free builds
authorRichard Gibson <richard.gibson@gmail.com>
Fri, 22 Feb 2013 21:33:52 +0000 (16:33 -0500)
committerRichard Gibson <richard.gibson@gmail.com>
Fri, 22 Feb 2013 21:36:39 +0000 (16:36 -0500)
(cherry picked from commit dbf3056b250bbc279fa947031181f9e25a40bacf)

src/core.js
src/offset.js

index b1ae40875c09e9fafe5b4f44b81b402a9045bd71..5fb6828ff52baf81910850014a44cbc78af1fdb4 100644 (file)
@@ -10,8 +10,9 @@ var
        core_strundefined = typeof undefined,
 
        // Use the correct document accordingly with window argument (sandbox)
-       document = window.document,
        location = window.location,
+       document = window.document,
+       docElem = document.documentElement,
 
        // Map over jQuery in case of overwrite
        _jQuery = window.jQuery,
index fc110f012089ed1b022b57183ff19514351c2b80..b616a49a005dd25ef708a2676c01cad9db2adb2b 100644 (file)
@@ -125,13 +125,13 @@ jQuery.fn.extend({
 
        offsetParent: function() {
                return this.map(function() {
-                       var offsetParent = this.offsetParent || document.documentElement;
+                       var offsetParent = this.offsetParent || docElem;
 
                        while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
                                offsetParent = offsetParent.offsetParent;
                        }
 
-                       return offsetParent || document.documentElement;
+                       return offsetParent || docElem;
                });
        }
 });