return findRule((Element)elem.getParentNode(),property,inherit);
Node parent = elem.getParentNode();  if(parent instanceof Element) { return findRule((Element)elem.getParentNode(),property,inherit); }
    public CSSStyleDeclaration findRule(Element elem, String property, boolean inherit) {        // loop through the styles in reverse order        for(int s=styles.size()-1; s>=0; s--) {            JStyle style = (JStyle)styles.get(s);            // loop through each selector for the style            for(int i=0; i<style.selector_list.getLength(); i++) {                Selector sel = style.selector_list.item(i);                // if the selector matches                if(matchSelector(sel,elem)) {                    CSSStyleDeclaration dec = style.declaration;                    // if the style has the property we want                    if(dec != null && dec.getPropertyValue(property) != null &&                            !dec.getPropertyValue(property).equals("")) {                        return dec;                    }                }            }        }                // since we didn't find anything, recurse up the chain        if(inherit) {            if(elem.getParentNode() != null) {                return findRule((Element)elem.getParentNode(),property,inherit);            }        }                //u.p("no style found at all "  + elem.getNodeName() + " prop = " + property);        return null;    }