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

Ryosuke Niwa rniwa at webkit.org
Sat Sep 10 19:01:09 PDT 2011


On Tue, Aug 30, 2011 at 7:22 PM, Jonas Sicking <jonas at sicking.cc> wrote:
>
> I'm really failing to think of a case when you'd really want to have
> apply and reapply as separate callbacks. Even in the most trivial
> cases it seems like it would lead to code duplication which is
> something that even the most basic developers try to avoid. And
> especially in more complex scenarios like collaborative editors it
> seems like you really wouldn't want to duplicate the logic between
> apply and reapply.
>
> So once we have the boolean argument to apply, I fail to see any cases
> where the reapply approach is better. I'd love to see some examples if
> you have any?
>

One more reason not to add the boolean argument is that apply function is
supplied in both automatic and manual transactions yet reapply call never
happens in automatic transactions. This makes odd for apply function to take
the boolean argument in automatic case.

- Ryosuke



More information about the whatwg mailing list