git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e10e625
)
fix :hidden and :visible selectors. fixes #4512
author
Brandon Aaron
<brandon.aaron@gmail.com>
Mon, 18 May 2009 15:36:36 +0000
(15:36 +0000)
committer
Brandon Aaron
<brandon.aaron@gmail.com>
Mon, 18 May 2009 15:36:36 +0000
(15:36 +0000)
src/selector.js
patch
|
blob
|
history
diff --git
a/src/selector.js
b/src/selector.js
index
b404064
..
5bde726
100644
(file)
--- a/
src/selector.js
+++ b/
src/selector.js
@@
-977,11
+977,21
@@
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
Sizzle.selectors.filters.hidden = function(elem){
jQuery.expr[":"] = jQuery.expr.filters;
Sizzle.selectors.filters.hidden = function(elem){
- return elem.offsetWidth === 0 && elem.offsetHeight === 0;
+ var width = elem.offsetWidth, height = elem.offsetHeight;
+ return ( width === 0 && height === 0 ) ?
+ true :
+ ( width !== 0 && height !== 0 ) ?
+ false :
+ !!( jQuery.curCSS(elem, "display") === "none" );
};
Sizzle.selectors.filters.visible = function(elem){
};
Sizzle.selectors.filters.visible = function(elem){
- return elem.offsetWidth > 0 || elem.offsetHeight > 0;
+ var width = elem.offsetWidth, height = elem.offsetHeight;
+ return ( width === 0 && height === 0 ) ?
+ false :
+ ( width > 0 && height > 0 ) ?
+ true :
+ !!( jQuery.curCSS(elem, "display") !== "none" );
};
Sizzle.selectors.filters.animated = function(elem){
};
Sizzle.selectors.filters.animated = function(elem){