OSDN Git Service

Implement adoptNode() and importNode().
authorJesse Wilson <jessewilson@google.com>
Wed, 10 Mar 2010 00:33:18 +0000 (16:33 -0800)
committerJesse Wilson <jessewilson@google.com>
Wed, 10 Mar 2010 02:07:09 +0000 (18:07 -0800)
commit4daa600befc82e6f29ee943645dbbcc51f12097e
treebbf4d555ae1bca7091cfbbfbd6af330ae9084b31
parent631bbbff684e9fe41a5a08ffa3e13fa3bed01212
Implement adoptNode() and importNode().

importNode() shares all of its implementation with Node.clone();
the only areas they differ are the ones we don't support. The
shared code is in 2 new methods, shallowCopy() and cloneOrImportNode(),
both based on the old clone() method.

Also removing some unnecessary "throws DOMException" clauses.

The tests for the new methods are slightly cumbersome. Most move/copy
nodes to another document, serialize that, and compare.

Change-Id: Id9fb076e020d8327a8f70da401af9bd95d7a3d1b
libcore/xml/src/main/java/org/apache/harmony/xml/dom/AttrImpl.java
libcore/xml/src/main/java/org/apache/harmony/xml/dom/DocumentImpl.java
libcore/xml/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java
libcore/xml/src/test/java/tests/xml/DomTest.java
libcore/xml/src/test/java/tests/xml/NormalizeTest.java