On Thu, Mar 22, 2012 at 10:57 AM, <[email protected]> wrote:
> > For each one, look up the original > > canvas, see if it has an "onprint" (or whatever we call it) event handler > > set on it. For those that do: > > If we use events here, there could be two callbacks listening for the same > event. To keep it easy, I propose to define a new `printCallback` attribute > on the nsHTMLCanvasElement, that takes a JSFunction as argument. > > Are there advantages in using an event instead of a simple callback that I > don't realize? > Events are more the standard pattern, that's all. And I think events are a bit more evolvable; it's easier to add fields to an event object without breaking things than to add parameters to a callback function. A callback is OK if you feel strongly about it. Rob -- “You have heard that it was said, ‘Love your neighbor and hate your enemy.’ But I tell you, love your enemies and pray for those who persecute you, that you may be children of your Father in heaven. ... If you love those who love you, what reward will you get? Are not even the tax collectors doing that? And if you greet only your own people, what are you doing more than others?" [Matthew 5:43-47] _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

