We should move the attribute mapping code out of the content nodes for the following reasons: * It would be easier to maintain if it's in one place, in the style system (near nsHTMLStyleSheet.cpp and nsHTMLMappedAttributes.cpp). * The attribute mapping code doesn't logically belong in content -- content shouldn't know about the style system, except for exposing a few DOM methods. * If we don't recombine layout and content, it's the main obstacle to moving all style system code back into the layout library. * It gives the DOM folks one more excuse to keep all the separate content node implementations with the forwarding, etc. The tag names could be handled using a perfect hash. Seehttp://lxr.mozilla.org/classic/source/lib/libparse/
If you're going to rewrite this, could you make the apis non-html specific, so that SVG can take advantage of this without having to copy code arround?
There are also similar tools in http://lxr.mozilla.org/seamonkey/source/layout/tools/
See also the directory structure proposed in bug 107101.
Yeah, the hash would have to be keyed on the namespace as well as the tagname.
I think this was based on a false notion of modularity.