From: Richard Gibson Date: Fri, 22 Feb 2013 21:33:52 +0000 (-0500) Subject: No ticket: Reduce size in anticipation of Sizzle-free builds X-Git-Tag: 1.10.0-beta1~78 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dbf3056b250bbc279fa947031181f9e25a40bacf;p=jquery.git No ticket: Reduce size in anticipation of Sizzle-free builds --- diff --git a/src/core.js b/src/core.js index 4115c5eae..7a854e7f4 100644 --- a/src/core.js +++ b/src/core.js @@ -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, diff --git a/src/offset.js b/src/offset.js index 4efb962ff..e6fd3574c 100644 --- a/src/offset.js +++ b/src/offset.js @@ -123,11 +123,11 @@ 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; }); } });