Thomas DeWeese: > I like this basic approach of having an OverrideStyleDeclaration, > although it might be possible to merge the two implementations > with only one or two small modifications between StyleDeclaration and > OverrideStyleDeclaration. Which points to how I would implement this > call back. Currently StyleDeclaration directly notifies the > CSS engine when the style attribute is changed.
It doesn't directly notify it. The CSSEngine just learns about the inline style updates because the style attribute is actually modified, and the CSSEngine has an event handler on DOM attribute modifications. This event handler then calls invalidateProperties to do the cascade. THe override style doesn't influence the style attribute, so there needs to be some other way to get the CSSEngine to notice that it needs to recompute the styles. > The override style would then automatically notify the CSSEngine > of the changes. > > It sounds like you were planning on modifying the override style > and then independently notify the CSSEngine. Or is the question > just how should the override style notify the CSSEngine? Currently I do notify the CSSEngine separately because I didn't know about the whole override style thing. But I do now want to just modify the override style and have it automatically notify the CSSEngine. > In this case I wouldn't be too picky the two classes are pretty > intimately related so having it call methods on CSSEngine isn't a > problem. Yeah, if this was C++ I would just make the OverrideStyleDeclaration class a friend of the CSSEngine so it could call invalidateProperties itself. I guess I'm a bit wary of making invalidateProperties public though, since it has survived being protected all this time. Getting the CSSEngine to register its interest on each OverrideStyleDeclaration (or each SVGStylableElement) isn't a good idea, I think. But if a different approach is made, such as the CSSEngine registering its interest on a particular SVGOMDocument, then the OverrideStyleDeclarations will have to call a public method on the SVGOMDocument to fire off the event, and there's the problem with public methods again. > I guess #2 would be a _very_ slight preference, the trade off > is involving a third class in the whole mess vs having a slightly > more general architecture. What third class do you mean? > That would be great! Do you have an Apache CLA on file? If not > you should probably review it and make sure you can sign one. No I don't. Coincidentally we just had a seminar on IP issues here at uni the other week. It shouldn't be a problem. Cameron -- Cameron McCormack | Web: http://mcc.id.au/ | ICQ: 26955922 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]