[whatwg] Fixing undo on the Web - UndoManager and Transaction

Ryosuke Niwa rniwa at webkit.org
Mon Aug 8 23:12:21 PDT 2011

On Fri, Aug 5, 2011 at 7:12 PM, Jonas Sicking <jonas at sicking.cc> wrote:

> On Fri, Aug 5, 2011 at 5:17 PM, Ryosuke Niwa <rniwa at webkit.org> wrote
> > You're right that you can redo what the UA did after you unapplied the
> > managed transaction UA inserted.  So maybe "replace" isn't really that
> > useful after all.  But I had an impression that having to "replay" UA's
> > changes is annoying.  But getting rid of "replace" will certainly make
> the
> > API simpler, and we might able to address the latter concern by
> introducing
> > a function that take a mutation list and re-applies it.
> You'll need to be able to "replay" the UA's DOM changes anyway since
> you need to redo them if the user "undo"s and "redo"s.

That is a very good point.  Let me think about it a little harder and see if
we've missed anything.  If not, we can get rid of this wacky method.

> And there might be some custom UI that shows up around the
> > inserted text.
> For this I wouldn't imagine you want to replace the managed
> transaction anyway since you still want to let the UA deal with
> undo/redo, right? Instead I'd merge another transaction which adds the
> custom UI with the managed one that the UA created.

That's also a good point.

- Ryosuke

More information about the whatwg mailing list