// display: iterate top to bottom, because if a parent is display:none,
// there's nothing that a child can do to override it
for (final Node node : getAncestors(true)) {
final ScriptableObject scriptableObject = ((DomNode) node).getScriptObject();
if (scriptableObject instanceof HTMLElement) {
final CSSStyleDeclaration style = ((HTMLElement) scriptableObject).jsxGet_currentStyle();
final String display = style.jsxGet_display();
if ("none".equals(display)) {
return false;
}
}
}
// visibility: iterate bottom to top, because children can override
// the visibility used by parent nodes
final boolean isNotIE = !((HtmlPage) page).getWebClient().getBrowserVersion().isIE();
DomNode node = this;
do {
final ScriptableObject scriptableObject = node.getScriptObject();
if (scriptableObject instanceof HTMLElement) {
final CSSStyleDeclaration style = ((HTMLElement) scriptableObject).jsxGet_currentStyle();
final String visibility = style.jsxGet_visibility();
if (visibility.length() > 0) {
if (visibility.equals("visible")) {
return true;
}
else if (visibility.equals("hidden") || (isNotIE && visibility.equals("collapse"))) {