W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

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

From: Ehsan Akhgari <ehsan@mozilla.com>
Date: Fri, 12 Aug 2011 18:11:54 -0400
Message-ID: <4E45A52A.1070206@mozilla.com>
On 11-08-12 6:10 PM, Ryosuke Niwa wrote:
> 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.

Why do you think that authors need to specify the flag in almost all cases?

Ehsan
Received on Friday, 12 August 2011 15:11:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC