/** * Parsing of the children is done, we can move our children to the content. */ @Override protected void onAllChildrenAddedToPage(final boolean postponed) { while (getFirstChild() != null) { final DomNode child = getFirstChild(); child.basicRemove(); domDocumentFragment_.appendChild(child); } } }
/** * Parsing of the children is done, we can move our children to the content. */ @Override protected void onAllChildrenAddedToPage(final boolean postponed) { while (getFirstChild() != null) { final DomNode child = getFirstChild(); child.basicRemove(); domDocumentFragment_.appendChild(child); } } }
/** * Appends a new child as the last child of the node. * @param newChild the new child node to be appended at the end of the list of children belonging to this node * @return the new child node successfully appended to the list */ @JsxFunction public Object appendChild(final Object newChild) { if (newChild == null || "null".equals(newChild)) { throw Context.reportRuntimeError("Type mismatch."); } Object appendedChild = null; if (newChild instanceof XMLDOMNode) { final XMLDOMNode childNode = (XMLDOMNode) newChild; // Get XML node for the DOM node passed in final DomNode childDomNode = childNode.getDomNodeOrDie(); // Get the parent XML node that the child should be added to. final DomNode parentNode = getDomNodeOrDie(); // Append the child to the parent node parentNode.appendChild(childDomNode); appendedChild = newChild; // if the parentNode has null parentNode in IE, // create a DocumentFragment to be the parentNode's parentNode. if (!(parentNode instanceof SgmlPage) && !(this instanceof XMLDOMDocumentFragment) && parentNode.getParentNode() == null) { final DomDocumentFragment fragment = parentNode.getPage().createDocumentFragment(); fragment.appendChild(parentNode); } } return appendedChild; }
/** * Appends a new child as the last child of the node. * @param newChild the new child node to be appended at the end of the list of children belonging to this node * @return the new child node successfully appended to the list */ @JsxFunction public Object appendChild(final Object newChild) { if (newChild == null || "null".equals(newChild)) { throw Context.reportRuntimeError("Type mismatch."); } Object appendedChild = null; if (newChild instanceof XMLDOMNode) { final XMLDOMNode childNode = (XMLDOMNode) newChild; // Get XML node for the DOM node passed in final DomNode childDomNode = childNode.getDomNodeOrDie(); // Get the parent XML node that the child should be added to. final DomNode parentNode = getDomNodeOrDie(); // Append the child to the parent node parentNode.appendChild(childDomNode); appendedChild = newChild; // if the parentNode has null parentNode in IE, // create a DocumentFragment to be the parentNode's parentNode. if (!(parentNode instanceof SgmlPage) && !(this instanceof XMLDOMDocumentFragment) && parentNode.getParentNode() == null) { final DomDocumentFragment fragment = parentNode.getPage().createDocumentFragment(); fragment.appendChild(parentNode); } } return appendedChild; }
final DomDocumentFragment fragment = new DomDocumentFragment(page); if (start == end) { fragment.appendChild(ancestorClone); fragment.appendChild(n);
/** * 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); } } }
/** * Adds a DOM node to the node. * @param childObject the node to add to this node * @return the newly added child node */ public Object jsxFunction_appendChild(final Object childObject) { Object appendedChild = null; if (childObject instanceof Node) { // Get XML node for the DOM node passed in final DomNode childDomNode = ((Node) childObject).getDomNodeOrDie(); // Get the parent XML node that the child should be added to. final DomNode parentNode = getDomNodeOrDie(); // Append the child to the parent node parentNode.appendChild(childDomNode); appendedChild = childObject; //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (!(parentNode instanceof SgmlPage) && !(this instanceof DocumentFragment) && parentNode.getParentNode() == null && getBrowserVersion().isIE()) { final DomDocumentFragment fragment = parentNode.getPage().createDomDocumentFragment(); fragment.appendChild(parentNode); } } return appendedChild; }
/** * Adds a DOM node to the node. * @param childObject the node to add to this node * @return the newly added child node */ public Object jsxFunction_appendChild(final Object childObject) { Object appendedChild = null; if (childObject instanceof Node) { // Get XML node for the DOM node passed in final DomNode childDomNode = ((Node) childObject).getDomNodeOrDie(); // Get the parent XML node that the child should be added to. final DomNode parentNode = getDomNodeOrDie(); // Append the child to the parent node parentNode.appendChild(childDomNode); appendedChild = childObject; //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (!(parentNode instanceof SgmlPage) && !(this instanceof DocumentFragment) && parentNode.getParentNode() == null && getBrowserVersion().isIE()) { final DomDocumentFragment fragment = parentNode.getPage().createDomDocumentFragment(); fragment.appendChild(parentNode); } } return appendedChild; }
/** * Adds a DOM node to the node. * @param childObject the node to add to this node * @return the newly added child node */ public Object jsxFunction_appendChild(final Object childObject) { Object appendedChild = null; if (childObject instanceof Node) { // Get XML node for the DOM node passed in final DomNode childDomNode = ((Node) childObject).getDomNodeOrDie(); // Get the parent XML node that the child should be added to. final DomNode parentNode = getDomNodeOrDie(); // Append the child to the parent node parentNode.appendChild(childDomNode); appendedChild = childObject; //if the parentNode has null parentNode in IE, //create a DocumentFragment to be the parentNode's parentNode. if (!(parentNode instanceof SgmlPage) && !(this instanceof DocumentFragment) && parentNode.getParentNode() == null && getBrowserVersion().isIE()) { final DomDocumentFragment fragment = parentNode.getPage().createDomDocumentFragment(); fragment.appendChild(parentNode); } } return appendedChild; }
/** * 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); } }
fragment.appendChild(domNode);
fragment.appendChild(domNode);
BrowserVersionFeatures.JS_APPEND_CHILD_CREATE_DOCUMENT_FRAGMENT_PARENT_IF_PARENT_IS_NULL)) { final DomDocumentFragment fragment = parentNode.getPage().createDomDocumentFragment(); fragment.appendChild(parentNode);
&& getWindow().getWebWindow().getWebClient().getBrowserVersion().isIE()) { final DomDocumentFragment fragment = domNode.getPage().createDomDocumentFragment(); fragment.appendChild(domNode);
&& getWindow().getWebWindow().getWebClient().getBrowserVersion().isIE()) { final DomDocumentFragment fragment = domNode.getPage().createDomDocumentFragment(); fragment.appendChild(domNode);
&& getWindow().getWebWindow().getWebClient().getBrowserVersion().isIE()) { final DomDocumentFragment fragment = domNode.getPage().createDomDocumentFragment(); fragment.appendChild(domNode);