[XML-SIG] dom implementations

Alexandre Fayolle Alexandre.Fayolle@logilab.fr
Tue, 30 Jan 2001 10:13:40 +0100 (CET)


On 30 Jan 2001, Lars Marius Garshol wrote:

> * Alexandre Fayolle
> | 
> | One thing you have to keep in mind is that 4DOM include features not
> | available in other implementations, such as DOM L2 Events: each time
> | you manipulate nodes, events get propagated up the DOM tree. This is
> | a huge overhead, but it is so useful when displaying a DOM in a
> | gui...
> 
> It is tempting to look into ways of not having to pay this huge
> penalty when you don't use that feature.  I've come across similar
> problems many times when doing Python programming and wish there were
> a general solution.

I thought about this when I added Events to 4DOM, and finally did not
implement a way to disable them, because I was a bit in a hurry at that
time.

I now see two solutions possible solutions:

 * have the Document instance be aware of existing listeners, and let the
propagation methods query the document before actually propagating
anything (this would completely disable Event propagation if noone is
listening)

 * use the the hasFeature method of the DOM implementation to see if we
want DOM L3 events (a bit as is done in the 4DOM test suite where
namespaces are disabled at some point), and let the propagatoin know if it
is expected to propagate anything.

Alexandre Fayolle
-- 
http://www.logilab.com 
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).