Landed a minor fix for AIR (in the offset method).
[jquery.git] / src / offset.js
index cf1af33..b29fcc7 100644 (file)
@@ -9,7 +9,7 @@ jQuery.fn.offset = function() {
                    offsetChild  = elem,
                    offsetParent = elem.offsetParent, 
                    doc          = elem.ownerDocument,
-                   safari2      = safari && parseInt(version) < 522,
+                   safari2      = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
                    fixed        = jQuery.css(elem, "position") == "fixed";
        
                // Use getBoundingClientRect if available
@@ -55,7 +55,7 @@ jQuery.fn.offset = function() {
                        }
                
                        // Get parent scroll offsets
-                       while ( parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
+                       while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
                                // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
                                if ( !/^inline|table.*$/i.test(jQuery.css(parent, "display")) )
                                        // Subtract parent scroll offsets