/** * {@inheritDoc} */ @Override public Document getOwnerDocument() { return getPage(); }
/** * {@inheritDoc} */ public Document getOwnerDocument() { return getPage(); }
/** * {@inheritDoc} */ public Document getOwnerDocument() { return getPage(); }
/** * {@inheritDoc} */ @Override public String getBaseURI() { return getPage().getUrl().toExternalForm(); }
/** * {@inheritDoc} */ @Override public String jsxGet_nodeName() { final DomNode domNode = getDomNodeOrDie(); String nodeName = domNode.getNodeName(); if (domNode.getPage() instanceof HtmlPage) { nodeName = nodeName.toUpperCase(); } return nodeName; }
/** * Indicates if the node can be inserted. * @param childObject the node * @return {@code false} if it is not allowed here */ private static boolean isNodeInsertable(final Node childObject) { if (childObject instanceof HTMLHtmlElement) { final DomNode domNode = childObject.getDomNodeOrDie(); return domNode.getPage().getDocumentElement() != domNode; } return true; }
/** * {@inheritDoc} */ @Override public void setTextContent(final String textContent) { removeAllChildren(); if (textContent != null && !textContent.isEmpty()) { appendChild(new DomText(getPage(), textContent)); } }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * Helper for a common call sequence. * @param feature the feature to check * @return {@code true} if the currently emulated browser has this feature. */ public boolean hasFeature(final BrowserVersionFeatures feature) { return getPage().getWebClient().getBrowserVersion().hasFeature(feature); }
/** * The worker for setInnerText. * @param value the new value for the contents of this node */ protected void setInnerTextImpl(final String value) { final DomNode domNode = getDomNodeOrDie(); domNode.removeAllChildren(); if (value != null && !value.isEmpty()) { domNode.appendChild(new DomText(domNode.getPage(), value)); } }
/** * {@inheritDoc} */ public void setTextContent(final String textContent) { removeAllChildren(); appendChild(new DomText(getPage(), textContent)); }
/** * Notifies the registered {@link IncorrectnessListener} of something that is not fully correct. * @param message the notification to send to the registered {@link IncorrectnessListener} */ protected void notifyIncorrectness(final String message) { final WebClient client = getPage().getEnclosingWindow().getWebClient(); final IncorrectnessListener incorrectnessListener = client.getIncorrectnessListener(); incorrectnessListener.notify(message, this); }
/** * Creates a new Comment. * @param comment the comment text * @return the new Comment */ @JsxFunction public Object createComment(final String comment) { final DomNode domNode = new DomComment(getDomNodeOrDie().getPage(), comment); return getScriptableFor(domNode); }
private HtmlElement getFirstChildElement(final DomNode parent) { if (parent instanceof HtmlNoScript && getPage().getEnclosingWindow().getWebClient().isJavaScriptEnabled()) { return null; } DomNode node = parent.getFirstChild(); while (node != null && node instanceof HtmlElement == false) { node = node.getNextSibling(); } return (HtmlElement) node; }
/** * {@inheritDoc} */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); if (getBrowserVersion().isIE() && !(getDomNodeOrDie().getPage() instanceof HtmlPage)) { ActiveXObject.addProperty(this, "namespaceURI", true, false); ActiveXObject.addProperty(this, "prefix", true, false); } }
/** * {@inheritDoc} */ @Override public Node jsxGet_lastChild() { if (getBrowserVersion().isFirefox()) { final DomText text = new DomText(getDomNodeOrDie().getPage(), jsxGet_nodeValue()); return (Node) text.getScriptObject(); } return null; } }
/** * {@inheritDoc} */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); if (getBrowserVersion().isIE() && !(getDomNodeOrDie().getPage() instanceof HtmlPage)) { ActiveXObject.addProperty(this, "namespaceURI", true, false); ActiveXObject.addProperty(this, "prefix", true, false); } }
/** * {@inheritDoc} */ @Override public void setDomNode(final DomNode domNode) { super.setDomNode(domNode); if (getBrowserVersion().hasFeature(BrowserVersionFeatures.JS_XML_SUPPORT_VIA_ACTIVEXOBJECT) && !(this.<DomNode>getDomNodeOrDie().getPage() instanceof HtmlPage)) { ActiveXObject.addProperty(this, "namespaceURI", true, false); ActiveXObject.addProperty(this, "prefix", true, false); } }
/** * Gets the browser version currently used. * @return the browser version */ public BrowserVersion getBrowserVersion() { final DomNode node = getDomNodeOrNull(); if (node != null) { return node.getPage().getWebClient().getBrowserVersion(); } return getWindow().getWebWindow().getWebClient().getBrowserVersion(); }
/** * Gets the browser version currently used. * @return the browser version */ protected BrowserVersion getBrowserVersion() { final DomNode node = getDomNodeOrNull(); if (node != null) { return node.getPage().getWebClient().getBrowserVersion(); } return getWindow().getWebWindow().getWebClient().getBrowserVersion(); }
/** * Gets the browser version currently used. * @return the browser version */ protected BrowserVersion getBrowserVersion() { final DomNode node = getDomNodeOrNull(); if (node != null) { return node.getPage().getWebClient().getBrowserVersion(); } return getWindow().getWebWindow().getWebClient().getBrowserVersion(); }