[whatwg] Feedback on UndoManager spec

Jonas Sicking jonas at sicking.cc
Wed Nov 30 17:38:57 PST 2011


On Wed, Nov 30, 2011 at 1:00 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> I initially thought this is a good idea. But then it would make the
> interface for automatic transaction and manual transaction different, and it
> won't help us converging on 3 methods or boolean/string argument.
>
> While I'd like to make sure everyone's happy with API (both developers and
> implementors), I feel we've spent enough time on bike-shedding about this
> and want to move forward with the spec.
>
> Thus, using my editorial power, I'd declare that we'll go with 3 methods
> (apply, unapply, reapply) for both automatic transaction and manual
> transaction for now especially because Jonas said he's okay with it on
> #whatwg. If we find out that authors end up emulating boolean/string
> argument, then we can add the argument back in the future.

Wait, this is far from the parts that I said that I can live with,
which is skipping the argument to apply and/or having the explicit
AutomaticDOMTransaction ctor.

I actually think it's actively bad to converge on having the same
interface for automatic and manual transaction. The two work in
dramatically different ways. The code that goes into the "apply"
function of a automatic transaction has dramatically different meaning
than the code that goes into the "apply" function for a manual
transaction since the UA records the actions of the former and stores
them away.

So in automatic transactions the "apply" function is what essentially
creates the transaction. The "reapply"/"unapply" functions for
automatic transactions are merely convenience sugar. For manual
transactions this isn't the case at all obviously.

So I actually think it should be a goal to not have the same API for
manual and automatic transactions, to make things more clear for
authors.

So let's not toss out the baby with the bathwater and keep that part
of the proposal.

But as I said (or at least intended to say), I'm fine with getting rid
of the argument to "apply" for manual transactions.

/ Jonas



More information about the whatwg mailing list