package com.google.gwt.query.client.impl;
import static com.google.gwt.query.client.GQuery.$;
+
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
* Return whether the element is visible
*/
public boolean isVisible(Element e) {
- return !"none".equalsIgnoreCase(curCSS(e, "display", true));
+ return SelectorEngine.filters.get("visible").f(e, 0);
}
public double num(String val) {
filters = JsMap.create();
filters.put("visible", new Predicate(){
public boolean f(Element e, int index) {
- return (e.getOffsetWidth() + e.getOffsetHeight()) > 0 && styleImpl.isVisible(e);
+ return (e.getOffsetWidth() + e.getOffsetHeight()) > 0 &&
+ !"none".equalsIgnoreCase(styleImpl.curCSS(e, "display", true));
}
});
filters.put("hidden", new Predicate() {