/** * Checks whether the specified element is descendant of this HtmlPage or not. */ private boolean isDescendant(final HtmlElement element) { for (DomNode parent = element; parent != null; parent = parent.getParentNode()) { if (parent == this) { return true; } } return false; }
/** * Checks whether the specified element is descendant of this HtmlPage or not. */ private boolean isDescendant(final HtmlElement element) { for (DomNode parent = element; parent != null; parent = parent.getParentNode()) { if (parent == this) { return true; } } return false; }
/** * Sets the parent node. * @param parent the parent node */ protected void setParentNode(final DomNode parent) { // make sure there's no cycle for(DomNode p=parent; p!=null; p=p.getParentNode()) if(p==this) throw new AssertionError("Trying to create a cycle"); parent_ = parent; }
/** * Sets the parent node. * @param parent the parent node */ protected void setParentNode(final DomNode parent) { // make sure there's no cycle for(DomNode p=parent; p!=null; p=p.getParentNode()) if(p==this) throw new AssertionError("Trying to create a cycle"); parent_ = parent; }
/** * Returns the row element which contains this cell's HTML element; may return {@code null}. * @return the row element which contains this cell's HTML element */ private HtmlTableRow getRow() { DomNode node = getDomNodeOrDie(); while (node != null && !(node instanceof HtmlTableRow)) { node = node.getParentNode(); } return (HtmlTableRow) node; }
/** * Returns the row element which contains this cell's HTML element; may return <tt>null</tt>. * @return the row element which contains this cell's HTML element */ private HtmlTableRow getRow() { DomNode node = getDomNodeOrDie(); while (node != null && !(node instanceof HtmlTableRow)) { node = node.getParentNode(); } return (HtmlTableRow) node; }
/** * Returns the row element which contains this cell's HTML element; may return {@code null}. * @return the row element which contains this cell's HTML element */ private HtmlTableRow getRow() { DomNode node = getDomNodeOrDie(); while (node != null && !(node instanceof HtmlTableRow)) { node = node.getParentNode(); } return (HtmlTableRow) node; }
/** * Returns this node's parent node. * @return this node's parent node */ public final Node getParent() { return getJavaScriptNode(getDomNodeOrDie().getParentNode()); }
/** * Indicates if the row belongs to this container. * @param row the row to test * @return {@code true} if it belongs to this container */ @Override protected boolean isContainedRow(final HtmlTableRow row) { final DomNode parent = row.getParentNode(); // the tbody, thead or tfoo return (parent != null) && parent.getParentNode() == getDomNodeOrDie(); }
public IElement getParent() { DomNode p = element.getParentNode(); while (true) { if (p == null) return null; if (p instanceof HtmlElement) return new HtmlUnitElementImpl((HtmlElement) p); // get next parent p = p.getParentNode(); } }
private WebElement findParentForm() { DomNode current = element; while (!(current == null || current instanceof HtmlForm)) { current = current.getParentNode(); } return getParent().newHtmlUnitWebElement((HtmlForm) current); }
private WebElement findParentForm() { DomNode current = element; while (!(current == null || current instanceof HtmlForm)) { current = current.getParentNode(); } return getParent().newHtmlUnitWebElement((HtmlForm) current); }
@Override protected DomNode getFirstNode(final DomNode node) { if (node == null) { return null; } final DomNode sibling = node.getPreviousSibling(); if (sibling == null) { return getFirstNode(node.getParentNode()); } return sibling; } @Override
@Override protected DomNode getFirstNode(final DomNode node) { if (node == null) { return null; } final DomNode sibling = node.getNextSibling(); if (sibling == null) { return getFirstNode(node.getParentNode()); } return sibling; }
@Override protected DomNode getFirstNode(final DomNode node) { if (node == null) { return null; } final DomNode sibling = node.getPreviousSibling(); if (sibling == null) { return getFirstNode(node.getParentNode()); } return sibling; } @Override
/** * Returns this node's parent node. * @return this node's parent node */ public Node getParent() { return getJavaScriptNode(this.<DomNode>getDomNodeOrDie().getParentNode()); }
/** * Gets the JavaScript property "parentNode" for the node that * contains the current node. * @return the parent node */ public Node jsxGet_parentNode() { return getJavaScriptNode(getDomNodeOrDie().getParentNode()); }
@Override protected DomNode getFirstNode(final DomNode node) { if (node == null) { return null; } final DomNode sibling = node.getNextSibling(); if (sibling == null) { return getFirstNode(node.getParentNode()); } return sibling; }
/** * Gets the JavaScript property {@code parentNode} for the node that * contains the current node. * @return the parent node */ @JsxGetter public Object getParentNode() { return getJavaScriptNode(getDomNodeOrDie().getParentNode()); }
/** * Returns the parent node. * @return the parent node */ @JsxGetter public Object getParentNode() { final DomNode domNode = getDomNodeOrDie(); return getJavaScriptNode(domNode.getParentNode()); }