{@inheritDoc}
(final boolean deep)
| 849 | * {@inheritDoc} |
| 850 | */ |
| 851 | @Override |
| 852 | public DomNode cloneNode(final boolean deep) { |
| 853 | final DomNode newnode; |
| 854 | try { |
| 855 | newnode = (DomNode) clone(); |
| 856 | } |
| 857 | catch (final CloneNotSupportedException e) { |
| 858 | throw new IllegalStateException("Clone not supported for node [" + this + "]", e); |
| 859 | } |
| 860 | |
| 861 | newnode.parent_ = null; |
| 862 | newnode.nextSibling_ = null; |
| 863 | newnode.previousSibling_ = null; |
| 864 | newnode.scriptObject_ = null; |
| 865 | newnode.firstChild_ = null; |
| 866 | newnode.attachedToPage_ = false; |
| 867 | |
| 868 | // if deep, clone the children too. |
| 869 | if (deep) { |
| 870 | for (DomNode child = firstChild_; child != null; child = child.nextSibling_) { |
| 871 | newnode.appendChild(child.cloneNode(true)); |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | return newnode; |
| 876 | } |
| 877 | |
| 878 | /** |
| 879 | * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> |
no test coverage detected