Skip to content
Permalink
Browse files

fix for #4512 and minor sizzle updates

  • Loading branch information
brandonaaron committed Jun 23, 2009
1 parent c6b9654 commit de07ebc1a0a656c53ebee3f95802db08bb3cd680
Showing with 10 additions and 14 deletions.
  1. +10 −14 src/selector.js
@@ -551,7 +551,7 @@ var Expr = Sizzle.selectors = {
} else if ( name === "not" ) {
var not = match[3];

for ( i = 0, l = not.length; i < l; i++ ) {
for ( var i = 0, l = not.length; i < l; i++ ) {
if ( not[i] === elem ) {
return false;
}
@@ -565,13 +565,13 @@ var Expr = Sizzle.selectors = {
switch (type) {
case 'only':
case 'first':
while ( (node = node.previousSibling) ) {
while (node = node.previousSibling) {
if ( node.nodeType === 1 ) return false;
}
if ( type == 'first') return true;
node = elem;
case 'last':
while ( (node = node.nextSibling) ) {
while (node = node.nextSibling) {
if ( node.nodeType === 1 ) return false;
}
return true;
@@ -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){

0 comments on commit de07ebc

Please sign in to comment.
You can’t perform that action at this time.