use of org.loboevolution.html.dom.filter.BodyFilter in project LoboEvolution by LoboEvolution.
the class WindowImpl method getLength.
/**
* {@inheritDoc}
*/
@Override
public int getLength() {
if (this.lengthSet) {
return this.length;
} else {
final HTMLDocumentImpl doc = this.document;
final List<Node> list = new LinkedList<>(Arrays.asList(doc.getNodeList(new BodyFilter()).toArray()));
HTMLCollection collection = new HTMLCollectionImpl(doc, list);
return collection.getLength();
}
}
use of org.loboevolution.html.dom.filter.BodyFilter in project LoboEvolution by LoboEvolution.
the class HTMLDocumentImpl method getBody.
/**
* {@inheritDoc}
*/
@Override
public HTMLElement getBody() {
synchronized (this) {
if (this.body == null) {
final List<Node> list = new LinkedList<>(Arrays.asList(this.getNodeList(new BodyFilter()).toArray()));
HTMLCollection collection = new HTMLCollectionImpl(this, list);
if (collection.getLength() > 0) {
return (HTMLElement) collection.item(0);
} else {
return null;
}
}
return this.body;
}
}
Aggregations