W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

Re: [UndoManager] Re-introduce DOMTransaction interface?

From: Yuval Sadan <sadan.yuval@gmail.com>
Date: Thu, 12 Jul 2012 16:20:49 +0300
Message-ID: <CAJaqjSrWkS6PrTgXSS+ERx-NqH6Mm5SOkR9TT=E4ypZ-xrss7Q@mail.gmail.com>
To: olli@pettay.fi
Cc: Jonas Sicking <jonas@sicking.cc>, Ryosuke Niwa <rniwa@webkit.org>, Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org
>
>
> 'this' would be the object, not window when callback object is used.
>

I was talking about what Ojan wrote:
I was specifically talking about WebIDL Dictionaries. In which case,
this.undo would set the undo property on the window. Why would you want to
be able to set the undo function from the execut function? My whole point
has been that we should not keep the actual object.

on which, by the way, I also have to say: one of the nice things about the
web is that the most interesting things sprout out of things being used out
of context and beyond their purpose (am I quoting Einstein when I say that
"a problem cannot be solved using the same terms that were used to define
it"?).
In this specific case, access to the object allows for context in the
execute() call. This supports the notion, which you may discard of, of a
module for actions that is separate from the UndoManager.

Re using actions for several times, intuitively, an UndoManager can either
throw an exception when an action is performed twice, or --the more elegant
approach imo-- let an action be executed multiple times, and whatever would
have applied to the single action (undo/redo behaviour) applies to each
transaction. And if the author chooses to meddle with the undo/redo
behaviour after execution, it's her responsibility. What applies to the
operation is what is defined at the time the undo/redo occurs. Keep it
simple.

Yuval
Received on Thursday, 12 July 2012 13:21:41 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:53 GMT