[whatwg] UndoManager questions
rniwa at webkit.org
Tue May 29 21:17:01 PDT 2012
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.
* 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 be
> ** 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).
More information about the whatwg