Working As Designed.
There are three options here:
1) Copy the userData pointer to the new node.
2) Have the new node point to a new clone of the userData object.
3) Have the new node start with userData empty
All of these are the right answer for some applications and absolutely the
wrong answer for others. Our DOM has no way of knowing which one you want,
and has to pick one. And the right answer may differ from node to node,
which is a problem when doing a deep clone.
We picked option (3), which is the safest of the three. If you want one of
the other options, you can write a convenience function which wraps around
cloneNode and copies/clones as much or as little userData as you want to
retain.
(It would be possible to build a system in which userData objects were
required to implement an interface that allowed them to tell cloneNode
whether they should be copied or not. But that's much more complicated than
we really wanted to deal with.)
Note that userData is a custom feature of this DOM, and may be phased out
when DOM Level 3's nodeKey feature comes in and permits a more portable
solutoin.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]