Fixed boxModel support - is now computed with feature detection, rather than sniffing.
[jquery.git] / src / core.js
index 4047170..78f2bcd 100644 (file)
@@ -342,10 +342,12 @@ jQuery.fn = jQuery.prototype = {
        },
 
        closest: function( selector ) {
+               var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null;
+
                return this.map(function(){
                        var cur = this;
                        while ( cur && cur.ownerDocument ) {
-                               if ( jQuery(cur).is(selector) )
+                               if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) )
                                        return cur;
                                cur = cur.parentNode;
                        }
@@ -1144,9 +1146,6 @@ jQuery.browser = {
        mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
 };
 
-// Check to see if the W3C box model is being used
-jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";
-
 jQuery.each({
        parent: function(elem){return elem.parentNode;},
        parents: function(elem){return jQuery.dir(elem,"parentNode");},