On FF and IE, DomNode.cloneNode() clones the node exactly, whereas HtmlUnit sets the "id" attribute to "".
There are tests to make sure this happens, but the tests were added in the same commit as the code that drops the id values.
I can't find anything to suggest why the id attributes should be dropped (although a tracker number in the commit message would have helped).
Attached html file can be loaded in a real browser to show its behaviour.
Attached patch fixes src, adds test for same id value in clone, and removed incorrect tests.
Verify real browser behaviour
Logged In: YES
user_id=1750644
Originator: YES
File Added: clonedropsids.diff
Logged In: YES
user_id=1109422
Originator: NO
I'll have a look at this. Apparently the offending code was introduced in the patch to the following bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1065376&group_id=47038&atid=448266
Logged In: YES
user_id=1109422
Originator: NO
I don't know why the id was being explicitly removed, but it doesn't match browser behavior, so I've committed the necessary changes to SVN. Thanks!