use of org.loboevolution.html.js.geom.DOMRectListImpl in project LoboEvolution by LoboEvolution.
the class ElementImpl method getClientRects.
/**
* {@inheritDoc}
*/
@Override
public DOMRectList getClientRects() {
DOMRectListImpl list = new DOMRectListImpl();
AbstractCSSProperties style = ((HTMLElementImpl) this).getCurrentStyle();
String display = Strings.isNotBlank(style.getDisplay()) ? style.getDisplay() : getAttribute("display");
if (!"none".equals(display)) {
for (Node n = getParentNode(); n != null; n = n.getPreviousSibling()) {
if (!(n instanceof HTMLBodyElement) && !(n instanceof TextImpl) && !(n instanceof HTMLDocumentImpl)) {
HTMLElementImpl p = (HTMLElementImpl) n;
AbstractCSSProperties st = p.getStyle();
display = st.getDisplay();
}
}
}
if (!"none".equals(display)) {
list.add(getBoundingClientRect());
}
return list;
}
Aggregations