On 01/07/11 20:13, Boris Zbarsky wrote:
> Similarly, I've found it important to
be able to distinguish between nodes that are being removed from a
document tree and nodes that are being moved within the document tree,
Interesting, given that Gecko's DOM implementation does NOT make such
a distinction at the moment. Why did you find this to be important?
My use case involves multiple people simultaneously editing the same
document. The mutations due to user actions are batched and serialized
as JSON. If you know that a given node was moved then you can avoid the
overhead of serializing a full description of its attributes and
content, as is necessary when describing a node to be inserted.
If the browser is able to build a list of all the mutations involved in
a given user action, this would presumably be more efficient than
leaving this to web page scripts to do.
It is critically important to know what nodes have been inserted,
removed, moved, or have had their attributes changed. If all you know is
that some of the children have changed for a given node, the script has
to do a lot of work to find out which have changed and in what manner,
and this will probably involve keeping a local duplicate of the DOM tree
at considerable cost.
The application uses web sockets for exchange of synchronization
messages, and performs a near real time reconciliation of revisions to
the document tree, based upon 3 way merges with one of the clients
playing the role of senior editor when it comes to resolving conflicting
edits.
--
Dave Raggett<d...@w3.org> http://www.w3.org/People/Raggett