
On Wed, 2007-01-24 at 15:32 -0400, bulia byak wrote:
* Replace style.cpp entirely, with a clearer and cleaner version.
Mental or anyone, can you please elaborate on what is fundamentally wrong with style.cpp? Yes, it's huge and messy, but so is CSS specification. Megatons of work went into testing and debugging this piece of code over the years. Is there no chance it could be improved gradually rather than replaced wholesale?
I think it's only practical to conduct the process incrementally, but when it's complete I don't expect any of the original code to be left.
There are a lot of serious individual problems, but the fundamental problem really is that it's huge and messy -- far more than the CSS specification calls for -- and that the mess keeps those individual problems from getting fixed.
On the outside, it should present a simple set of accessor methods for getting/setting properties by name, and propagating to/from repr.
On the inside, it should consist of (in code, in no particular order):
1. a concise list of property names with the expected domain of values in CSS and the associated Inkscape data type
2. a concise list of property aliases which represent one or more properties combined, each with the rule used to combine
3. definitions of the aforementioned rules and value domains
4. some generic code (not tied to any one property) implementing the needed behavior
In some respects, we're already not too far away from the ideal (there's already a bit of #3 evident), but in others we've got a long way to go (#4, for instance -- a lot of stuff that should be identical is currently implemented redundantly and inconsistently, once for each property).
-mental