use of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLImageElement in project htmlunit by HtmlUnit.
the class ComputedCSSStyleDeclaration method getCalculatedHeight.
/**
* Returns the element's calculated height, taking both relevant CSS and the element's children into account.
* @return the element's calculated height, taking both relevant CSS and the element's children into account
*/
private int getCalculatedHeight() {
if (height_ != null) {
return height_.intValue();
}
final Element element = getElement();
if (element instanceof HTMLImageElement) {
height_ = ((HtmlImage) element.getDomNodeOrDie()).getHeightOrDefault();
return height_;
}
final boolean isInline = "inline".equals(getDisplay()) && !(element instanceof HTMLIFrameElement);
// height is ignored for inline elements
if (isInline || super.getHeight().isEmpty()) {
final int contentHeight = getContentHeight();
if (contentHeight > 0) {
height_ = Integer.valueOf(contentHeight);
return height_;
}
}
height_ = Integer.valueOf(getEmptyHeight());
return height_;
}
Aggregations