W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2011

[whatwg] Re-introducing AutomaticDOMTransaction interface to decouple automatic transaction from UndoManager

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Wed, 30 Nov 2011 12:46:06 -0800
Message-ID: <CABNRm62g9g1-rUM3PP9LdAT4Fc3VHxQB6QuMb0ekK8=FyHAHRg@mail.gmail.com>
On Wed, Nov 30, 2011 at 12:36 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:

> I'm having two sets of doubts about this:
> 1. I think decoupling transactions and the Undo Manager could also be
> potentially bad, since it's not immediately obvious which undo manager (if
> any) ends up tracking those transactions.

This issue becomes irrelevant now because UndoManager doesn't need to
"track" any DOM changes. UndoManager just calls unapply, reapply on the
transaction being added upon undo/redo requests,
and AutomaticDOMTransaction will be responsible for keeping track of DOM
changes made by the author.

2. This seems to shift the execution time of the transaction to the object
> creation time, as opposed to when transact is called.  I'm not sure if this
> is a good idea.

Transact doesn't do anything in this new world. We should probably rename
it to "add" if we're making this change. But I see your point that letting
authors insert an automatic transaction to undoManager at any time might
not be desirable.

- Ryosuke
Received on Wednesday, 30 November 2011 12:46:06 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:38 UTC