X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fselector.js;h=1f3ceb5c1fb32ca78b4432bbd53cccd91e9042f1;hb=bbf3334db107abf72cbb3247b68b7e40d9f2cdfe;hp=96e339d1a27593d3b7bae3a15745ba630be8a0a4;hpb=45729831b136238d6b58cd2057192fd74073dfce;p=jquery.git diff --git a/src/selector.js b/src/selector.js index 96e339d..1f3ceb5 100644 --- a/src/selector.js +++ b/src/selector.js @@ -977,21 +977,17 @@ jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; Sizzle.selectors.filters.hidden = function(elem){ - var width = elem.offsetWidth, height = elem.offsetHeight; - return ( width === 0 && height === 0 ) ? + var width = elem.offsetWidth, height = elem.offsetHeight, + force = /^tr$/i.test( elem.tagName ); // ticket #4512 + return ( width === 0 && height === 0 && !force ) ? true : - ( width !== 0 && height !== 0 ) ? - false : - !!( jQuery.curCSS(elem, "display") === "none" ); + ( width !== 0 && height !== 0 && !force ) ? + false : + !!( jQuery.curCSS(elem, "display") === "none" ); }; Sizzle.selectors.filters.visible = function(elem){ - var width = elem.offsetWidth, height = elem.offsetHeight; - return ( width === 0 && height === 0 ) ? - false : - ( width > 0 && height > 0 ) ? - true : - !!( jQuery.curCSS(elem, "display") !== "none" ); + return !Sizzle.selectors.filters.hidden(elem); }; Sizzle.selectors.filters.animated = function(elem){