[whatwg] Re-introducing AutomaticDOMTransaction interface to decouple automatic transaction from UndoManager
rniwa at webkit.org
Wed Nov 30 12:46:06 PST 2011
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.
More information about the whatwg