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

[whatwg] Feedback on UndoManager spec

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Mon, 7 Nov 2011 08:55:05 -0800
Message-ID: <CABNRm61Obb2yi1QwOEVdULsZntBAAHEVRT_VUz=VpOGtB=0uKw@mail.gmail.com>
On Mon, Nov 7, 2011 at 8:15 AM, Aryeh Gregor <ayg at aryeh.name> wrote:
>
> What you're saying is that maybe there will be parts of the DOM that
> the author doesn't want the UA to touch?  In that case, how about we
> let the author specify that UA undo/redo shouldn't affect certain
> subtrees?  E.g., have the plane that shows a list of slides in <div
> noundo> or something like that.  Then just like the UA doesn't
> undo/redo DOM changes outside the undo scope, it shouldn't undo/redo
> changes in a noundo region (or whatever you want the attribute to be
> called).
>

I don't understand what problem(s) you're trying to solve here. Even if we
introduced noundo content attribute, there's nothing that prevents authors
from not using that content attribute and modifying DOM directly.

Also, this noundo content attribute will be problematic inside
contenteditable region because random elements that need to removed/moved
may have this attribute.

This way, again, the UA will never be faced with the problem of
> undoing/redoing changes in a part of the DOM that the author may have
> tampered with.  This is critical for making the APIs work reliably --
> if automatic undo/redo can fail because of authoring bugs, authors
> won't want to use it.  It also simplifies the API by getting rid of
> the distinction between automatic and manual transactions.
>

Adding noundo content attribute doesn't solve this problem because authors
can still temper with the parts of DOM managed by the UA, and some UAs will
still manage to undo managed transactions.

Are you (or anyone) making a list of use-cases somewhere?  If not, I
> guess I will, because it's really essential to designing a good API.
>

There's out-dated list at http://rniwa.com/editing/undomanager-usecases.html

- Ryosuke
Received on Monday, 7 November 2011 08:55:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:09 UTC