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

Ryosuke Niwa rniwa at webkit.org
Fri Aug 12 15:10:29 PDT 2011

On Fri, Aug 12, 2011 at 3:07 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:

> On 11-08-09 6:36 PM, Jonas Sicking wrote:
>> Sure, your API is more convenient in certain situations. But it also
>> encourages code duplication (I'll note that in the examples you
>> originally provided in this thread you always ended up duplicating
>> code between apply/reapply), which easily leads to bugs.
> I think this is a very important point, and this downside makes me think
> that we shouldn't expose a reapply API.  Since almost every case that I can
> think of where having a reapply function would make more sense requires
> authors to maintain other state information in their transaction objects, I
> don't think that maintaining one more boolean flag is going to make things
> noticeably harder for them.

But having authors add flag in almost all cases isn't that nice either.

- Ryosuke

More information about the whatwg mailing list