[whatwg] UndoManager: rationale for having undoManager.position and undoManager.item?

Ryosuke Niwa rniwa at webkit.org
Thu Jul 19 15:32:21 PDT 2012


On Mon, Jun 25, 2012 at 3:23 PM, Caio Marcelo de Oliveira Filho <
caio.oliveira at openbossa.org> wrote:

> Hi,
>
> In the June 8, 2012 version, there's a note after the description of
> undoManager.item:
>
> "Note: Being able to access an arbitrary element in the undo
> transaction history is needed to allow scripts to determine whether
> new DOM transaction and the last DOM transaction should being to the
> same entry or not."
>
> I'm guessing undoManager.position exists to be used together with
> undoManager.item to achieve this.
>
> After checking the problem descriptions again
> (http://wiki.whatwg.org/wiki/UndoManager_Problem_Descriptions), I'm
> wondering if the use case is only checking the last transaction,
> couldn't we have a smaller API? Or we have other situations where
> "peeking" in the undo stack is desired? Maybe is needed for a specific
> case in Collaborative editing that I couldn't grasp in the problem
> description?
>

There was a use case for collaborative editing case where developers wanted
to be able to modify undo stack as the remote data model changes but I
suppose they could achieve the same effect by removing all entries in the
undo manager & adding new entries?

- Ryosuke


More information about the whatwg mailing list