Boris Zbarsky wrote:
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....

...
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.
One such area, the calculation of geometric parent (bug 191151). I could use some help determining how the hell to test the patch though :)

The basic problem is, due to code duplication many paths that probably should not be different are slightly different. People fix problems in one place and not in others, or add code that really *does* only apply to one place but wouldn't hurt if it were in the main codepath. This will make some of the code duplication reduction effort rather painful.

Another thing that will likely reduce code duplication a *lot* is to generally make nsCSSFrameConstructor display-type-based, constructing off of a table instead of a bunch of tags. bugs 184746 and 139912 are both related to this, though there's no direct bug.

...
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....

Form control frame interfaces is a spot where there is not so much duplication as dead code, dead interfaces and never-called methods.

There is also events ... many children of nsGenericElement override HandleDOMEvent and some of them duplicate code from it--for example, file controls duplicate the event retargeting code.

--John




Reply via email to