private static Map<String, DomAttr> createAttributesCopyWithClonedAttribute(final HtmlElement elt, final String attrName) { final Map<String, DomAttr> newMap = new HashMap<>(elt.getAttributesMap()); // clone the specified element, if possible final DomAttr attr = newMap.get(attrName); if (null == attr) { return newMap; } final DomAttr clonedAttr = new DomAttr(attr.getPage(), attr.getNamespaceURI(), attr.getQualifiedName(), attr.getValue(), attr.getSpecified()); newMap.put(attrName, clonedAttr); return newMap; }
private static Map<String, DomAttr> createAttributesCopyWithClonedAttribute(final HtmlElement elt, final String attrName) { final Map<String, DomAttr> newMap = new HashMap<>(elt.getAttributesMap()); // clone the specified element, if possible final DomAttr attr = newMap.get(attrName); if (null == attr) { return newMap; } final DomAttr clonedAttr = new DomAttr(attr.getPage(), attr.getNamespaceURI(), attr.getQualifiedName(), attr.getValue(), attr.getSpecified()); newMap.put(attrName, clonedAttr); return newMap; }
private void initTextNode() { if (textNode_ == null) { final String value = getValue(); if (!org.apache.commons.lang3.StringUtils.isEmpty(value)) { final DomText text = new DomText(getDomNodeOrDie().getPage(), value); getDomNodeOrDie().appendChild(text); textNode_ = text.getScriptableObject(); } } }
private void initTextNode() { if (textNode_ == null) { final String value = getValue(); if (!org.apache.commons.lang3.StringUtils.isEmpty(value)) { final DomText text = new DomText(getDomNodeOrDie().getPage(), value); getDomNodeOrDie().appendChild(text); textNode_ = text.getScriptableObject(); } } }
/** * {@inheritDoc} */ @Override public void setTextContent(final String textContent) { final boolean mappedElement = HtmlPage.isMappedElement(getOwnerDocument(), getName()); if (mappedElement) { ((HtmlPage) getPage()).removeMappedElement((HtmlElement) getOwnerElement()); } setValue(textContent); if (mappedElement) { ((HtmlPage) getPage()).addMappedElement(getOwnerElement()); } } }
/** * {@inheritDoc} */ @Override public void setTextContent(final String textContent) { final boolean mappedElement = HtmlPage.isMappedElement(getOwnerDocument(), getName()); if (mappedElement) { ((HtmlPage) getPage()).removeMappedElement((HtmlElement) getOwnerElement()); } setValue(textContent); if (mappedElement) { ((HtmlPage) getPage()).addMappedElement(getOwnerElement()); } } }
/** * {@inheritDoc} */ @Override public Node getLastChild() { if (getBrowserVersion().hasFeature(JS_ATTR_FIRST_LAST_CHILD_RETURNS_NULL)) { return null; } final DomText text = new DomText(getDomNodeOrDie().getPage(), getNodeValue()); return (Node) text.getScriptableObject(); }
/** * {@inheritDoc} */ @Override public Node getLastChild() { if (getBrowserVersion().hasFeature(JS_ATTR_FIRST_LAST_CHILD_RETURNS_NULL)) { return null; } final DomText text = new DomText(getDomNodeOrDie().getPage(), getNodeValue()); return (Node) text.getScriptableObject(); }