/** * Replace all children elements of this element with the supplied value. * @param value - the new value for the contents of this node */ public void jsxSet_innerHTML(final Object value) { final DomNode domNode = getDomNodeOrDie(); final boolean ie = getBrowserVersion().isIE(); if (ie && INNER_HTML_READONLY_IN_IE.contains(domNode.getNodeName())) { throw Context.reportRuntimeError("innerHTML is read-only for tag " + domNode.getNodeName()); } domNode.removeAllChildren(); // null && IE -> add child // null && non-IE -> Don't add // '' -> Don't add if ((value == null && ie) || (value != null && !"".equals(value))) { final String valueAsString = Context.toString(value); parseHtmlSnippet(domNode, true, valueAsString); //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (domNode.getParentNode() == null && ie) { final DomDocumentFragment fragment = ((HtmlPage) domNode.getPage()).createDomDocumentFragment(); fragment.appendChild(domNode); } } }
/** * Replace all children elements of this element with the supplied value. * @param value - the new value for the contents of this node */ public void jsxSet_innerHTML(final Object value) { final DomNode domNode = getDomNodeOrDie(); final boolean ie = getBrowserVersion().isIE(); if (ie && INNER_HTML_READONLY_IN_IE.contains(domNode.getNodeName())) { throw Context.reportRuntimeError("innerHTML is read-only for tag " + domNode.getNodeName()); } domNode.removeAllChildren(); // null && IE -> add child // null && non-IE -> Don't add // '' -> Don't add if ((value == null && ie) || (value != null && !"".equals(value))) { final String valueAsString = Context.toString(value); parseHtmlSnippet(domNode, true, valueAsString); //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (domNode.getParentNode() == null && ie) { final DomDocumentFragment fragment = ((HtmlPage) domNode.getPage()).createDomDocumentFragment(); fragment.appendChild(domNode); } } }
/** * Replace all children elements of this element with the supplied value. * @param value - the new value for the contents of this node */ public void jsxSet_innerHTML(final Object value) { final DomNode domNode = getDomNodeOrDie(); final boolean ie = getBrowserVersion().isIE(); if (ie && INNER_HTML_READONLY_IN_IE.contains(domNode.getNodeName())) { throw Context.reportRuntimeError("innerHTML is read-only for tag " + domNode.getNodeName()); } domNode.removeAllChildren(); // null && IE -> add child // null && non-IE -> Don't add // '' -> Don't add if ((value == null && ie) || (value != null && !"".equals(value))) { final String valueAsString = Context.toString(value); parseHtmlSnippet(domNode, true, valueAsString); //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (domNode.getParentNode() == null && ie) { final DomDocumentFragment fragment = ((HtmlPage) domNode.getPage()).createDomDocumentFragment(); fragment.appendChild(domNode); } } }
/** * Replace all children elements of this element with the supplied value. * @param value - the new value for the contents of this node */ public void jsxSet_innerText(final String value) { final DomNode domNode = getDomNodeOrDie(); if (INNER_TEXT_READONLY.contains(domNode.getNodeName())) { throw Context.reportRuntimeError("innerText is read-only for tag " + domNode.getNodeName()); } domNode.removeAllChildren(); final DomNode node = new DomText(getDomNodeOrDie().getPage(), value); domNode.appendChild(node); //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (domNode.getParentNode() == null && getBrowserVersion().isIE()) { final DomDocumentFragment fragment = ((HtmlPage) domNode.getPage()).createDomDocumentFragment(); fragment.appendChild(domNode); } }
/** * Replace all children elements of this element with the supplied value. * @param value - the new value for the contents of this node */ public void jsxSet_innerText(final String value) { final DomNode domNode = getDomNodeOrDie(); if (INNER_TEXT_READONLY.contains(domNode.getNodeName())) { throw Context.reportRuntimeError("innerText is read-only for tag " + domNode.getNodeName()); } domNode.removeAllChildren(); final DomNode node = new DomText(getDomNodeOrDie().getPage(), value); domNode.appendChild(node); //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (domNode.getParentNode() == null && getBrowserVersion().isIE()) { final DomDocumentFragment fragment = ((HtmlPage) domNode.getPage()).createDomDocumentFragment(); fragment.appendChild(domNode); } }
/** * Replace all children elements of this element with the supplied value. * @param value - the new value for the contents of this node */ public void jsxSet_innerText(final String value) { final DomNode domNode = getDomNodeOrDie(); if (INNER_TEXT_READONLY.contains(domNode.getNodeName())) { throw Context.reportRuntimeError("innerText is read-only for tag " + domNode.getNodeName()); } domNode.removeAllChildren(); final DomNode node = new DomText(getDomNodeOrDie().getPage(), value); domNode.appendChild(node); //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (domNode.getParentNode() == null && getBrowserVersion().isIE()) { final DomDocumentFragment fragment = ((HtmlPage) domNode.getPage()).createDomDocumentFragment(); fragment.appendChild(domNode); } }