[whatwg] UndoManager questions
rniwa at webkit.org
Tue May 29 23:49:01 PDT 2012
On Tue, May 29, 2012 at 9:17 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> On Sat, May 26, 2012 at 8:01 PM, Alex Vincent <ajvincent at gmail.com> wrote:
>> For those not familiar, the spec lives here:
> It has been moved to
>> * The spec is inconsistent in a few places. For instance, in the green
>> non-normative section, clearUndo states:
>> Removes entries in the undo transaction
> This statement in the non-formative section is correct.
> However, in the normative part, it states:
>> The clearUndo() method must remove all entries in the undo transaction
>> history <
>> the undo
>> position <http://rniwa.com/editing/undomanager.html#undo-position>.
> This statement is incorrect. Will fix.
> * The spec mentions a "DOM transaction
>> but does not define that.
> Will fix.
> * When adding a transaction to a DOMTransaction as part of execute's
>> merge being true, do we add it to the beginning or the end of the
>> list? This matters for .item().
> I meant at the end, but now that I realize this is inconsistent with the
> way entries in the undoManager is ordered. Will change so that it'll be
> added at the beginning instead.
> * Exception handling is woefully undefined in this spec:
>> ** If my transaction throws an exception during UndoManager.execute(), how
>> should that be handled? What happens to transaction groups that were
>> previously undone?
>> ** If my transaction throws an exception during .undo(), how should that
>> ** Ditto redo.
> Let's start a new thread about this.
> * What precisely lives at UndoManager.item(0)? The most recently completed
>> transaction, or the oldest?
> The most recent.
> * When UndoManager.execute() is called with an object not implementing
>> .undo, or .redo, should we fire some kind of warning to the user? What
>> should happen when we try to undo that transaction?
> There are valid use cases for creating transactions without undo or redo
> method (e.g. need to do something only in undo such as updating toolbar).
> - Ryosuke
More information about the whatwg