From: Joe E. <jen...@fl...> - 2002-05-30 00:32:43
|
Steve et. al -- It looks like integrating dom::c into the new Tcl-DOM generic framework is going to be more difficult than I first expected. Also, there are some serious pitfalls in the generic implementation. The main issue is that the generic layer checks the Tcl_Obj 'typePtr' field of DOM node objects to determine which DOM implementation created the node. dom::c doesn't actually use a separate Tcl_ObjType to represent nodes; instead, it uses strings with handle semantics. (Using strings with handle semantics is actually the safest thing to do in the presence of [dom::DOMImplementation destroy]. Using a custom Tcl_ObjType can lead to Tcl_Obj's with dangling pointers in their internal reps if you're not _extremely_ careful.) Even if dom::c did use a custom Tcl_ObjType, there would still be a danger if multiple DOMImplementations are loaded into the same process. It's very easy for the internal rep to be discarded, and there's no way to get from the string rep back to the DOMImplementation which created the node. If there's only one DOMImplementation registered, this problem won't be fatal (since the generic layer will just dispatch to the single, default, DOMImplementation), but if there are more than one the generic layer is likely to break badly. I'm not sure how to fix this. --Joe English jen...@fl... |