- From: Ryosuke Niwa <rniwa@webkit.org>
- Date: Tue, 30 Aug 2011 12:30:48 -0700
On Tue, Aug 30, 2011 at 12:21 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote: > On 11-08-30 3:15 PM, Ryosuke Niwa wrote: > >> 1. Should Transaction have reapply property or not? It appears that >> some >> >> of us (e.g. me, Annie, Alex) want it for semantical clarity while >> others >> (e.g. Jonas and Ehsan) doesn't wait to avoid code duplication and to >> simply >> the API. >> > > I still think that if we can design an API which discourages code > duplication, we probably should. > (I feel like we're bikesheding here but) authors can do that by omitting reapply as in {'apply': ..., 'unapply': ...}. > 2. "Transaction" seems to be too generic. Need more domain-specific >> name >> such as UndoTransaction. >> > > I don't have a lot of ideas on what a better name would be. I don't like > any of the suggested ones. UndoTransaction makes it seem like the > transaction can only be undone. EditingTransaction makes it seem like the > transaction is somehow tied to editing commands... I had used the name DOMTransaction in earlier drafts of my document. > 3. "Managed transaction" seems to be confusing as to whether it's >> managed >> >> by the UA or the author. >> 4. Jonas requested that we have manualTransact and managedTransact >> >> instead of single transact on undoManager for clarity. I think this is >> a >> good idea but I'd rather settle the naming issue first. >> > > I agree that this is a good idea. Alternatively, we can make separate the idea of managed/manual transaction and undoManager and add a function like createAutomaticTransaction() that takes a callback. It'll then create a Transaction object with apply, unapply reapply properties. Authors can then add it to UndoManager just like manual transactions. This will make the responsibility of undoManager and transactions clear; undoManager is solely responsible for managing undo transaction history and won't be concerned with DOM changes at all. With this interface, there is exactly one type of Transaction. And the difference between manual transaction and managed transaction is just that whether it's created manually by the author or via some special function (e.g. createAutomaticTransaction). - Ryosuke
Received on Tuesday, 30 August 2011 12:30:48 UTC