I've been thinking about the areas where we could try to reduce the amount of code we have (smaller footprint, simpler code, etc, etc). This is to complement changes like deCOMtamination, reducing size of static data tables, etc. The big win with reducing actual amount of code is that usually this leads to a maintainability win....

The things that come to mind most readily:

1) Making nsXULDocument inherit from nsDocument (jst, are you still
working on this?)
2) Having an nsBaseContentSink that HTML/XML/XULContentSink all
inherit from (handling of <meta> and <link> elements could go here,
along with other goodies). In fact we may want something like:

nsBaseContentSink
|-------------------------nsBaseXMLContentSink
| |----------------------|
HTMLContentSink XMLContentSink XULContentSink

(or nsBaseXMLContentSink could just be XMLContentSink and the XUL
sink could override whatever is needed).

Is anyone willing to work on this who knows this code well? If not,
I could take a crack at it come summer...
3) CSSFrameConstructor -- lots of code duplication here; not clear how
to reduce it, though.... Likely requires multiple separate patches,
one per instance of code duplication.
4) SetAttr code duplication (see
nsGenericHTMLElement::SetAttr(nsINodeInfo* aNodeInfo, const
nsAString& aValue, PRBool aNotify)).
5) Duplicated doctype parsing code in nsParser and content sink (see
nsHTMLContentSink::AddDoctypeDecl)

Any other low-hanging (from a "this code is clearly wasteful" viewpoint) fruit like that? I'd think that reflow has some patterns that are repeated over and over....

I think that it would be good to start working on some of these areas with an eye to landing them in the 1.5 (or even 1.4 if we're uber-cool somehow) timeframe...


Reply via email to